-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Actual behavior
Many configuration manager functions (e.g, CM_Locate_DevNode) take a DEVINSTID as parameter. This is defined as WCHAR * (for DEVINSTID_W). However, in all cases that I encountered the "string" is actually const. I don't know why the Windows API does not have a const DEVINSTID instead, but the result is that CSWin32 generates only PWSTR calls, requiring an unsafe context.
Expected behavior
For those cases where DEVINSTID is in reality const (which could actually even be all cases), string overrides are generated, such that no unsafe context is required.
Repro steps
NativeMethods.txtcontent:
CM_Locate_DevNode
NativeMethods.jsoncontent (if present):
- Any of your own code that should be shared?
https://github.com/dorssel/usbipd-win/blob/master/Usbipd/WindowsDevice.cs#L58-L67
Context
- CsWin32 version:
0.3.264 - Win32Metadata version (if explicitly set by project):
- Target Framework:
net10.0 LangVersion(if explicitly set by project):14
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working