CreateResourceManager function (ktmw32.h)

Creates a new resource manager (RM) object, and associates the RM with a transaction manager (TM).

Syntax

HANDLE CreateResourceManager(
  [in, optional] LPSECURITY_ATTRIBUTES lpResourceManagerAttributes,
  [in]           LPGUID                ResourceManagerId,
  [in, optional] DWORD                 CreateOptions,
  [in]           HANDLE                TmHandle,
  [in, optional] LPWSTR                Description
);

Parameters

[in, optional] lpResourceManagerAttributes

A pointer to a SECURITY_ATTRIBUTES structure that contains the security attributes for the resource manager. Specify NULL to obtain the default attributes.

[in] ResourceManagerId

A pointer the resource manager GUID. This parameter is required and must not be NULL.

[in, optional] CreateOptions

Any optional attributes for the new RM.

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

[in] TmHandle

A handle to the TM that will manage the transactions for this RM.

[in, optional] Description

A description for this RM.

Return value

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

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:

Remarks

Immediately after calling this function, you must call RecoverResourceManager.

An RM is an endpoint for TM notifications regarding transactions that the RM has enlisted in.

RMs are typically persistent, meaning that after a system failure, they must be reopened to perform certain operations. Volatile, or transient, RMs can be created by calling the CreateResourceManager function and by specifying RESOURCE_MANAGER_VOLATILE. Volatile RMs do not perform recovery operations, but do require notifications about a transaction.

You can create a volatile RM on a durable TM, but you cannot create a durable RM on a volatile TM.

Requirements

   
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

OpenResourceManager

SECURITY_ATTRIBUTES

SetResourceManagerCompletionPort