Export (0) Print
Expand All

ZwOpenTransaction routine

The ZwOpenTransaction routine obtains a handle to an existing transaction object.

Syntax


NTSTATUS ZwOpenTransaction(
  _Out_     PHANDLE TransactionHandle,
  _In_      ACCESS_MASK DesiredAccess,
  _In_opt_  POBJECT_ATTRIBUTES ObjectAttributes,
  _In_      LPGUID Uow,
  _In_opt_  HANDLE TmHandle
);

Parameters

TransactionHandle [out]

A pointer to a caller-allocated variable that receives a handle to the transaction object if ZwOpenTransaction returns STATUS_SUCCESS.

DesiredAccess [in]

An ACCESS_MASK value that specifies the caller's requested access to the transaction object. For information about how to specify this parameter, see the DesiredAccess parameter of ZwCreateTransaction.

ObjectAttributes [in, optional]

A pointer to an OBJECT_ATTRIBUTES structure that specifies the object's attributes. Use the InitializeObjectAttributes routine to initialize this structure, but specify only that routine's InitializedAttributes and Attributes parameters. If the caller is not running in a system thread context, it must set the OBJ_KERNEL_HANDLE flag in the Attributes parameter. The ObjectAttributes parameter is optional and can be NULL.

Uow [in]

A pointer to a GUID that is a transaction object's unit of work (UOW) identifier. This GUID identifies the transaction object to open.

TmHandle [in, optional]

A handle to a transaction manager object. If this parameter is not NULL, KTM searches only for transaction objects that belong to the specified transaction manager object. If this parameter is NULL, KTM searches all transaction objects.

Return value

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

Return codeDescription
STATUS_INVALID_PARAMETER

The DesiredAccess or Uow parameter was zero.

STATUS_OBJECT_TYPE_MISMATCH

The specified handle is not a handle to a transaction object.

STATUS_INVALID_HANDLE

An object handle is invalid.

STATUS_TRANSACTION_NOT_FOUND

KTM could not find the transaction object.

STATUS_ACCESS_DENIED

The value of the DesiredAccess parameter is invalid.

 

The routine might return other NTSTATUS values.

Remarks

Typically, a resource manager calls ZwOpenTransaction after it receives a transaction UOW from a transactional client that had previously called ZwCreateTransaction.

For more information about ZwOpenTransaction, see Creating a Resource Manager.

Requirements

Version

Available in Windows Vista and later operating system versions.

Header

Wdm.h (include Wdm.h or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

PowerIrpDDis, HwStorPortProhibitedDDIs

See also

ACCESS_MASK
InitializeObjectAttributes
OBJECT_ATTRIBUTES
ZwCommitTransaction
ZwCreateTransaction
ZwQueryInformationTransaction
ZwRollbackTransaction

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft