NtQueryInformationEnlistment function

The ZwQueryInformationEnlistment routine retrieves information about a specified enlistment object.


__kernel_entry NTSYSCALLAPI NTSTATUS NtQueryInformationEnlistment(
  HANDLE                       EnlistmentHandle,
  ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass,
  PVOID                        EnlistmentInformation,
  ULONG                        EnlistmentInformationLength,
  PULONG                       ReturnLength



A handle to an enlistment object that was obtained by a previous call to ZwCreateEnlistment or ZwOpenEnlistment. The handle must have ENLISTMENT_QUERY_INFORMATION access to the object.


An ENLISTMENT_INFORMATION_CLASS-typed enumeration value that specifies the information to be obtained. This value must be one of the following values:

  • EnlistmentBasicInformation
  • EnlistmentRecoveryInformation
The enumeration's EnlistmentFullInformation value is not used with ZwQueryInformationEnlistment.


A pointer to a caller-allocated buffer that receives the information that the EnlistmentInformationClass parameter specifies. If the EnlistmentInformationClass parameter's value is EnlistmentBasicInformation, this buffer's structure type must be ENLISTMENT_BASIC_INFORMATION. If the EnlistmentInformationClass parameter's value is EnlistmentRecoveryInformation, this buffer's type must match the caller-defined type that the caller used when it called ZwSetInformationEnlistment.


The length, in bytes, of the buffer that the EnlistmentInformation parameter points to.


A pointer to a caller-allocated variable that receives the length, in bytes, of the information that KTM writes to the EnlistmentInformation buffer. This parameter is optional and can be NULL.

Return Value

ZwQueryInformationEnlistment returns STATUS_SUCCESS if the operation succeeds. Otherwise, this routine might return one of the following values:

Return code Description
The specified handle is not a handle to an enlistment object.
The object handle is invalid.
The EnlistmentInformationClass parameter's value is invalid.
The EnlistmentInformationLength parameter's value is invalid.
The caller does not have appropriate access to the enlistment object.

The routine might return other NTSTATUS values.


A resource manager can call ZwSetInformationEnlistment to set enlistment-specific recovery information for an enlistment object and then call ZwQueryInformationEnlistment to retrieve the recovery information.

For more information about ZwQueryInformationEnlistment, see Handling Recovery Operations.

Callers of ZwQueryInformationEnlistment must be running at IRQL = PASSIVE_LEVEL.

NtQueryInformationEnlistment and ZwQueryInformationEnlistment are two versions of the same Windows Native System Services routine.

For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.


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
DDI compliance rules PowerIrpDDis, HwStorPortProhibitedDDIs

See Also



Using Nt and Zw Versions of the Native System Services Routines