TmDereferenceEnlistmentKey function (wdm.h)

The TmDereferenceEnlistmentKey routine decrements the reference count for the key of a specified enlistment object.

Syntax

NTSTATUS TmDereferenceEnlistmentKey(
  [in]            PKENLISTMENT Enlistment,
  [out, optional] PBOOLEAN     LastReference
);

Parameters

[in] Enlistment

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.

[out, optional] LastReference

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.

Return value

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.

Remarks

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 TmXxx routines instead of ZwXxx routines, see Using TmXxx Routines.

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later operating system versions.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DISPATCH_LEVEL

See also

ObReferenceObjectByHandle

ResourceManagerNotification

TmCreateEnlistment

TmReferenceEnlistmentKey

ZwCreateEnlistment

ZwOpenEnlistment