BOOLEAN
SetupDiGetSelectedDevice(
IN HDEVINFO DeviceInfoSet,
OUT PSP_DEVINFO_DATA DeviceInfoData
);
SetupDiGetSelectedDevice retrieves the currently-selected device for the specified device information set.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.
SetupDiGetSelectedDevice is usually used by an installation wizard.