SetupDiGetDeviceInstanceId

[DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool SetupDiGetDeviceInstanceId(
   IntPtr DeviceInfoSet,
   ref DeviceInfoData DeviceInfoData,
   StringBuilder DeviceInstanceId,
   int DeviceInstanceIdSize,
   ref int RequiredSize
);

Microsoft documentation: Link

Last updated