IWDFObject::DeleteWdfObject method

The DeleteWdfObject method deletes a previously created Microsoft Windows Driver Frameworks (WDF) object.

Syntax


HRESULT DeleteWdfObject();

Parameters

This method has no parameters.

Return value

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.

Remarks

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.

Examples

For a code example of how to use the DeleteWdfObject method, see IWDFDevice::SetPnpState.

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.5

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFObject
IWDFDevice::CreateIoQueue

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft