summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/zsyscall_windows_amd64.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/syscall/zsyscall_windows_amd64.go')
-rw-r--r--src/pkg/syscall/zsyscall_windows_amd64.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pkg/syscall/zsyscall_windows_amd64.go b/src/pkg/syscall/zsyscall_windows_amd64.go
index c6ff6fe02..ea0000c32 100644
--- a/src/pkg/syscall/zsyscall_windows_amd64.go
+++ b/src/pkg/syscall/zsyscall_windows_amd64.go
@@ -142,6 +142,7 @@ var (
procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken")
procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation")
procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
+ procgetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
)
func GetLastError() (lasterr error) {
@@ -308,7 +309,7 @@ func GetStdHandle(stdhandle int) (handle Handle, err error) {
return
}
-func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) {
+func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) {
r0, _, e1 := Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
handle = Handle(r0)
if handle == InvalidHandle {
@@ -321,7 +322,7 @@ func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error)
return
}
-func FindNextFile(handle Handle, data *Win32finddata) (err error) {
+func findNextFile1(handle Handle, data *win32finddata1) (err error) {
r1, _, e1 := Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
if int(r1) == 0 {
if e1 != 0 {
@@ -1600,3 +1601,9 @@ func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
}
return
}
+
+func getCurrentProcessId() (pid uint32) {
+ r0, _, _ := Syscall(procgetCurrentProcessId.Addr(), 0, 0, 0, 0)
+ pid = uint32(r0)
+ return
+}