Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
4.4 KiB

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