Skip to content

CM_Locate_DevNode does not generate friendly overload #1710

@posahok

Description

@posahok

Actual behavior

CM_Locate_DevNode does not generate Span or string overload for second parameter ([Optional] winmdroot.Foundation.PWSTR pDeviceID).

Expected behavior

Generating overloads like:
internal static extern unsafe winmdroot.Devices.DeviceAndDriverInstallation.CONFIGRET CM_Locate_DevNode(out uint pdnDevInst, [Optional] Span pDeviceID, winmdroot.Devices.DeviceAndDriverInstallation.CM_LOCATE_DEVNODE_FLAGS ulFlags);

or

internal static extern unsafe winmdroot.Devices.DeviceAndDriverInstallation.CONFIGRET CM_Locate_DevNode(out uint pdnDevInst, [Optional] string pDeviceID, winmdroot.Devices.DeviceAndDriverInstallation.CM_LOCATE_DEVNODE_FLAGS ulFlags);

Maybe this is expected behaviour. In that case, what is the best way to handle my task - passing string to this method?

Repro steps

  1. NativeMethods.txt content:
CM_Locate_DevNode
  1. NativeMethods.json content (if present):
  1. Any of your own code that should be shared?

Context

  • CsWin32 version: 0.3.275
  • Win32Metadata version (if explicitly set by project):
  • Target Framework: net10.0
  • LangVersion (if explicitly set by project): [e.g. 9]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions