Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1704)

Unified Diff: src/pkg/syscall/zsyscall_windows_386.go

Issue 6736069: code review 6736069: runtime, syscall, os: add os.ExecPath() (string, error)
Patch Set: diff -r 617db9efbdf1 https://code.google.com/p/go/ Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/syscall/syscall_windows.go ('k') | src/pkg/syscall/zsyscall_windows_amd64.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/pkg/syscall/syscall_windows.go ('k') | src/pkg/syscall/zsyscall_windows_amd64.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b