CreateTransactionManager function (ktmw32.h)

Creates a new transaction manager (TM) object and returns a handle with the specified access.


HANDLE CreateTransactionManager(
  [in, optional] LPSECURITY_ATTRIBUTES lpTransactionAttributes,
  [in, optional] LPWSTR                LogFileName,
  [in, optional] ULONG                 CreateOptions,
  [in, optional] ULONG                 CommitStrength


[in, optional] lpTransactionAttributes

The transaction SECURITY_ATTRIBUTES (ACLs) for the TM object.

[in, optional] LogFileName

The log file stream name. If the stream does not exist in the log, it is created. To create a volatile TM, this parameter must be NULL and CreateOptions must specify TRANSACTION_MANAGER_VOLATILE, this transaction manager is considered volatile.

[in, optional] CreateOptions

Any optional attributes for the new TM.

Value Meaning
Indicates that the TM is volatile, and does not perform recovery.

[in, optional] CommitStrength

Reserved; specify zero.

Return value

If the function succeeds, the return value is a handle to the transaction manager.

If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call the GetLastError function.

The following list identifies the possible error codes:


Immediately after calling this function, you must call RecoverTransactionManager.

If your transaction manager is volatile, all your your resource managers must also be volatile.

You must call RecoverTransactionManager after creating a TM in order for the TM to function correctly.


Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header ktmw32.h
Library Ktmw32.lib
DLL Ktmw32.dll

See also

Kernel Transaction Manager Functions