[Applies to UMDF 1.x only]
The DeleteWdfObject method deletes a previously created Microsoft Windows Driver Frameworks (WDF) object.
This method has no parameters.
DeleteWdfObject returns S_OK if the operation succeeds. Otherwise, this method returns HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or one of the other error codes that are defined in Winerror.h.
A driver is unable to delete some WDF objects. For example, the driver cannot delete a framework device object because the framework owns and controls device objects. For more information about the hierarchy of WDF objects, see Framework Object Hierarchy.
The driver typically deletes only WDF objects that it creates and owns. For more information about deleting framework objects, see Managing the Lifetime of Objects.
However, when a parent object is deleted, all child objects are automatically deleted. For example, if the driver called IWDFDevice::CreateIoQueue to create an I/O queue object, the newly created I/O queue becomes a child of the device object. The I/O queue object is then automatically deleted when the device object is deleted without the driver explicitly calling DeleteWdfObject.
For a code example of how to use the DeleteWdfObject method, see IWDFDevice::SetPnpState.
Build date: 11/16/2013