NtQueryInformationEnlistment function

The ZwQueryInformationEnlistment routine retrieves information about a specified enlistment object.

Syntax

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

Parameters

EnlistmentHandle

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.

EnlistmentInformationClass

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.

EnlistmentInformation

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.

EnlistmentInformationLength

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

ReturnLength

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
STATUS_OBJECT_TYPE_MISMATCH
The specified handle is not a handle to an enlistment object.
STATUS_INVALID_HANDLE
The object handle is invalid.
STATUS_INVALID_INFO_CLASS
The EnlistmentInformationClass parameter's value is invalid.
STATUS_INFO_LENGTH_MISMATCH
The EnlistmentInformationLength parameter's value is invalid.
STATUS_ACCESS_DENIED
The caller does not have appropriate access to the enlistment object.

The routine might return other NTSTATUS values.

Remarks

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.

Requirements

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

See Also

ENLISTMENT_BASIC_INFORMATION

ENLISTMENT_INFORMATION_CLASS

Using Nt and Zw Versions of the Native System Services Routines

ZwCreateEnlistment

ZwOpenEnlistment

ZwSetInformationEnlistment