OpenTransaction function

Opens an existing transaction.

Syntax


HANDLE WINAPI OpenTransaction(
  _In_  DWORD dwDesiredAccess,
  _In_  LPGUID TransactionId
);

Parameters

dwDesiredAccess [in]

The access to the transaction object. You must have read and write access to work with a transaction. See Transaction Access Masks for a list of valid values.

TransactionId [in]

The GUID that identifies the transaction to be opened. This is commonly referred to as a unit of work for the transaction.

Return value

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

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:

ERROR_ACCESS_DENIED
ERROR_INSUFFICIENT_RESOURCES
ERROR_INVALID_PARAMETER
ERROR_OBJECT_NAME_INVALID
ERROR_OBJECT_NAME_NOT_FOUND
ERROR_OBJECT_PATH_SYNTAX_BAD
ERROR_OBJECT_TYPE_MISMATCH
ERROR_PRIVILEGE_NOT_HELD

Remarks

Clients close the transaction handle by using the CloseHandle function. If the last transaction handle is closed without anyone calling the CommitTransaction function on the transaction, then the KTM implicitly rolls back the transaction.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Ktmw32.h

Library

Ktmw32.lib

DLL

Ktmw32.dll

See also

CommitTransaction
CreateTransaction
Kernel Transaction Manager Functions
RollbackTransaction
Transaction Access Masks

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.