txcoord.idl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. (
  50. void
  51. );
  52. }
  53. //
  54. //--------------------------------------------------------------------------
  55. //
  56. // @interface ITransactionEnlistmentAsync |
  57. [object,uuid(0fb15081-af41-11ce-bd2b-204c4f4f5020),pointer_default(unique)]
  58. interface ITransactionEnlistmentAsync : IUnknown {
  59. HRESULT PrepareRequestDone
  60. (
  61. [in] HRESULT hr,
  62. [in] IMoniker* pmk,
  63. [in] BOID* pboidReason
  64. );
  65. HRESULT CommitRequestDone
  66. (
  67. [in] HRESULT hr
  68. );
  69. HRESULT AbortRequestDone
  70. (
  71. [in] HRESULT hr
  72. );
  73. }
  74. //
  75. //==========================================================================
  76. // Interfaces related to ODBC transaction coordination.
  77. //==========================================================================
  78. //
  79. // @interface ITransactionExportFactory | Used on the client side to associate an export / import object pair with an external connection.
  80. [object,uuid(E1CF9B53-8745-11ce-A9BA-00AA006C3706),pointer_default(unique)]
  81. interface ITransactionExportFactory : IUnknown {
  82. HRESULT GetRemoteClassId
  83. (
  84. [out] CLSID* pclsid
  85. );
  86. HRESULT Create
  87. (
  88. [in] ULONG cbWhereabouts,
  89. [in, size_is(cbWhereabouts)]
  90. BYTE* rgbWhereabouts,
  91. [out] ITransactionExport** ppExport
  92. );
  93. }
  94. //
  95. //--------------------------------------------------------------------------
  96. //
  97. // @interface ITransactionImportWhereabouts | Used on the server side to associate an export / import object pair with an external connection.
  98. [object,uuid(0141fda4-8fc0-11ce-bd18-204c4f4f5020),pointer_default(unique)]
  99. interface ITransactionImportWhereabouts : IUnknown {
  100. HRESULT GetWhereaboutsSize
  101. (
  102. [out] ULONG* pcbWhereabouts
  103. );
  104. [local]
  105. HRESULT GetWhereabouts
  106. (
  107. [in] ULONG cbWhereabouts,
  108. [out, size_is(cbWhereabouts)]
  109. BYTE* rgbWhereabouts,
  110. [out] ULONG* pcbUsed
  111. );
  112. [call_as(GetWhereabouts)] // pcbWhereaboutsUsed is optional; error semantics on it
  113. HRESULT RemoteGetWhereabouts
  114. (
  115. [out] ULONG* pcbUsed,
  116. [in] ULONG cbWhereabouts,
  117. [out, size_is(cbWhereabouts), length_is(*pcbUsed)]
  118. BYTE* rgbWhereabouts
  119. );
  120. }
  121. //
  122. //--------------------------------------------------------------------------
  123. //
  124. // @interface ITransactionExport | Used to plumb up a particular transaction with an export / import pair.
  125. [object,uuid(0141fda5-8fc0-11ce-bd18-204c4f4f5020),pointer_default(unique)]
  126. interface ITransactionExport : IUnknown {
  127. HRESULT Export
  128. (
  129. [in] IUnknown* punkTransaction,
  130. [out] ULONG* pcbTransactionCookie
  131. );
  132. [local]
  133. HRESULT GetTransactionCookie
  134. (
  135. [in] IUnknown* punkTransaction,
  136. [in] ULONG cbTransactionCookie,
  137. [out, size_is(cbTransactionCookie)]
  138. BYTE* rgbTransactionCookie,
  139. [out] ULONG* pcbUsed
  140. );
  141. [call_as(GetTransactionCookie)]
  142. HRESULT RemoteGetTransactionCookie
  143. (
  144. [in] IUnknown* punkTransaction,
  145. [out] ULONG* pcbUsed,
  146. [in] ULONG cbTransactionCookie,
  147. [out, size_is(cbTransactionCookie), length_is(*pcbUsed)]
  148. BYTE* rgbTransactionCookie
  149. );
  150. }
  151. //
  152. //--------------------------------------------------------------------------
  153. //
  154. // @interface ITransactionImport | Used to plumb up a particular transaction with an export / import pair.
  155. [object,uuid(E1CF9B5A-8745-11ce-A9BA-00AA006C3706),pointer_default(unique)]
  156. interface ITransactionImport : IUnknown {
  157. HRESULT Import
  158. (
  159. [in] ULONG cbTransactionCookie,
  160. [in, size_is(cbTransactionCookie)]
  161. BYTE* rgbTransactionCookie,
  162. [in] IID* piid,
  163. [out, iid_is(piid)]
  164. void** ppvTransaction
  165. );
  166. }