Can't use PowerRegisterSuspendResumeNotification with DEVICE_NOTIFY_CALLBACK
Open
Nobody has claimed this yet.
bug
- Dominant language
- C#
- Stars
- 2.5k
- Forks
- 124
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 9
Description
There's no signature to use PowerRegisterSuspendResumeNotification per the Win32 docs
Actual behavior
internal static extern unsafe winmdroot.Foundation.WIN32_ERROR PowerRegisterSuspendResumeNotification(winmdroot.UI.WindowsAndMessaging.REGISTER_NOTIFICATION_FLAGS Flags, winmdroot.Foundation.HANDLE Recipient, void** RegistrationHandle);
Expected behavior
Should have an overload taking DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
Repro steps
NativeMethods.txtcontent:
PowerRegisterSuspendResumeNotification
NativeMethods.jsoncontent (if present):
{
"$schema": "https://aka.ms/CsWin32.schema.json",
"wideCharOnly": true,
"emitSingleFile": true,
"public": false,
"allowMarshaling": false
}
- Any of your own code that should be shared?
Context
- CsWin32 version: 0.3.269
- Target Framework: net10.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PowerRegisterSuspendResumeNotification entry point generated from NativeMethods.txt and NativeMethods.json, then compare its current signature with the Win32 documentation and DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS definition. Done means generation exposes an overload that accepts the callback subscription parameters while preserving the existing form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100