ObDereferenceObjectDeferDelete function (wdm.h)
The ObDereferenceObjectDeferDelete routine decrements the reference count for the given object, checks for object retention, and avoids deadlocks.
Syntax
void ObDereferenceObjectDeferDelete(
[in] PVOID Object
);
Parameters
[in] Object
A pointer to the body of the object.
Return value
None
Remarks
ObDereferenceObjectDeferDelete is similar to ObDereferenceObject except that, when the reference count of the object reaches zero, the object manager passes the object deletion request to a worker thread. Therefore, the deletion later occurs at IRQL = PASSIVE_LEVEL.
Use ObDereferenceObjectDeferDelete for any object when the immediate deletion by the current thread of the object (by using ObDereferenceObject) might result in a deadlock.
For example, such a deadlock can occur if ObDereferenceObject is used to dereference a Kernel Transaction Manager (KTM) object when a higher level driver on the driver stack is holding a lock.
To avoid such deadlocks, use ObDereferenceObjectDeferDelete instead of ObDereferenceObject to dereference KTM object.
For information about object permanence and attributes, see ObDereferenceObject.
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Header | wdm.h (include Fltkernel.h, Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | IRQL <= DISPATCH_LEVEL |