This topic has not yet been rated - Rate this topic

SetupDiDeleteDeviceInfo function

The SetupDiDeleteDeviceInfo function deletes a device information element from a device information set. This function does not delete the actual device.

Syntax

BOOL SetupDiDeleteDeviceInfo(
  __in  HDEVINFO DeviceInfoSet,
  __in  PSP_DEVINFO_DATA DeviceInfoData
);

Parameters

DeviceInfoSet [in]

A handle to the device information set that contains the device information element to delete.

DeviceInfoData [in]

A pointer to an SP_DEVINFO_DATA structure that represents the device information element in DeviceInfoSet 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.

Remarks

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.

Requirements

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Contained in Setupapi.lib. Link to Setupapi.lib.

See also

SetupDiCreateDeviceInfo
SetupDiEnumDeviceInfo
SetupDiGetWizardPage
SetupDiOpenDeviceInfo

 

 

Send comments about this topic to Microsoft

Build date: 4/3/2012

Did you find this helpful?
(1500 characters remaining)