SetupDiGetSelectedDevice

BOOLEAN
    SetupDiGetSelectedDevice(
        IN HDEVINFO  DeviceInfoSet,
        OUT PSP_DEVINFO_DATA  DeviceInfoData
        );

SetupDiGetSelectedDevice retrieves the currently-selected device for the specified device information set.

Parameters
DeviceInfoSet
Supplies a handle to the device information set from which to retrieve the selected device.
DeviceInfoData
Supplies a pointer to an SP_DEVINFO_DATA structure that receives the currently-selected device. If a device is not currently selected, the function fails and a call to GetLastError returns ERROR_NO_DEVICE_SELECTED.
Return Value

The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.

Comments

SetupDiGetSelectedDevice is usually used by an installation wizard.

See Also

SetupDiSetSelectedDevice