Skip to content

Can't use PowerRegisterSuspendResumeNotification with DEVICE_NOTIFY_CALLBACK #1631

@jeremy-visionaid

Description

@jeremy-visionaid

There's no signature to use PowerRegisterSuspendResumeNotification per the Win32 docs

https://learn.microsoft.com/en-us/windows/win32/api/powerbase/nf-powerbase-powerregistersuspendresumenotification

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

  1. NativeMethods.txt content:
PowerRegisterSuspendResumeNotification
  1. NativeMethods.json content (if present):
{
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "wideCharOnly": true,
  "emitSingleFile": true,
  "public": false,
  "allowMarshaling": false
}
  1. Any of your own code that should be shared?

Context

  • CsWin32 version: 0.3.269
  • Target Framework: net10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions