home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / xolehlp.h < prev   
C/C++ Source or Header  |  2000-02-01  |  5KB  |  124 lines

  1. //  Copyright (C) 1995-1999 Microsoft Corporation.  All rights reserved.
  2. /* ----------------------------------------------------------------------------
  3. Microsoft    D.T.C (Distributed Transaction Coordinator)
  4.  
  5. (c)    1995    Microsoft Corporation.    All Rights Reserved
  6.  
  7.  
  8. Filename :    xolehlp.h
  9.             contains DTC helper APIs used by RM's and application clients
  10.             to obtain the transaction manager
  11. ----------------------------------------------------------------------------- */
  12.  
  13. #ifndef __XOLEHLP__H__
  14. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  15. #define __XOLEHLP__H__
  16.  
  17.  
  18. /*----------------------------------------
  19. //    Defines
  20. //--------------------------------------*/
  21. #define EXPORTAPI __declspec( dllexport )HRESULT
  22.  
  23. /*----------------------------------------
  24. // Constants
  25. //--------------------------------------*/
  26. const DWORD        OLE_TM_CONFIG_VERSION_1        = 1;
  27.  
  28. const DWORD        OLE_TM_FLAG_NONE            = 0x00000000;
  29. const DWORD        OLE_TM_FLAG_NODEMANDSTART    = 0x00000001;
  30.  
  31. // The following are flags used specifically for MSDTC.
  32. const DWORD        OLE_TM_FLAG_QUERY_SERVICE_LOCKSTATUS = 0x80000000;
  33. const DWORD        OLE_TM_FLAG_INTERNAL_TO_TM    =           0x80000001;
  34.  
  35. /*----------------------------------------
  36. //    Structure definitions
  37. //--------------------------------------*/
  38. typedef struct _OLE_TM_CONFIG_PARAMS_V1
  39. {
  40.     DWORD        dwVersion;
  41.     DWORD        dwcConcurrencyHint;
  42. } OLE_TM_CONFIG_PARAMS_V1;
  43.  
  44.  
  45. /*----------------------------------------
  46. //    Function Prototypes
  47. //--------------------------------------*/
  48.  
  49. /*----------------------------------------
  50. //This API should be used to obtain an IUnknown or a ITransactionDispenser
  51. //interface from the Microsoft Distributed Transaction Coordinator's proxy.
  52. //Typically, a NULL is passed for the host name and the TM Name. In which 
  53. //case the MS DTC on the same host is contacted and the interface provided
  54. //for it.
  55. //--------------------------------------*/
  56. EXPORTAPI __cdecl DtcGetTransactionManager( 
  57.                                     /* in */ char * i_pszHost,
  58.                                     /* in */ char *    i_pszTmName,
  59.                                     /* in */ REFIID i_riid,
  60.                                     /* in */ DWORD i_dwReserved1,
  61.                                     /* in */ WORD i_wcbReserved2,
  62.                                     /* in */ void * i_pvReserved2,
  63.                                     /* out */ void** o_ppvObject
  64.                                     )    ;
  65. EXTERN_C HRESULT __cdecl DtcGetTransactionManagerC(
  66.                                     /* in */ char * i_pszHost,
  67.                                     /* in */ char *    i_pszTmName,
  68.                                     /* in */ REFIID i_riid,
  69.                                     /* in */ DWORD i_dwReserved1,
  70.                                     /* in */ WORD i_wcbReserved2,
  71.                                     /* in */ void * i_pvReserved2,
  72.                                     /* out */ void ** o_ppvObject
  73.                                     );
  74.  
  75. EXTERN_C EXPORTAPI __cdecl DtcGetTransactionManagerExA(
  76.                                     /* in */ char * i_pszHost,
  77.                                     /* in */ char * i_pszTmName,
  78.                                     /* in */ REFIID i_riid,
  79.                                     /* in */ DWORD i_grfOptions,
  80.                                     /* in */ void * i_pvConfigParams,
  81.                                     /* out */ void ** o_ppvObject
  82.                                     );
  83.  
  84.  
  85. EXTERN_C EXPORTAPI __cdecl DtcGetTransactionManagerExW(
  86.                                     /* in */ WCHAR * i_pwszHost,
  87.                                     /* in */ WCHAR * i_pwszTmName,
  88.                                     /* in */ REFIID i_riid,
  89.                                     /* in */ DWORD i_grfOptions,
  90.                                     /* in */ void * i_pvConfigParams,
  91.                                     /* out */ void ** o_ppvObject
  92.                                     );
  93. #ifdef UNICODE
  94. #define DtcGetTransactionManagerEx        DtcGetTransactionManagerExW
  95. #else
  96. #define DtcGetTransactionManagerEx        DtcGetTransactionManagerExA
  97. #endif
  98.  
  99.  
  100. #ifndef EXTERN_GUID
  101. #define EXTERN_GUID(g,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) DEFINE_GUID(g,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8)
  102. #endif
  103.  
  104. /*----------------------------------------
  105. // Define a CLSID that can be used to obtain a transaction manager instance via CoCreateInstance;
  106. // this is an alternate to using DtcGetTransactionManager. 
  107. //
  108. // CLSID_MSDtcTransactionManager = {5B18AB61-091D-11d1-97DF-00C04FB9618A}
  109. //--------------------------------------*/
  110. EXTERN_GUID(CLSID_MSDtcTransactionManager, 0x5b18ab61, 0x91d, 0x11d1, 0x97, 0xdf, 0x0, 0xc0, 0x4f, 0xb9, 0x61, 0x8a);
  111.  
  112. /*----------------------------------------
  113. // Define a CLSID that can be used with CoCreateInstance to instantiate a vanilla transaction
  114. // object with the local transaction manager. It's equivalent to doing 
  115. //
  116. //  pTransactionDispenser->BeginTransaction(NULL, ISOLATIONLEVEL_UNSPECIFIED, ISOFLAG_RETAIN_DONTCARE, NULL, &ptx);
  117. //
  118. // CLSID_MSDtcTransaction = {39F8D76B-0928-11d1-97DF-00C04FB9618A}
  119. //--------------------------------------*/
  120. EXTERN_GUID(CLSID_MSDtcTransaction, 0x39f8d76b, 0x928, 0x11d1, 0x97, 0xdf, 0x0, 0xc0, 0x4f, 0xb9, 0x61, 0x8a);
  121.  
  122. #pragma option pop /*P_O_Pop*/
  123. #endif
  124.