SetupDiDestroyDriverInfoList function

The SetupDiDestroyDriverInfoList function deletes a driver list.


WINSETUPAPI BOOL SetupDiDestroyDriverInfoList(
  HDEVINFO         DeviceInfoSet,
  PSP_DEVINFO_DATA DeviceInfoData,
  DWORD            DriverType



A handle to a device information set that contains the driver list to delete.


A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. This parameter is optional and can be set to NULL. If this parameter is specified, SetupDiDestroyDriverInfoList deletes the driver list for the specified device. If this parameter is NULL, SetupDiDestroyDriverInfoList deletes the global class driver list that is associated with DeviceInfoSet.


The type of driver list to delete, which must be one of the following values:


Delete a list of class drivers. If DeviceInfoData is NULL, this driver list type must be specified.


Delete a list of compatible drivers for the specified device. DeviceInfoData must be specified if this driver list type is specified.

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 the currently selected driver is a member of the list being deleted, the selection is reset.

If a class driver list is being deleted, the DI_FLAGSEX_DIDINFOLIST and DI_DIDCLASS flags are reset for the corresponding device information set or device information element. The DI_MULTMFGS flags is also reset.

If a compatible driver list is being destroyed, the DI_FLAGSEX_DIDCOMPATINFO and DI_DIDCOMPAT flags are reset for the corresponding device information element.


Minimum supported client Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header setupapi.h (include Setupapi.h)
Library Setupapi.lib
DLL Setupapi.dll

See also