#ifndef _NTTMAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryInformationTransaction(
_In_ HANDLE TransactionHandle,
_In_ TRANSACTION_INFORMATION_CLASS TransactionInformationClass,
_Out_writes_bytes_(TransactionInformationLength) PVOID TransactionInformation,
_In_ ULONG TransactionInformationLength,
_Out_opt_ PULONG ReturnLength
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryInformationTransaction(
_In_ HANDLE TransactionHandle,
_In_ TRANSACTION_INFORMATION_CLASS TransactionInformationClass,
_Out_writes_bytes_(TransactionInformationLength) PVOID TransactionInformation,
_In_ ULONG TransactionInformationLength,
_Out_opt_ PULONG ReturnLength
);
View code on GitHub// wdm.h
__kernel_entry NTSYSCALLAPI NTSTATUS NtQueryInformationTransaction(
[in] HANDLE TransactionHandle,
[in] TRANSACTION_INFORMATION_CLASS TransactionInformationClass,
[out] PVOID TransactionInformation,
[in] ULONG TransactionInformationLength,
[out, optional] PULONG ReturnLength
);
View the official Windows Driver Kit DDI reference// wdm.h
NTSYSCALLAPI NTSTATUS ZwQueryInformationTransaction(
[in] HANDLE TransactionHandle,
[in] TRANSACTION_INFORMATION_CLASS TransactionInformationClass,
[out] PVOID TransactionInformation,
[in] ULONG TransactionInformationLength,
[out, optional] PULONG ReturnLength
);
View the official Windows Driver Kit DDI referenceThe ZwQueryInformationTransaction routine retrieves information about a specified transaction.
TransactionHandle [in]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.
TransactionInformationClass [in]A TRANSACTION_INFORMATION_CLASS-typed value that specifies the information to obtain. The value must be one of the following values:
The TransactionFullInformation value is not used with ZwQueryInformationTransaction.
TransactionInformation [out]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.
TransactionInformationLength [in]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.
ReturnLength [out, optional]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.
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.
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 Nt*Xxx* and Zw*Xxx* 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 Nt*Xxx* and Zw*Xxx* versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
TRANSACTION_ENLISTMENTS_INFORMATION
TRANSACTION_PROPERTIES_INFORMATION
Using Nt and Zw Versions of the Native System Services Routines
The ZwQueryInformationTransaction routine retrieves information about a specified transaction.
TransactionHandle [in]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.
TransactionInformationClass [in]A TRANSACTION_INFORMATION_CLASS-typed value that specifies the information to obtain. The value must be one of the following values:
The TransactionFullInformation value is not used with ZwQueryInformationTransaction.
TransactionInformation [out]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.
TransactionInformationLength [in]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.
ReturnLength [out, optional]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.
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.
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 Nt*Xxx* and Zw*Xxx* 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 Nt*Xxx* and Zw*Xxx* versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
TRANSACTION_ENLISTMENTS_INFORMATION
TRANSACTION_PROPERTIES_INFORMATION
Using Nt and Zw Versions of the Native System Services Routines