SetupDiGetSelectedDriver

BOOLEAN
    SetupDiGetSelectedDriver(
        IN HDEVINFO  DeviceInfoSet,
        IN PSP_DEVINFO_DATA  DeviceInfoData,    /* optional */
        OUT PSP_DRVINFO_DATA  DriverInfoData
        );

SetupDiGetSelectedDriver retrieves the member of a driver list that has been selected as the controlling driver.

Parameters
DeviceInfoSet
Supplies a handle to the device information set to query.
DeviceInfoData
Supplies a pointer to an SP_DEVINFO_DATA structure that indicates the device instance for which to retrieve the selected driver. If this parameter is NULL, the selected class driver for the global class driver list is retrieved.
DriverInfoData
Supplies a pointer to an SP_DRVINFO_DATA structure that receives information about the selected driver.
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. If a driver has not been selected for the specified device instance, the logged error is ERROR_NO_DRIVER_SELECTED.

See Also

SetupDiSetSelectedDriver