Index: src/pkg/syscall/zsyscall_windows_386.go |
=================================================================== |
--- a/src/pkg/syscall/zsyscall_windows_386.go |
+++ b/src/pkg/syscall/zsyscall_windows_386.go |
@@ -107,6 +107,7 @@ |
procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId") |
procGetConsoleMode = modkernel32.NewProc("GetConsoleMode") |
procWriteConsoleW = modkernel32.NewProc("WriteConsoleW") |
+ procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW") |
procWSAStartup = modws2_32.NewProc("WSAStartup") |
procWSACleanup = modws2_32.NewProc("WSACleanup") |
procWSAIoctl = modws2_32.NewProc("WSAIoctl") |
@@ -1238,6 +1239,19 @@ |
return |
} |
+func GetModuleFileName(module Handle, fn *uint16, len uint32) (n uint32, err error) { |
+ r0, _, e1 := Syscall(procGetModuleFileNameW.Addr(), 3, uintptr(module), uintptr(unsafe.Pointer(fn)), uintptr(len)) |
+ n = uint32(r0) |
+ if n == 0 { |
+ if e1 != 0 { |
+ err = error(e1) |
+ } else { |
+ err = EINVAL |
+ } |
+ } |
+ return |
+} |
+ |
func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { |
r0, _, _ := Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0) |
if r0 != 0 { |