chore: corrected the incoming parameters of PowerUnregisterSuspendResumeNotification

This commit is contained in:
wwqgtxx 2024-08-08 13:27:06 +08:00
parent 4f339265d3
commit 951cae2156

View File

@ -55,6 +55,11 @@ func NewEventListener(cb func(Type)) (func(), error) {
} }
handle := uintptr(0) handle := uintptr(0)
// DWORD PowerRegisterSuspendResumeNotification(
// [in] DWORD Flags,
// [in] HANDLE Recipient,
// [out] PHPOWERNOTIFY RegistrationHandle
//);
_, _, err := powerRegisterSuspendResumeNotification.Call( _, _, err := powerRegisterSuspendResumeNotification.Call(
_DEVICE_NOTIFY_CALLBACK, _DEVICE_NOTIFY_CALLBACK,
uintptr(unsafe.Pointer(&params)), uintptr(unsafe.Pointer(&params)),
@ -65,8 +70,11 @@ func NewEventListener(cb func(Type)) (func(), error) {
} }
return func() { return func() {
// DWORD PowerUnregisterSuspendResumeNotification(
// [in, out] HPOWERNOTIFY RegistrationHandle
//);
_, _, _ = powerUnregisterSuspendResumeNotification.Call( _, _, _ = powerUnregisterSuspendResumeNotification.Call(
uintptr(unsafe.Pointer(&handle)), handle,
) )
runtime.KeepAlive(params) runtime.KeepAlive(params)
runtime.KeepAlive(handle) runtime.KeepAlive(handle)