Skip to content

Commit

Permalink
chore: corrected the incoming parameters of `PowerUnregisterSuspendRe…
Browse files Browse the repository at this point in the history
…sumeNotification`
  • Loading branch information
wwqgtxx committed Aug 8, 2024
1 parent 4f33926 commit 951cae2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion component/power/event_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func NewEventListener(cb func(Type)) (func(), error) {
}
handle := uintptr(0)

// DWORD PowerRegisterSuspendResumeNotification(
// [in] DWORD Flags,
// [in] HANDLE Recipient,
// [out] PHPOWERNOTIFY RegistrationHandle
//);
_, _, err := powerRegisterSuspendResumeNotification.Call(
_DEVICE_NOTIFY_CALLBACK,
uintptr(unsafe.Pointer(&params)),
Expand All @@ -65,8 +70,11 @@ func NewEventListener(cb func(Type)) (func(), error) {
}

return func() {
// DWORD PowerUnregisterSuspendResumeNotification(
// [in, out] HPOWERNOTIFY RegistrationHandle
//);
_, _, _ = powerUnregisterSuspendResumeNotification.Call(
uintptr(unsafe.Pointer(&handle)),
handle,
)
runtime.KeepAlive(params)
runtime.KeepAlive(handle)
Expand Down

0 comments on commit 951cae2

Please sign in to comment.