SetupDiBuildDriverInfoList

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.

Parameters

DeviceInfoSet

Supplies a handle to the device information set to contain the driver information list (either globally for all members or specifically for a single member).

DeviceInfoData

Supplies a pointer to the SP_DEVINFO_DATA structure for the device information member for which to build a driver list. If this parameter is NULL, the list is associated with the device information set and not with a particular device information element. Use NULL with driver lists of type SPDIT_CLASSDRIVER only.

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.

DriverType

Specifies what type of driver list to build. Must be one of the following values:

SPDIT_CLASSDRIVER

Build a list of class drivers.

SPDIT_COMPATDRIVER

Build a list of drivers for this device. DeviceInfoData must be specified if this flag is set.

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

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.

See Also

SetupDiCancelDriverInfoSearch, SetupDiDestroyDriverInfoList, SetupDiEnumDriverInfo