BOOLEAN
SetupDiGetDeviceInstanceId(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData
OUT PTSTR DeviceInstanceId,
IN DWORD DeviceInstanceIdSize,
OUT PDWORD RequiredSize /* optional */
);
SetupDiGetDeviceInstanceId retrieves the device instance ID associated with a device information element.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.
SetupDiCreateDeviceInfo, SetupDiCreateDevRegKey, SetupDiOpenDeviceInfo, SetupDiOpenDevRegKey