SetupDiDeleteDeviceInfo

BOOLEAN
    SetupDiDeleteDeviceInfo(
        IN HDEVINFO  DeviceInfoSet,
        IN PSP_DEVINFO_DATA  DeviceInfoData
        );

SetupDiDeleteDeviceInfo deletes a member from the specified device information set. This function does not delete the actual device.

Parameters
DeviceInfoSet
Supplies a handle to the device information set containing the device information member to delete.
DeviceInfoData
Supplies a pointer to the SP_DEVINFO_DATA structure for the device information member to delete.
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

If the specified device information element is in use (for example, by a wizard page), the function fails. In this case, a call to GetLastError returns ERROR_DEVINFO_DATA_LOCKED. This happens if a handle to a wizard page is retrieved with a call to SetupDiGetWizardPage with this device information element specified and the DIWP_FLAG_USE_DEVINFO_DATA flag set. To delete this device information element, you must first close the wizard’s HPROPSHEETPAGE handle.

See Also

SetupDiCreateDeviceInfo, SetupDiEnumDeviceInfo, SetupDiGetWizardPage, SetupDiOpenDeviceInfo