Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than setupapi, prefix the name with the module name and a period.
CM_Get_DevNode_Registry_Property (setupapi)
.
C# Signature:
[DllImport("setupapi.dll", SetLastError=true)]
public static extern int CM_Get_DevNode_Registry_Property(
uint dnDevInst,
uint ulProperty,
out Microsoft.Win32.RegistryValueKind pulRegDataType,
IntPtr Buffer,
ref uint pulLength,
uint ulFlags);
VB Signature:
Declare Function CM_Get_DevNode_Registry_Property Lib "setupapi.dll" (TODO) As TODO
Also Microsoft.Win32.RegistryValueKind only contains enumerations for the basic kinds.
Tips & Tricks:
Please add some!
Sample Code:
// The following code shows how to grab the parent device's driver name. The devinfo_data.DevInst is
// from SetupDiEnumDeviceInterfaces and SetupDiGetDeviceInterfaceDetail so please see those examples
if (length > 0)
{
IntPtr buffer = Marshal.AllocHGlobal((int)length);
if (CR_SUCCESS == CM_Get_DevNode_Registry_Property(devinst, CM_DRP_DRIVER, out kind, buffer, ref length, 0))
driver_name = Marshal.PtrToStringAnsi(buffer);
Marshal.FreeHGlobal(buffer);
}
}
The SetupDiGetDeviceRegistryProperty function retrieves the specified device property. This handle is typically returned by the SetupDiGetClassDevs or SetupDiGetClassDevsEx function. If the function succeeds, the return value is nonzero.
2/23/2020 9:55:52 PM - -14.9.137.224
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).