mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-06 00:57:18 -04:00
windows: do not corrupt stack with larger boolean return value
Windows type PBOOL is a pointer to a 4 byte value, where 0 means false and not-0 means true. That means we should use uint32 here, not bool, since Go bools can be 1 byte. This commit was re-generated using mksyscall_windows.go from CL 196122. Updates: golang/go#34364 Change-Id: I8e83b9a09c0b58d14ac9a7dee316553940ac6ee3 Reviewed-on: https://go-review.googlesource.com/c/sys/+/196123 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -694,7 +694,14 @@ func ExitProcess(exitcode uint32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsWow64Process(handle Handle, isWow64 *bool) (err error) {
|
func IsWow64Process(handle Handle, isWow64 *bool) (err error) {
|
||||||
r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(isWow64)), 0)
|
var _p0 uint32
|
||||||
|
if *isWow64 {
|
||||||
|
_p0 = 1
|
||||||
|
} else {
|
||||||
|
_p0 = 0
|
||||||
|
}
|
||||||
|
r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(&_p0)), 0)
|
||||||
|
*isWow64 = _p0 != 0
|
||||||
if r1 == 0 {
|
if r1 == 0 {
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = errnoErr(e1)
|
err = errnoErr(e1)
|
||||||
|
|||||||
Reference in New Issue
Block a user