ZwOpenResourceManager routine

The ZwOpenResourceManager routine returns a handle to an existing resource manager object.

Syntax


NTSTATUS ZwOpenResourceManager(
  _Out_     PHANDLE ResourceManagerHandle,
  _In_      ACCESS_MASK DesiredAccess,
  _In_      HANDLE TmHandle,
  _In_      LPGUID ResourceManagerGuid,
  _In_opt_  POBJECT_ATTRIBUTES ObjectAttributes
);

Parameters

ResourceManagerHandle [out]

A pointer to a caller-allocated variable that receives the resource manager handle if the call to ZwOpenResourceManager succeeds.

DesiredAccess [in]

An ACCESS_MASK value that specifies the caller's requested access to the resource manager object. For more information about how to specify this parameter, see the DesiredAccess parameter of ZwCreateResourceManager. This parameter cannot be zero.

TmHandle [in]

A handle to a transaction manager object that was obtained by a previous call to ZwCreateTransactionManager or ZwOpenTransactionManager.

ResourceManagerGuid [in]

A pointer to the GUID that identifies the resource manager to open.

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. This parameter is optional and can be NULL.

Return value

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

Return codeDescription
STATUS_OBJECT_TYPE_MISMATCH

The handle that TmHandle specifies is not a handle to a transaction object.

STATUS_INVALID_HANDLE

The handle that TmHandle specifies is invalid.

STATUS_ACCESS_DENIED

The caller does not have appropriate access to the specified transaction manager object.

STATUS_INVALID_PARAMETER

The DesiredAccess parameter is zero or the ResourceManagerGuid parameter is invalid.

STATUS_RESOURCEMANAGER_NOT_FOUND

The specified resource manager could not be found.

STATUS_TRANSACTIONMANAGER_NOT_ONLINE

The specified transaction manager is not online.

 

The routine might return other NTSTATUS values.

Remarks

Typically, a TPS component calls ZwOpenResourceManager after it receives an enlistment GUID from another TPS component that had previously called ZwCreateResourceManager. Most TPS designs do not require calling ZwOpenResourceManager.

A resource manager that calls ZwOpenResourceManager must eventually call ZwClose to close the object handle.

For more information about ZwOpenResourceManager, see KTM Objects.

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

InitializeObjectAttributes
OBJECT_ATTRIBUTES
ZwClose
ZwCreateResourceManager
ZwCreateTransactionManager
ZwOpenTransactionManager

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft