From 06c80289b7b4a3bc469c563c61471b306c4a1a5c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 13 May 2019 11:32:51 +0200 Subject: service: use more standard naming scheme for syscalls --- service/zsyscall_windows.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'service/zsyscall_windows.go') diff --git a/service/zsyscall_windows.go b/service/zsyscall_windows.go index bb8d89d4..cc40ddea 100644 --- a/service/zsyscall_windows.go +++ b/service/zsyscall_windows.go @@ -60,7 +60,7 @@ func wtsQueryUserToken(session uint32, token *windows.Token) (err error) { return } -func wtsEnumerateSessions(handle windows.Handle, reserved uint32, version uint32, sessions **wtsSessionInfo, count *uint32) (err error) { +func wtsEnumerateSessions(handle windows.Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) { r1, _, e1 := syscall.Syscall6(procWTSEnumerateSessionsW.Addr(), 5, uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count)), 0) if r1 == 0 { if e1 != 0 { @@ -77,9 +77,11 @@ func wtsFreeMemory(ptr uintptr) { return } -func notifyServiceStatusChange(service windows.Handle, notifyMask uint32, notifyBuffer uintptr) (status uint32) { - r0, _, _ := syscall.Syscall(procNotifyServiceStatusChangeW.Addr(), 3, uintptr(service), uintptr(notifyMask), uintptr(notifyBuffer)) - status = uint32(r0) +func notifyServiceStatusChange(service windows.Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) { + r0, _, _ := syscall.Syscall(procNotifyServiceStatusChangeW.Addr(), 3, uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) + if r0 != 0 { + ret = syscall.Errno(r0) + } return } -- cgit v1.2.3-59-g8ed1b