home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / RMFACADE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  4.9 KB  |  173 lines

  1. /* ----------------------------------------------------------------------------
  2. Microsoft    D.T.C (Distributed Transaction Coordinator)
  3.  
  4. (c)    1996    Microsoft Corporation.    All Rights Reserved
  5.  
  6. @doc
  7.  
  8. @module        RMFacade.h    |
  9.  
  10.             Contains helper API and interfaces for RMFacade which faciliates
  11.             OLE TX to XA protocol mapping
  12.  
  13. -------------------------------------------------------------------------------
  14. @rev     0     | 23rd-Nov-1996    |    GaganC        | Created with API
  15. ----------------------------------------------------------------------------- */
  16. #ifndef __RMFACADE_H__
  17. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  18. #define __RMFACADE_H__
  19.  
  20.  
  21. //---------------------------------------------------------
  22. //        ALL INCLUDE FILES GO HERE
  23. //---------------------------------------------------------
  24. #include <windows.h>
  25. #include "transact.h"
  26. #include "txcoord.h"
  27. #include "xa.h"
  28.  
  29.  
  30. //---------------------------------------------------------
  31. //            Typedefs
  32. //---------------------------------------------------------
  33. typedef enum _XactStatus
  34.     {
  35.         XACT_STATUS_NONE = 0,        //should never be encountered
  36.         XACT_STATUS_ABORTED,
  37.         XACT_STATUS_COMMITTED,        
  38.         XACT_STATUS_NOT_MY_TRANSACTION,
  39.         XACT_STATUS_TIMEOUT
  40.     } XACT_STATUS;
  41.  
  42.  
  43.  
  44. //---------------------------------------------------------
  45. //            Function Prototypes
  46. //---------------------------------------------------------
  47.  
  48. extern "C"
  49. {
  50.     HRESULT __stdcall GetDtcTxToXaMapperHelper
  51.                                     (
  52.                                      /* [in] */        REFIID riid, 
  53.                                      /* [out] */    void ** ppv
  54.                                     );
  55.  
  56.     HRESULT    __stdcall GetXARMClient 
  57.                                     (
  58.                                      /* [in] */        REFIID riid, 
  59.                                      /* [out] */    void ** ppv
  60.                                     );
  61. } //end all 'C' language API
  62.  
  63.  
  64.  
  65.  
  66. //---------------------------------------------------------
  67. //            ALL Errors Go Here
  68. //---------------------------------------------------------
  69. #define E_FAILED_TO_LOAD_DLL        0x8004D201L
  70.  
  71.  
  72.  
  73. //---------------------------------------------------------
  74. //            All    Interface IIDs go here 
  75. //---------------------------------------------------------
  76.  
  77. //IID_IResourceManagerFacade {EE5FF7B1-4572-11d0-9452-00A0C905416E}
  78. DEFINE_GUID(IID_IResourceManagerFacade, 
  79.             0xee5ff7b1,
  80.             0x4572,
  81.             0x11d0,
  82.             0x94, 0x52, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x6e);
  83.  
  84.  
  85. //IID_IResourceManagerClient {EE5FF7B2-4572-11d0-9452-00A0C905416E}
  86. DEFINE_GUID(IID_IResourceManagerClient, 
  87.             0xee5ff7b2,
  88.             0x4572,
  89.             0x11d0,
  90.             0x94, 0x52, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x6e);
  91.  
  92.  
  93. //---------------------------------------------------------
  94. //            All    Interfaces go here 
  95. //---------------------------------------------------------
  96.  
  97.  
  98. /* ----------------------------------------------------------------------------
  99. @interface <IResourceManagerFacade>
  100.  
  101.     Implemented by DTC Proxy for use by the client libraries of the XA RMs so 
  102.     they can get the OLE TX to XA Mapping
  103. ---------------------------------------------------------------------------- */
  104. #undef INTERFACE
  105. #define INTERFACE IResourceManagerFacade
  106.  
  107. DECLARE_INTERFACE_ (IResourceManagerFacade, IUnknown)
  108. {
  109.     // IUnknown interface methods:
  110.     STDMETHOD    (QueryInterface)    (THIS_ REFIID riid, LPVOID FAR * ppv) PURE;
  111.      STDMETHOD_    (ULONG, AddRef)        (THIS)     PURE;
  112.      STDMETHOD_    (ULONG, Release)    (THIS)     PURE;
  113.  
  114.     //methods for this interface
  115.     STDMETHOD (CreateNewResourceManager) 
  116.                                 (
  117.                                     /*[in]*/ char * pszDSN,
  118.                                     /*[in]*/ char * pszClientDllName,
  119.                                     /* [in-out] */ DWORD * pdwRMCookie
  120.                                 ) PURE;
  121.  
  122.     STDMETHOD (EnlistOnTransaction)
  123.                                 (
  124.                                     /* [in] */ DWORD dwRMCookie,
  125.                                     /* [in] */ ITransaction * pITransaction,
  126.                                     /* [in-out] */ XID * pxid,
  127.                                     /* [in] */ ITransactionResource * pITransRes
  128.                                 ) PURE;
  129.  
  130.     STDMETHOD (FindTransactionOutcome)
  131.                                 (
  132.                                     /* [in] */ DWORD dwRMCookie,
  133.                                     /* [in] */ XID * pxid,
  134.                                     /* [in-out] */ XACT_STATUS * pXactStatus
  135.                                 ) PURE;
  136.  
  137.     STDMETHOD (RecoveryComplete)
  138.                                 (
  139.                                     /* [in] */ DWORD dwRMCookie
  140.                                 ) PURE;
  141.  
  142. }; //end interface IResourceManagerFacade
  143.  
  144.  
  145.  
  146. /* ----------------------------------------------------------------------------
  147. @interface <IID_IResourceManagerClient>
  148.  
  149.     Implemented by the client libraries of the XA RMs which are providing the
  150.     OLE TX to XA Mapping. This interface will be used by DTC to drive recovery
  151. ---------------------------------------------------------------------------- */
  152. #undef INTERFACE
  153. #define INTERFACE IID_IResourceManagerClient
  154.  
  155. DECLARE_INTERFACE_ (IID_IResourceManagerClient, IUnknown)
  156. {
  157.     // IUnknown interface methods:
  158.     STDMETHOD    (QueryInterface)    (THIS_ REFIID riid, LPVOID FAR * ppv) PURE;
  159.      STDMETHOD_    (ULONG, AddRef)        (THIS)     PURE;
  160.      STDMETHOD_    (ULONG, Release)    (THIS)     PURE;
  161.  
  162.     STDMETHOD (DoRecovery)
  163.                                 (
  164.                                     /* [in] */ DWORD dwRMCookie,
  165.                                     /* [in] */ char * pszDSN
  166.                                 ) PURE;
  167.  
  168. }; //end interface IResourceManagerClient
  169.  
  170.  
  171.  
  172. #pragma option pop /*P_O_Pop*/
  173. #endif __RMFACADE_H__