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.
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.