Share via



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

This is typically the first DTC call that application programs and resource managers make when using DTC. This helper function establishes the initial connection to DTC. It returns an interface pointer to one of the interfaces on the DTC proxy core object.

Implemented by: DTC proxy
Object This is a helper function, not a method on an object
Interface Source N/A
Called by: Application programs and resource managers


EXPORTAPI __cdecl DtcGetTransactionManager(   char * pszHost,  char * pszTmName,  REFIID riid,  DWORD dwReserved1,  WORD wcbReserved2,  void * pvReserved2,  void ** ppv);  


[in] Name of the host system which will serve as the transaction commit coordinator.


If the host system is not found the HRESULT XACT_E_UNABLE_TO_READ_DTC_CONFIG is returned.

[in] String Name of the transaction manager which will serve as the transaction commit coordinator. Must be NULL.

[in] IID of the requested interface.

[in] See remarks below.

[in] See remarks below.

[in] See remarks below.

[out] Pointer to the requested interface.

Return Values


Unable to provide the requested interface.

Unexpected error encountered.

One or more arguments are invalid.

Failed to carry out the operation.

Unable to read DTC configuration information. This error is returned if the host system specified by the pszHost parameter does not exist.


Calls to DtcGetTransactionManager can specify a server host name to serve as the transaction commit coordinator in the pszHost parameter. However, the parameter is taken into consideration only if the machine is set to use the local transaction coordinator. If the machine is not set to use the local transaction coordinator, or if a value of NULL is supplied, the following rules determine where the transaction is started and coordinated:

  1. If the workstation making the call is configured to use a Remote DTC, the Remote DTC will be used whether or not a local DTC is installed.

  2. If the workstation making the call has a locally installed DTC, and is not configured for a Remote DTC, the local DTC is used.

  3. If the workstation making the call is a Windows 95 computer or a Windows computer that does not have a local DTC installed, the default DTC is used. The default DTC is specified as the Remote Host field on the MSDTC tab of the Component Services administrative tool.

Currently there are only two acceptable combinations for values for dwReserved1, wcbReserved2 and pvReserved2. They are:

  1. dwReserved1 = 0, wcbReserved2 = 0 and pvReserved2 = NULL

  2. dwReserved1 = dwUSER_MS_SQLSERVER, wcbReserved2 = sizeof (PROXY_CONFIG_PARAMS) and pvReserved2 = pparamsProxy, where pparamsProxy is a pointer to a structure of type PROXY_CONFIG_PARAMS

    The wcThreadsMax field in the PROXY_CONFIG_PARAMS structure hints at the maximum number of threads to use on behalf of the calling application. This combination of values is usually only used by resource managers or clients that require high concurrency.


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 xolehlp.h

Library: Included as a resource in xolehlp.lib