mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
On ARM64 Windows, UnregisterSuspendResumeNotification (user32) forwards to PowerUnregisterSuspendResumeNotification (powrprof), which treats the HPOWERNOTIFY handle as a pointer and dereferences it. The user32 API returns an opaque handle, not a pointer-backed allocation, causing an access violation at shutdown. Add crash keys (pm-reg-handle, pm-reg-memstate, pm-unreg-memstate) to capture - The handle value - VirtualQuery memory state at both registration and unregistration If the handle address is MEM_FREE, it confirms the handle is an opaque index and powrprof is incorrectly dereferencing it. If MEM_COMMIT, it would indicate a use-after-free of the underlying allocation. Refs https://github.com/MicrosoftDocs/sdk-api/blob/docs/sdk-api-src/content/powerbase/nf-powerbase-powerunregistersuspendresumenotification.md