mirror of
https://github.com/golang/go
synced 2024-11-15 11:30:36 -07:00
[release-branch.go1] syscall: unexport GetCurrentProcessId on Windows
This commit is contained in:
parent
96ab6e4a84
commit
596e6f390b
@ -201,7 +201,7 @@ func NewCallback(fn interface{}) uintptr
|
||||
//sys RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegQueryInfoKeyW
|
||||
//sys RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegEnumKeyExW
|
||||
//sys RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegQueryValueExW
|
||||
//sys GetCurrentProcessId() (pid uint32) = kernel32.GetCurrentProcessId
|
||||
//sys getCurrentProcessId() (pid uint32) = kernel32.getCurrentProcessId
|
||||
|
||||
// syscall interface implementation for other packages
|
||||
|
||||
@ -684,7 +684,7 @@ func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {
|
||||
}
|
||||
func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return EWINDOWS }
|
||||
|
||||
func Getpid() (pid int) { return int(GetCurrentProcessId()) }
|
||||
func Getpid() (pid int) { return int(getCurrentProcessId()) }
|
||||
|
||||
func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) {
|
||||
// NOTE(rsc): The Win32finddata struct is wrong for the system call:
|
||||
|
@ -142,7 +142,7 @@ var (
|
||||
procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken")
|
||||
procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation")
|
||||
procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
|
||||
procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
|
||||
procgetCurrentProcessId = modkernel32.NewProc("getCurrentProcessId")
|
||||
)
|
||||
|
||||
func GetLastError() (lasterr error) {
|
||||
@ -1602,8 +1602,8 @@ func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func GetCurrentProcessId() (pid uint32) {
|
||||
r0, _, _ := Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0)
|
||||
func getCurrentProcessId() (pid uint32) {
|
||||
r0, _, _ := Syscall(procgetCurrentProcessId.Addr(), 0, 0, 0, 0)
|
||||
pid = uint32(r0)
|
||||
return
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ var (
|
||||
procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken")
|
||||
procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation")
|
||||
procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
|
||||
procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
|
||||
procgetCurrentProcessId = modkernel32.NewProc("getCurrentProcessId")
|
||||
)
|
||||
|
||||
func GetLastError() (lasterr error) {
|
||||
@ -1602,8 +1602,8 @@ func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func GetCurrentProcessId() (pid uint32) {
|
||||
r0, _, _ := Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0)
|
||||
func getCurrentProcessId() (pid uint32) {
|
||||
r0, _, _ := Syscall(procgetCurrentProcessId.Addr(), 0, 0, 0, 0)
|
||||
pid = uint32(r0)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user