home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / xolehlp.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  3KB  |  80 lines

  1. /* ----------------------------------------------------------------------------
  2. Microsoft    D.T.C (Distributed Transaction Coordinator)
  3.  
  4. (c)    1995    Microsoft Corporation.    All Rights Reserved
  5.  
  6.  
  7. @module        XOLEHLP.H    |
  8.         // contains DTC helper APIs used by SQL Server and application clients
  9.         // to obtain the transaction manager
  10. -------------------------------------------------------------------------------
  11. @rev    0    |    13-Mar-1995    |    GaganC    |    Created
  12. ----------------------------------------------------------------------------- */
  13.  
  14. #ifndef __XOLEHLP__H__
  15. #define __XOLEHLP__H__
  16.  
  17.  
  18. //----------------------------------------
  19. //    All defines and constants go here
  20. //----------------------------------------
  21. #define EXPORTAPI __declspec( dllexport )HRESULT
  22.  
  23. //----------------------------------------
  24. //    All function prototypes go here
  25. //----------------------------------------
  26.  
  27. //This API should be used to obtain an IUnknown or a ITransactionDispenser
  28. //interface from the Microsoft Distributed Transaction Coordinator's proxy.
  29. //Typically, a NULL is passed for the host name and the TM Name. In which 
  30. //case the MS DTC on the same host is contacted and the interface provided
  31. //for it.
  32. EXPORTAPI __cdecl DtcGetTransactionManager( char *  pszHost,
  33.                                     char *    pszTmName,
  34.                                     /* in */ REFIID rid,
  35.                                     /* in */ DWORD    dwReserved1,
  36.                                     /* in */ WORD    wcbReserved2,
  37.                                     /* in */ void FAR * pvReserved2,
  38.                                     /*out */ void** ppvObject
  39.                                     )    ;
  40. EXTERN_C EXPORTAPI __cdecl DtcGetTransactionManagerC
  41.                                     (    char *  pszHost,
  42.                                         char *    pszTmName,
  43.                                         /* in */ REFIID rid,
  44.                                         /* in */ DWORD    dwReserved1,
  45.                                         /* in */ WORD    wcbReserved2,
  46.                                         /* in */ void FAR * pvReserved2,
  47.                                         /*out */ void** ppvObject
  48.                                     );
  49.  
  50. //----------------------------------
  51.  
  52. #ifndef EXTERN_GUID
  53. #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)
  54. #endif
  55.  
  56. ///////////////////////////////////////////////////////////////////////////////////////////////
  57. //
  58. // Define a CLSID that can be used to obtain a transaction manager instance via CoCreateInstance;
  59. // this is an alternate to using DtcGetTransactionManager. 
  60. //
  61. // CLSID_MSDtcTransactionManager = {5B18AB61-091D-11d1-97DF-00C04FB9618A}
  62. //
  63. EXTERN_GUID(CLSID_MSDtcTransactionManager, 0x5b18ab61, 0x91d, 0x11d1, 0x97, 0xdf, 0x0, 0xc0, 0x4f, 0xb9, 0x61, 0x8a);
  64.  
  65. ///////////////////////////////////////////////////////////////////////////////////////////////
  66. //
  67. // Define a CLSID that can be used with CoCreateInstance to instantiate a vanilla transaction
  68. // object with the local transaction manager. It's equivalent to doing 
  69. //
  70. //  pTransactionDispenser->BeginTransaction(NULL, ISOLATIONLEVEL_UNSPECIFIED, ISOFLAG_RETAIN_DONTCARE, NULL, &ptx);
  71. //
  72. // CLSID_MSDtcTransaction = {39F8D76B-0928-11d1-97DF-00C04FB9618A}
  73. //
  74. EXTERN_GUID(CLSID_MSDtcTransaction, 0x39f8d76b, 0x928, 0x11d1, 0x97, 0xdf, 0x0, 0xc0, 0x4f, 0xb9, 0x61, 0x8a);
  75.  
  76. ///////////////////////////////////////////////////////////////////////////////////////////////
  77.  
  78.  
  79. #endif // __XOLEHLP__H__
  80.