The WdfObjectDelete method deletes a framework object and its child objects.
VOID WdfObjectDelete( [in] WDFOBJECT Object );
- Object [in]
A handle to framework object.
A bug check occurs if the driver supplies an invalid object handle.
After a driver calls WdfObjectDelete, the specified object is deleted after its reference count becomes zero.
Drivers cannot call WdfObjectDelete to delete the following framework objects, because the framework always handles deletion of these objects:
Framework child-list objects
Framework driver objects
Framework file objects
Framework interrupt objects
Framework queue objects, if an object represents a default I/O queue or if the driver has called WdfDeviceConfigureRequestDispatching to set up the queue to receive all I/O requests of a particular type
Framework USB pipe objects
Framework USB interface objects
Framework WMI provider objects
The WdfObjectDelete method can return before the framework has deleted the object and its child objects. The order in which the framework deletes child objects is not predictable.
For more information about WdfObjectDelete, see Framework Object Life Cycle.
The WdfObjectDelete method must be called at IRQL <= DISPATCH_LEVEL. If your driver is deleting a control device object, WdfObjectDelete must be called at IRQL = PASSIVE_LEVEL. Similarly, if your driver is deleting a common buffer, WdfObjectDelete must be called at IRQL = PASSIVE_LEVEL.
The following code example deletes a framework object and its child objects.
|Available in version 1.0 and later versions of KMDF.|
|Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)|
|See Remarks section.|