txcoord.idl
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:6k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //-----------------------------------------------------------------------------
  2. // File: txcoord.idl
  3. //
  4. // Copyright: Copyright (c) Microsoft Corporation          
  5. //
  6. // Contents:  Transaction types and interfaces related to
  7. //             transaction coordination.
  8. //
  9. // Comments: 
  10. //
  11. //-----------------------------------------------------------------------------
  12. import "transact.idl";
  13. import "objidl.idl";    // needed for IMoniker
  14. //
  15. //--------------------------------------------------------------------------
  16. //
  17. interface ITransactionResourceAsync;
  18. interface ITransactionEnlistmentAsync;
  19. interface ITransactionExportFactory;
  20. interface ITransactionImportWhereabouts;
  21. interface ITransactionExport;
  22. interface ITransactionImport;
  23. //
  24. //--------------------------------------------------------------------------
  25. //
  26. // @interface ITransactionResourceAsync | Implemented by the resource manager.
  27. [object,uuid(69E971F0-23CE-11cf-AD60-00AA00A74CCD),pointer_default(unique)]
  28. interface ITransactionResourceAsync : IUnknown
  29. {
  30.     HRESULT PrepareRequest
  31.         (
  32.         [in] BOOL fRetaining, 
  33.         [in] DWORD grfRM, 
  34.         [in] BOOL fWantMoniker,
  35.         [in] BOOL fSinglePhase
  36.         );
  37.     HRESULT CommitRequest
  38.         (
  39.         [in] DWORD grfRM, 
  40.         [in] XACTUOW* pNewUOW
  41.         );
  42.     HRESULT AbortRequest
  43.         (
  44.         [in] BOID* pboidReason,
  45.         [in] BOOL  fRetaining,
  46.         [in] XACTUOW* pNewUOW
  47.         );
  48. HRESULT TMDown 
  49. void 
  50. );
  51.     }
  52. //
  53. //--------------------------------------------------------------------------
  54. //
  55. // @interface ITransactionEnlistmentAsync |
  56. [object,uuid(0fb15081-af41-11ce-bd2b-204c4f4f5020),pointer_default(unique)]
  57. interface ITransactionEnlistmentAsync : IUnknown {
  58.     HRESULT PrepareRequestDone
  59.         (
  60.         [in] HRESULT hr, 
  61.         [in] IMoniker* pmk,
  62.         [in] BOID* pboidReason
  63.         );
  64.     HRESULT CommitRequestDone
  65.         (
  66.         [in] HRESULT hr
  67.         );
  68.     HRESULT AbortRequestDone
  69.         (
  70.         [in] HRESULT hr
  71.         );
  72.     } 
  73. //
  74. //==========================================================================
  75. // Interfaces related to ODBC transaction coordination.
  76. //==========================================================================
  77. //
  78. // @interface ITransactionExportFactory | Used on the client side to associate an export / import object pair with an external connection.
  79. [object,uuid(E1CF9B53-8745-11ce-A9BA-00AA006C3706),pointer_default(unique)]
  80. interface ITransactionExportFactory : IUnknown {
  81.     HRESULT GetRemoteClassId
  82.         (
  83.         [out] CLSID*    pclsid
  84.         );
  85.     HRESULT Create
  86.         (
  87.         [in]  ULONG                     cbWhereabouts,
  88.         [in, size_is(cbWhereabouts)]            
  89.               BYTE*                     rgbWhereabouts,
  90.         [out] ITransactionExport**      ppExport
  91.         );
  92.     }
  93. //
  94. //--------------------------------------------------------------------------
  95. //
  96. // @interface ITransactionImportWhereabouts | Used on the server side to associate an export / import object pair with an external connection.
  97. [object,uuid(0141fda4-8fc0-11ce-bd18-204c4f4f5020),pointer_default(unique)]
  98. interface ITransactionImportWhereabouts : IUnknown {
  99.     HRESULT GetWhereaboutsSize
  100.         (
  101.         [out] ULONG*    pcbWhereabouts
  102.         );
  103.     [local]
  104.     HRESULT GetWhereabouts
  105.         (
  106.         [in]  ULONG     cbWhereabouts,
  107.         [out, size_is(cbWhereabouts)]
  108.               BYTE*     rgbWhereabouts,
  109.         [out] ULONG*    pcbUsed
  110.         );
  111.     [call_as(GetWhereabouts)]   // pcbWhereaboutsUsed is optional; error semantics on it
  112.     HRESULT RemoteGetWhereabouts
  113.         (
  114.         [out] ULONG*    pcbUsed,
  115.         [in]  ULONG     cbWhereabouts,
  116.         [out, size_is(cbWhereabouts), length_is(*pcbUsed)]
  117.               BYTE*     rgbWhereabouts
  118.         );
  119.     }
  120. //
  121. //--------------------------------------------------------------------------
  122. //
  123. // @interface ITransactionExport | Used to plumb up a particular transaction with an export / import pair.
  124. [object,uuid(0141fda5-8fc0-11ce-bd18-204c4f4f5020),pointer_default(unique)]
  125. interface ITransactionExport : IUnknown {
  126.     HRESULT Export
  127.         (
  128.         [in]  IUnknown* punkTransaction,
  129.         [out] ULONG*    pcbTransactionCookie
  130.         );
  131.     [local]
  132.     HRESULT GetTransactionCookie
  133.         (
  134.         [in]  IUnknown* punkTransaction,
  135.         [in]  ULONG     cbTransactionCookie,
  136.         [out, size_is(cbTransactionCookie)]
  137.               BYTE*     rgbTransactionCookie,
  138.         [out] ULONG*    pcbUsed
  139.         );
  140.     [call_as(GetTransactionCookie)]
  141.     HRESULT RemoteGetTransactionCookie
  142.         (
  143.         [in]  IUnknown* punkTransaction,
  144.         [out] ULONG*    pcbUsed,
  145.         [in]  ULONG     cbTransactionCookie,
  146.         [out, size_is(cbTransactionCookie), length_is(*pcbUsed)]
  147.               BYTE*     rgbTransactionCookie
  148.         );
  149.     }
  150. //
  151. //--------------------------------------------------------------------------
  152. //
  153. // @interface ITransactionImport | Used to plumb up a particular transaction with an export / import pair.
  154. [object,uuid(E1CF9B5A-8745-11ce-A9BA-00AA006C3706),pointer_default(unique)]
  155. interface ITransactionImport : IUnknown {
  156.     HRESULT Import
  157.         (
  158.         [in]  ULONG         cbTransactionCookie,
  159.         [in, size_is(cbTransactionCookie)]
  160.               BYTE*         rgbTransactionCookie,
  161.         [in]  IID*          piid,
  162.         [out, iid_is(piid)]
  163.               void**        ppvTransaction
  164.         );
  165.     }