Export (0) Print
Expand All

ObDereferenceObjectDeferDelete routine

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

Object [in]

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 objects.

Note  For information about object permanence and attributes, see ObDereferenceObject.

Requirements

Target platform

Universal

Version

Available in Windows Vista and later versions of Windows operating systems.

Header

Wdm.h (include Fltkernel.h or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

See also

ObDereferenceObject
ObReferenceObject

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft