NtQueryInformationTransaction function (wdm.h)

The ZwQueryInformationTransaction routine retrieves information about a specified transaction.

Syntax

__kernel_entry NTSYSCALLAPI NTSTATUS NtQueryInformationTransaction(
  [in]            HANDLE                        TransactionHandle,
  [in]            TRANSACTION_INFORMATION_CLASS TransactionInformationClass,
  [out]           PVOID                         TransactionInformation,
  [in]            ULONG                         TransactionInformationLength,
  [out, optional] PULONG                        ReturnLength
);

Parameters

[in] TransactionHandle

A handle to a transaction object that was obtained by a previous call to ZwCreateTransaction or ZwOpenTransaction. The handle must have TRANSACTION_QUERY_INFORMATION access to the object.

[in] TransactionInformationClass

A TRANSACTION_INFORMATION_CLASS-typed value that specifies the information to obtain. The value must be one of the following values:

  • TransactionBasicInformation
  • TransactionPropertiesInformation
  • TransactionEnlistmentInformation
The TransactionFullInformation value is not used with ZwQueryInformationTransaction.

[out] TransactionInformation

A pointer to a caller-allocated buffer that receives the information that the TransactionInformationClass parameter specifies. The buffer's structure type must be TRANSACTION_BASIC_INFORMATION, TRANSACTION_PROPERTIES_INFORMATION, or TRANSACTION_ENLISTMENTS_INFORMATION.

[in] TransactionInformationLength

The length, in bytes, of the buffer that the TransactionInformation parameter points to, including the length of any additional array elements that the caller has allocated to receive information.

[out, optional] ReturnLength

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

Return value

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

Return code Description
STATUS_INVALID_INFO_CLASS
The TransactionInformationClass parameter's value is invalid.
STATUS_INFO_LENGTH_MISMATCH
The length of the buffer that is specified by the TransactionInformationLength parameter is incorrect.
STATUS_OBJECT_TYPE_MISMATCH
The handle that the TransactionHandle parameter specifies is not a handle to a transaction object.
STATUS_INVALID_HANDLE
An object handle is invalid.
STATUS_ACCESS_DENIED
The caller does not have appropriate access to the transaction object.
STATUS_BUFFER_OVERFLOW
The buffer that the TransactionInformation parameter specifies is too small.
 

The routine might return other NTSTATUS values.

Remarks

For more information about how to use ZwQueryInformationTransaction, see Creating a Transactional Client.

NtQueryInformationTransaction and ZwQueryInformationTransaction 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

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

See also

TRANSACTION_BASIC_INFORMATION

TRANSACTION_ENLISTMENTS_INFORMATION

TRANSACTION_INFORMATION_CLASS

TRANSACTION_PROPERTIES_INFORMATION

TmGetTransactionId

Using Nt and Zw Versions of the Native System Services Routines

ZwCreateTransaction

ZwOpenTransaction

ZwSetInformationTransaction