IDtcToXaHelperSinglePipe::ConvertTridToXID

 

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 ODBC driver calls the ConvertTridToXID method once each time an ODBC database connection is enlisted on a new transaction. This method creates an XID from the ITransaction object that the ODBC driver received from the ODBC driver manager in the SQLSetConnectAttr(SQL_ATTR_ENLIST_IN_DTC, pITransaction) call. After obtaining the XID, the ODBC driver sends the XID to the database server in an xa_start_entry message.

Syntax

  
HRESULT ConvertTridToXID (   DWORD * pdwITransaction,  DWORD dwRMCookie,  XID * pXid);  

Parameters

pdwITransaction
[in] A pointer to the ITransaction object that the ODBC driver received from the ODBC driver manager in the SQLSetConnectAttr(SQL_ATTR_ENLIST_IN_DTC, pITransaction) call.

dwRMCookie
[in] The cookie obtained by calling IDtcToXaHelperSinglePipe::XARMCreate.

pXid
[in,out] A pointer to the caller allocated XID structure.

#define XIDDATASIZE  128 /* size in bytes */  
typedef struct xid_t {  
  LONG     formatID;  
  LONG     gtrid_length;  
  LONG     bqual_length;  
  CHAR     data[XIDDATASIZE];  
} XID;  

Return Values

S_OK
Success.

E_INVALIDARG
One or more of the parameters are not valid.

XACT_E_NOTRANSACTION
No transaction corresponding to pdwITransaction.

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

See Also

IDtcToXaHelper
IDtcToXaHelperFactory
IDtcToXaMapper