Skip to content

Latest commit

 

History

History
430 lines (323 loc) · 11.9 KB

nf-wdm-ntcreatetransactionmanager.md

File metadata and controls

430 lines (323 loc) · 11.9 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:wdm.NtCreateTransactionManager
NtCreateTransactionManager function (wdm.h)
The ZwCreateTransactionManager routine creates a new transaction manager object.
kernel\zwcreatetransactionmanager.htm
kernel
04/30/2018
NtCreateTransactionManager function
NtCreateTransactionManager, ZwCreateTransactionManager, ZwCreateTransactionManager routine [Kernel-Mode Driver Architecture], kernel.zwcreatetransactionmanager, ktm_ref_56fad0b5-053d-4d65-bdb3-8c2d09fee541.xml, wdm/NtCreateTransactionManager, wdm/ZwCreateTransactionManager
wdm.h
Wdm.h, Ntifs.h
Universal
Available in Windows Vista and later operating system versions.
PowerIrpDDis, HwStorPortProhibitedDDIs
NtosKrnl.lib
NtosKrnl.exe
PASSIVE_LEVEL
Windows
NtCreateTransactionManager
wdm/NtCreateTransactionManager
APIRef
kbSyntax
DllExport
NtosKrnl.exe
NtCreateTransactionManager

NtCreateTransactionManager function

-description

The ZwCreateTransactionManager routine creates a new transaction manager object.

-parameters

-param TmHandle [out]

A pointer to a caller-allocated variable that receives a handle to the new transaction manager object.

-param DesiredAccess [in]

An ACCESS_MASK value that specifies the caller's requested access to the transaction manager object. In addition to the access rights that are defined for all kinds of objects (see ACCESS_MASK), the caller can specify any of the following access right flags for transaction manager objects.

ACCESS_MASK flag Allows the caller to
TRANSACTIONMANAGER_CREATE_RM Create a resource manager (see ZwCreateResourceManager).
TRANSACTIONMANAGER_QUERY_INFORMATION Obtain information about the transaction manager (see ZwQueryInformationTransactionManager and ZwEnumerateTransactionObject). Also required for ZwOpenResourceManager, ZwCreateTransaction, and ZwOpenTransaction.)
TRANSACTIONMANAGER_RECOVER Recover the transaction manager (see ZwRecoverTransactionManager and ZwRollforwardTransactionManager).
TRANSACTIONMANAGER_RENAME Not used.
TRANSACTIONMANAGER_SET_INFORMATION Not used.
 

Alternatively, you can specify one or more of the following ACCESS_MASK bitmaps. These bitmaps combine the flags from the previous table with the STANDARD_RIGHTS_XXX flags that are described on the ACCESS_MASK reference page. You can also combine these bitmaps with additional flags from the preceding table. The following table shows how the bitmaps correspond to specific access rights.

Rights bitmap Set of specific access rights
TRANSACTIONMANAGER_GENERIC_READ STANDARD_RIGHTS_READ and TRANSACTIONMANAGER_QUERY_INFORMATION
TRANSACTIONMANAGER_GENERIC_WRITE STANDARD_RIGHTS_WRITE, TRANSACTIONMANAGER_SET_INFORMATION, TRANSACTIONMANAGER_RECOVER, TRANSACTIONMANAGER_RENAME, and TRANSACTIONMANAGER_CREATE_RM
TRANSACTIONMANAGER_GENERIC_EXECUTE STANDARD_RIGHTS_EXECUTE
TRANSACTIONMANAGER_ALL_ACCESS STANDARD_RIGHTS_REQUIRED, TRANSACTIONMANAGER_GENERIC_READ, TRANSACTIONMANAGER_GENERIC_WRITE, and TRANSACTIONMANAGER_GENERIC_EXECUTE

-param ObjectAttributes [in, optional]

A pointer to an OBJECT_ATTRIBUTES structure that specifies the object name and other attributes. Use the InitializeObjectAttributes routine to initialize this structure. If the caller is not running in a system thread context, it must set the OBJ_KERNEL_HANDLE attribute when it calls InitializeObjectAttributes. This parameter is optional and can be NULL.

-param LogFileName [in, optional]

A pointer to a UNICODE_STRING structure that contains the path and file name of a CLFS log file stream to be associated with the transaction manager object. This parameter must be NULL if the CreateOptions parameter is TRANSACTION_MANAGER_VOLATILE. Otherwise, this parameter must be non-NULL. For more information, see the following Remarks section.

-param CreateOptions [in, optional]

Optional object creation flags. The following table contains the available flags, which are defined in Ktmtypes.h.

Option flag Meaning
TRANSACTION_MANAGER_VOLATILE The transaction manager object will be volatile. Therefore, it will not use a log file.
TRANSACTION_MANAGER_COMMIT_DEFAULT For internal use only.
TRANSACTION_MANAGER_COMMIT_SYSTEM_VOLUME For internal use only.
TRANSACTION_MANAGER_COMMIT_SYSTEM_HIVES For internal use only.
TRANSACTION_MANAGER_COMMIT_LOWEST For internal use only.
TRANSACTION_MANAGER_CORRUPT_FOR_RECOVERY For internal use only.
TRANSACTION_MANAGER_CORRUPT_FOR_PROGRESS For internal use only.

-param CommitStrength [in, optional]

Reserved for future use. This parameter must be zero.

-returns

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

Return code Description
STATUS_INVALID_PARAMETER
The value of an input parameter is invalid.
STATUS_INSUFFICIENT_RESOURCES
KTM could not allocate system resources (typically memory).
STATUS_LOG_CORRUPTION_DETECTED
KTM encountered an error while creating or opening the log file.
STATUS_INVALID_ACL
A security descriptor contains an invalid access control list (ACL).
STATUS_INVALID_SID
A security descriptor contains an invalid security identifier (SID).
STATUS_OBJECT_NAME_EXISTS
The object name that the ObjectAttributes parameter specifies already exists.
STATUS_OBJECT_NAME_COLLISION
The operating system detected a duplicate object name. The error might indicate that the log stream is already being used.
STATUS_OBJECT_NAME_INVALID
The object name that the ObjectAttributes parameter specifies is invalid.
STATUS_ACCESS_DENIED
The value of the DesiredAccess parameter is invalid.
 

The routine might return other NTSTATUS values.

-remarks

If the log file stream that the LogFileName parameter specifies does not exist, KTM calls CLFS to create the stream. If the stream already exists, KTM calls CLFS to open the stream.

Your TPS component must call ZwRecoverTransactionManager after it has called ZwCreateTransactionManager

If your TPS component specifies the TRANSACTION_MANAGER_VOLATILE flag in the CreateOptions parameter, all resource managers that are associated with the transaction manager object must specify the RESOURCE_MANAGER_VOLATILE flag when they call ZwCreateResourceManager.

A TPS component that calls ZwCreateTransactionManager must eventually call ZwClose to close the object handle.

For more information about how use ZwCreateTransactionManager, see Creating a Resource Manager.

NtCreateTransactionManager and ZwCreateTransactionManager 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.

-see-also

InitializeObjectAttributes

OBJECT_ATTRIBUTES

UNICODE_STRING

Using Nt and Zw Versions of the Native System Services Routines

ZwClose

ZwOpenTransactionManager

ZwQueryInformationTransactionManager

ZwRecoverTransactionManager

ZwRollforwardTransactionManager