Condividi tramite


IResourceManagerFactory2::CreateEx

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

The CreateEx method is used to create a resource manager object.

Syntax

  
HRESULT CreateEx(   GUID * pguidRM,  CHAR * pszRMName,  IResourceManagerSink * pIResMgrSink,  REFIID riidRequested,  void ** ppvResMgr);  

Parameters

pguidRM
[in] A UUID that uniquely identifies this resource manager.

pszRMName
[in] A string name that identifies this resource manager.

pIResMgrSink
[in] Pointer to the resource manager's IResourceManagerSink interface. The resource manager developer must implement the TMDown method on this interface.

riidRequested
[in] The interface ID requested by the resource manager.

ppvResMgr
[out] Reference to the interface on the resource manager object whose IID is specified in the riidRequested parameter.

Return Values

S_OK
Success.

E_NOINTERFACE
Requested interface is not available.

E_OUTOFMEMORY
Unable to allocate memory.

XACT_E_TMNOTAVAILABLE
Unable to connect to the transaction manager.

XACT_E_CONNECTION_DOWN
Connection with the transaction manager was lost.

XACT_E_CONNECTION_DENIED
The transaction manager refused to accept a connection.

XACT_E_DUPLICATE_GUID
There is already a resource manager connected to the transaction manager with the same GUID as was passed in pguidRM.

E_UNEXPECTED
An unexpected error has occurred.

Remarks

The resource manager object represents the connection between the resource manager and the transaction manager. The resource manager object supports the IResourceManager2 interface that resource manager use to enlist in transactions and to perform transaction recovery.

A resource manager typically invokes the CreateEx method when the resource manager first starts. By doing this, the resource manager registers itself with the transaction manager. The resource manager retains the resource manager object until it no longer needs the services of the transaction manager. It then releases the IResourceManager2 interface. This ends the connection with the transaction manager. A resource manager typically retains the transaction manager connection until the resource manager stops.

If the connection between the transaction manager and the resource manager fails, the DTC proxy invokes the resource manager's IResourceManagerSink::TMDown method. This callback informs the resource manager that its transaction manager connection has failed. The resource manager must invoke the CreateEx method again to reregister with the transaction manager and perform recovery.

Requirements

For an explanation of the requirement values, see Requirements (Component Services).

Platforms: Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista

Header: Declared in txdtc.h

See Also

IResourceManagerFactory