// wdm.h
NTSTATUS TmDereferenceEnlistmentKey(
[in] PKENLISTMENT Enlistment,
[out, optional] PBOOLEAN LastReference
);
View the official Windows Driver Kit DDI referenceNo description available.
The TmDereferenceEnlistmentKey routine decrements the reference count for the key of a specified enlistment object.
Enlistment [in]A pointer to an enlistment object. Your component can receive this pointer as input to a ResourceManagerNotification callback routine. Alternatively, your component can call ObReferenceObjectByHandle and supply the object handle that a previous call to ZwCreateEnlistment, TmCreateEnlistment, or ZwOpenEnlistment provided.
LastReference [out, optional]A pointer to a BOOLEAN-typed variable. This variable receives TRUE if the reference count is zero after TmDereferenceEnlistmentKey decrements it. Otherwise, the variable receives FALSE.
TmDereferenceEnlistmentKey returns STATUS_SUCCESS if the operation succeeds. Otherwise, this routine might return one of the following values:
| Return code | Description |
|---|---|
| STATUS_UNSUCCESSFUL | The reference count of the specified enlistment object is zero and cannot be decremented. |
The routine might return other NTSTATUS values.
The TmReferenceEnlistmentKey routine increments the reference count for an enlistment object's key, and the TmDereferenceEnlistmentKey routine decrements the count.
For information about when to use KTM's Tm*Xxx* routines instead of Zw*Xxx* routines, see Using TmXxx Routines.