|
|
@@ -76,6 +76,7 @@ var (
|
|
|
procGetVersion = modkernel32.NewProc("GetVersion")
|
|
|
procFormatMessageW = modkernel32.NewProc("FormatMessageW")
|
|
|
procExitProcess = modkernel32.NewProc("ExitProcess")
|
|
|
+ procIsWow64Process = modkernel32.NewProc("IsWow64Process")
|
|
|
procCreateFileW = modkernel32.NewProc("CreateFileW")
|
|
|
procReadFile = modkernel32.NewProc("ReadFile")
|
|
|
procWriteFile = modkernel32.NewProc("WriteFile")
|
|
|
@@ -646,6 +647,18 @@ func ExitProcess(exitcode uint32) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func IsWow64Process(handle Handle, isWow64 *bool) (err error) {
|
|
|
+ r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(isWow64)), 0)
|
|
|
+ if r1 == 0 {
|
|
|
+ if e1 != 0 {
|
|
|
+ err = errnoErr(e1)
|
|
|
+ } else {
|
|
|
+ err = syscall.EINVAL
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) {
|
|
|
r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
|
|
|
handle = Handle(r0)
|