// wdfobject.h
VOID WdfObjectDelete(
[in] WDFOBJECT Object
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF and UMDF]
The WdfObjectDelete method deletes a framework object and its child objects.
Object
[in]A handle to framework object.
A bug check occurs if the driver supplies an invalid object handle.
[!NOTE] Callback functions that are called at PASSIVE_LEVEL cannot delete timer objects. For more info, see EVT_WDF_TIMER callback function.
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:
See Summary of Framework Objects for a complete list of framework 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 and the cleanup rules for a framework object hierarchy, 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.
WdfObjectDelete(Object);