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.

259 lines
11 KiB

  1. cpp_quote("/*******************************************************************************/" )
  2. cpp_quote("/* */" )
  3. cpp_quote("/* Copyright � Microsoft Corporation. All rights reserved. */" )
  4. cpp_quote("/* */" )
  5. /* transact.IDL */
  6. /* */
  7. cpp_quote("/* The basic transaction interfaces and types. */" )
  8. cpp_quote("/* */" )
  9. cpp_quote("/*******************************************************************************/" )
  10. import "unknwn.idl";
  11. //
  12. //--------------------------------------------------------------------------
  13. //
  14. interface ITransaction;
  15. cpp_quote("#ifndef DECLSPEC_UUID")
  16. cpp_quote("#if _MSC_VER >= 1100")
  17. cpp_quote("#define DECLSPEC_UUID(x) __declspec(uuid(x))")
  18. cpp_quote("#else")
  19. cpp_quote("#define DECLSPEC_UUID(x)")
  20. cpp_quote("#endif")
  21. cpp_quote("#endif")
  22. //==========================================================================
  23. // Transaction related types
  24. //==========================================================================
  25. [local,pointer_default(unique)]
  26. interface BasicTransactionTypes
  27. {
  28. typedef struct BOID {
  29. byte rgb[16];
  30. } BOID;
  31. cpp_quote("#define BOID_NULL (*((BOID*)(&IID_NULL)))")
  32. // change the following two line together
  33. cpp_quote("#ifndef MAX_TRAN_DESC_DEFINED") // conflicts with uimsg.h. This is temporary work around
  34. cpp_quote("#define MAX_TRAN_DESC_DEFINED")
  35. typedef enum TX_MISC_CONSTANTS
  36. {
  37. MAX_TRAN_DESC = 40
  38. } TX_MISC_CONSTANTS;
  39. cpp_quote("#endif")
  40. // Unit Of Work.
  41. typedef BOID XACTUOW;
  42. // Data type for isolation level values.
  43. typedef LONG ISOLEVEL;
  44. // Constants that specifiy isolation level of a transaction.
  45. typedef enum ISOLATIONLEVEL {
  46. ISOLATIONLEVEL_UNSPECIFIED = 0xFFFFFFFF, //
  47. ISOLATIONLEVEL_CHAOS = 0x00000010, //
  48. ISOLATIONLEVEL_READUNCOMMITTED = 0x00000100, //
  49. ISOLATIONLEVEL_BROWSE = 0x00000100, // Synonym for _READUNCOMITTED
  50. ISOLATIONLEVEL_CURSORSTABILITY = 0x00001000, //
  51. ISOLATIONLEVEL_READCOMMITTED = 0x00001000, // Synonym for _CURSORSTABILITY
  52. ISOLATIONLEVEL_REPEATABLEREAD = 0x00010000, //
  53. ISOLATIONLEVEL_SERIALIZABLE = 0x00100000, //
  54. ISOLATIONLEVEL_ISOLATED = 0x00100000, // Synonym for _SERIALIZABLE
  55. } ISOLATIONLEVEL;
  56. // Transaction information structure, used in ITransaction
  57. typedef struct XACTTRANSINFO {
  58. XACTUOW uow; // The current unit of work
  59. ISOLEVEL isoLevel; // The isolation level for the current UOW
  60. ULONG isoFlags; // Values from ISOFLAG enumeration
  61. DWORD grfTCSupported; // Flags indicating capabilities
  62. DWORD grfRMSupported; // ... of this transaction wrt
  63. DWORD grfTCSupportedRetaining; // ... parameters to Commit
  64. DWORD grfRMSupportedRetaining; // ...
  65. } XACTTRANSINFO;
  66. typedef struct XACTSTATS {
  67. ULONG cOpen; // The number of currently extant transactions.
  68. ULONG cCommitting; // The number of transactions which are proceding towards committing.
  69. ULONG cCommitted; // The number of transactions that are have been committed.
  70. ULONG cAborting; // The number of transactions which are in the process of aborting.
  71. ULONG cAborted; // The number of transactions that are have been aborted.
  72. ULONG cInDoubt; // The number of transactions which are presently in doubt.
  73. ULONG cHeuristicDecision; // The number of transactions that have completed by heuristic decision.
  74. FILETIME timeTransactionsUp; // The amount of time that this transaction service has been up.
  75. } XACTSTATS;
  76. // @enum ISOFLAG | Used in <t XACTTRANSINFO> and <i ITransactionDispenser>.
  77. typedef enum ISOFLAG {
  78. ISOFLAG_RETAIN_COMMIT_DC = 1, // Use just one of ISOFLAG_RETAIN_COMMIT values
  79. ISOFLAG_RETAIN_COMMIT = 2, //
  80. ISOFLAG_RETAIN_COMMIT_NO = 3, //
  81. ISOFLAG_RETAIN_ABORT_DC = 4, // Use just one of ISOFLAG_RETAIN_ABORT values
  82. ISOFLAG_RETAIN_ABORT = 8, //
  83. ISOFLAG_RETAIN_ABORT_NO = 12, //
  84. ISOFLAG_RETAIN_DONTCARE = ISOFLAG_RETAIN_COMMIT_DC | ISOFLAG_RETAIN_ABORT_DC, //
  85. ISOFLAG_RETAIN_BOTH = ISOFLAG_RETAIN_COMMIT | ISOFLAG_RETAIN_ABORT, //
  86. ISOFLAG_RETAIN_NONE = ISOFLAG_RETAIN_COMMIT_NO | ISOFLAG_RETAIN_ABORT_NO, //
  87. ISOFLAG_OPTIMISTIC = 16, //
  88. ISOFLAG_READONLY = 32 //
  89. } ISOFLAG;
  90. // Used in ITransactionDispenser
  91. // A bit field of 32 bits; be sure to mask before comparing.
  92. typedef enum XACTTC {
  93. XACTTC_SYNC_PHASEONE = 1,
  94. XACTTC_SYNC_PHASETWO = 2,
  95. XACTTC_SYNC = 2, // nb alias for XACTTC_SYNC_PHASETWO
  96. XACTTC_ASYNC_PHASEONE = 4,
  97. XACTTC_ASYNC = 4 // nb alias for XACTTC_ASYNC_PHASEONE
  98. } XACTTC;
  99. // Used in ITransactionDispenser
  100. // A bit field of 32 bits; be sure to mask before comparing.
  101. typedef enum XACTRM {
  102. XACTRM_OPTIMISTICLASTWINS = 1, //
  103. XACTRM_NOREADONLYPREPARES = 2, //
  104. } XACTRM;
  105. typedef enum XACTCONST {
  106. XACTCONST_TIMEOUTINFINITE = 0, //
  107. } XACTCONST;
  108. typedef enum XACTHEURISTIC {
  109. XACTHEURISTIC_ABORT = 1,
  110. XACTHEURISTIC_COMMIT = 2,
  111. XACTHEURISTIC_DAMAGE = 3,
  112. XACTHEURISTIC_DANGER = 4,
  113. } XACTHEURISTIC;
  114. typedef enum XACTSTAT {
  115. XACTSTAT_NONE = 0x00000000,
  116. XACTSTAT_OPENNORMAL = 0x00000001,
  117. XACTSTAT_OPENREFUSED = 0x00000002,
  118. XACTSTAT_PREPARING = 0x00000004,
  119. XACTSTAT_PREPARED = 0x00000008,
  120. XACTSTAT_PREPARERETAINING = 0x00000010,
  121. XACTSTAT_PREPARERETAINED = 0x00000020,
  122. XACTSTAT_COMMITTING = 0x00000040,
  123. XACTSTAT_COMMITRETAINING = 0x00000080,
  124. XACTSTAT_ABORTING = 0x00000100,
  125. XACTSTAT_ABORTED = 0x00000200,
  126. XACTSTAT_COMMITTED = 0x00000400,
  127. XACTSTAT_HEURISTIC_ABORT = 0x00000800,
  128. XACTSTAT_HEURISTIC_COMMIT = 0x00001000,
  129. XACTSTAT_HEURISTIC_DAMAGE = 0x00002000,
  130. XACTSTAT_HEURISTIC_DANGER = 0x00004000,
  131. XACTSTAT_FORCED_ABORT = 0x00008000,
  132. XACTSTAT_FORCED_COMMIT = 0x00010000,
  133. XACTSTAT_INDOUBT = 0x00020000,
  134. XACTSTAT_CLOSED = 0x00040000,
  135. XACTSTAT_OPEN = 0x00000003,
  136. XACTSTAT_NOTPREPARED = 0x0007FFC3,
  137. XACTSTAT_ALL = 0x0007FFFF,
  138. } XACTSTAT;
  139. typedef struct XACTOPT { // Transaction configuration options
  140. ULONG ulTimeout; // timeout in milliseconds
  141. char szDescription[MAX_TRAN_DESC]; // description string for admin tools
  142. } XACTOPT;
  143. //
  144. //==========================================================================
  145. // Error code definitions for all transaction related functionality.
  146. //==========================================================================
  147. //
  148. typedef enum XACT_E {
  149. XACT_E_FIRST = 0x8004D000,
  150. XACT_E_LAST = 0x8004D01E,
  151. XACT_S_FIRST = 0x0004D000,
  152. XACT_S_LAST = 0x0004D009,
  153. XACT_E_ALREADYOTHERSINGLEPHASE = 0x8004D000,
  154. XACT_E_CANTRETAIN = 0x8004D001,
  155. XACT_E_COMMITFAILED = 0x8004D002,
  156. XACT_E_COMMITPREVENTED = 0x8004D003,
  157. XACT_E_HEURISTICABORT = 0x8004D004,
  158. XACT_E_HEURISTICCOMMIT = 0x8004D005,
  159. XACT_E_HEURISTICDAMAGE = 0x8004D006,
  160. XACT_E_HEURISTICDANGER = 0x8004D007,
  161. XACT_E_ISOLATIONLEVEL = 0x8004D008,
  162. XACT_E_NOASYNC = 0x8004D009,
  163. XACT_E_NOENLIST = 0x8004D00A,
  164. XACT_E_NOISORETAIN = 0x8004D00B,
  165. XACT_E_NORESOURCE = 0x8004D00C,
  166. XACT_E_NOTCURRENT = 0x8004D00D,
  167. XACT_E_NOTRANSACTION = 0x8004D00E,
  168. XACT_E_NOTSUPPORTED = 0x8004D00F,
  169. XACT_E_UNKNOWNRMGRID = 0x8004D010,
  170. XACT_E_WRONGSTATE = 0x8004D011,
  171. XACT_E_WRONGUOW = 0x8004D012,
  172. XACT_E_XTIONEXISTS = 0x8004D013,
  173. XACT_E_NOIMPORTOBJECT = 0x8004D014,
  174. XACT_E_INVALIDCOOKIE = 0x8004D015,
  175. XACT_E_INDOUBT = 0x8004D016,
  176. XACT_E_NOTIMEOUT = 0x8004D017,
  177. XACT_E_ALREADYINPROGRESS = 0x8004D018,
  178. XACT_E_ABORTED = 0x8004D019,
  179. XACT_E_LOGFULL = 0x8004D01A,
  180. XACT_E_TMNOTAVAILABLE = 0x8004D01B,
  181. XACT_E_CONNECTION_DOWN = 0x8004D01C,
  182. XACT_E_CONNECTION_DENIED = 0x8004D01D,
  183. XACT_E_REENLISTTIMEOUT = 0x8004D01E,
  184. XACT_S_ASYNC = 0x0004D000,
  185. XACT_S_DEFECT = 0x0004D001,
  186. XACT_S_READONLY = 0x0004D002,
  187. XACT_S_SOMENORETAIN = 0x0004D003,
  188. XACT_S_OKINFORM = 0x0004D004,
  189. XACT_S_MADECHANGESCONTENT = 0x0004D005,
  190. XACT_S_MADECHANGESINFORM = 0x0004D006,
  191. XACT_S_ALLNORETAIN = 0x0004D007,
  192. XACT_S_ABORTING = 0x0004D008,
  193. XACT_S_SINGLEPHASE = 0x0004D009,
  194. } XACT_E;
  195. }
  196. //
  197. //==========================================================================
  198. // Basic transaction interfaces
  199. //==========================================================================
  200. //
  201. // Transaction interface, single phase
  202. [object,uuid(0fb15084-af41-11ce-bd2b-204c4f4f5020), pointer_default(unique)]
  203. interface ITransaction : IUnknown {
  204. HRESULT Commit
  205. (
  206. [in] BOOL fRetaining,
  207. [in] DWORD grfTC,
  208. [in] DWORD grfRM
  209. );
  210. HRESULT Abort
  211. (
  212. [in, unique] BOID* pboidReason,
  213. [in] BOOL fRetaining,
  214. [in] BOOL fAsync
  215. );
  216. HRESULT GetTransactionInfo
  217. (
  218. [out] XACTTRANSINFO* pinfo
  219. );
  220. }