BOOLEAN
SetupDiBuildDriverInfoList(
IN HDEVINFO DeviceInfoSet,
IN OUT PSP_DEVINFO_DATA DeviceInfoData, /* optional */
IN DWORD DriverType
);
SetupDiBuildDriverInfoList builds a list of drivers associated with a specified device instance or with the device information set's global class driver list.
If the class of this device is updated as a result of building a compatible
driver list, the ClassGuid field of the SP_DEVINFO_DATA structure is
updated upon return.
The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved with a call to GetLastError.
After this function has built the specified driver list, its constituent elements may be enumerated by a call to SetupDiEnumDriverInfo.
If the driver list is associated with a device instance (that is, DeviceInfoData is specified), the resulting list is composed of drivers that have the same class as the device instance with which they are associated. If this is a global class driver list (that is, DriverType is SPDIT_CLASSDRIVER and DeviceInfoData is not specified), the class that is used when building the list is the class associated with the device information set. If the device information set has no associated class, drivers of all classes are used when building the list.
Another thread can terminate the building of a driver list by a call to SetupDiCancelDriverInfoSearch.
SetupDiCancelDriverInfoSearch, SetupDiDestroyDriverInfoList, SetupDiEnumDriverInfo