1 | /*
|
---|
2 | * Copyright (C) 2013 Daniel Jeliński
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | import "unknwn.idl";
|
---|
29 |
|
---|
30 | cpp_quote("#include <winerror.h>")
|
---|
31 |
|
---|
32 | interface ITransaction;
|
---|
33 | interface ITransactionCloner;
|
---|
34 | interface ITransaction2;
|
---|
35 | interface ITransactionDispenser;
|
---|
36 | interface ITransactionOptions;
|
---|
37 | interface ITransactionOutcomeEvents;
|
---|
38 | interface ITmNodeName;
|
---|
39 |
|
---|
40 | typedef struct BOID {
|
---|
41 | byte rgb[16];
|
---|
42 | } BOID;
|
---|
43 |
|
---|
44 | cpp_quote("#ifndef MAX_TRAN_DESC_DEFINED")
|
---|
45 | cpp_quote("#define MAX_TRAN_DESC_DEFINED")
|
---|
46 | typedef enum TX_MISC_CONSTANTS {
|
---|
47 | MAX_TRAN_DESC = 40
|
---|
48 | } TX_MISC_CONSTANTS;
|
---|
49 | cpp_quote("#endif")
|
---|
50 |
|
---|
51 | typedef BOID XACTUOW;
|
---|
52 | typedef LONG ISOLEVEL;
|
---|
53 |
|
---|
54 | typedef enum ISOLATIONLEVEL {
|
---|
55 | ISOLATIONLEVEL_UNSPECIFIED = 0xffffffff,
|
---|
56 | ISOLATIONLEVEL_CHAOS = 0x10,
|
---|
57 | ISOLATIONLEVEL_READUNCOMMITTED = 0x100,
|
---|
58 | ISOLATIONLEVEL_BROWSE = 0x100,
|
---|
59 | ISOLATIONLEVEL_CURSORSTABILITY = 0x1000,
|
---|
60 | ISOLATIONLEVEL_READCOMMITTED = 0x1000,
|
---|
61 | ISOLATIONLEVEL_REPEATABLEREAD = 0x10000,
|
---|
62 | ISOLATIONLEVEL_SERIALIZABLE = 0x100000,
|
---|
63 | ISOLATIONLEVEL_ISOLATED = 0x100000
|
---|
64 | } ISOLATIONLEVEL;
|
---|
65 |
|
---|
66 | typedef struct XACTTRANSINFO {
|
---|
67 | XACTUOW uow;
|
---|
68 | ISOLEVEL isoLevel;
|
---|
69 | ULONG isoFlags;
|
---|
70 | DWORD grfTCSupported;
|
---|
71 | DWORD grfRMSupported;
|
---|
72 | DWORD grfTCSupportedRetaining;
|
---|
73 | DWORD grfRMSupportedRetaining;
|
---|
74 | } XACTTRANSINFO;
|
---|
75 |
|
---|
76 | typedef struct XACTSTATS {
|
---|
77 | ULONG cOpen;
|
---|
78 | ULONG cCommitting;
|
---|
79 | ULONG cCommitted;
|
---|
80 | ULONG cAborting;
|
---|
81 | ULONG cAborted;
|
---|
82 | ULONG cInDoubt;
|
---|
83 | ULONG cHeuristicDecision;
|
---|
84 | FILETIME timeTransactionsUp;
|
---|
85 | } XACTSTATS;
|
---|
86 |
|
---|
87 | typedef enum ISOFLAG {
|
---|
88 | ISOFLAG_RETAIN_COMMIT_DC = 1,
|
---|
89 | ISOFLAG_RETAIN_COMMIT = 2,
|
---|
90 | ISOFLAG_RETAIN_COMMIT_NO = 3,
|
---|
91 | ISOFLAG_RETAIN_ABORT_DC = 4,
|
---|
92 | ISOFLAG_RETAIN_ABORT = 8,
|
---|
93 | ISOFLAG_RETAIN_ABORT_NO = 12,
|
---|
94 | ISOFLAG_RETAIN_DONTCARE = ISOFLAG_RETAIN_COMMIT_DC | ISOFLAG_RETAIN_ABORT_DC,
|
---|
95 | ISOFLAG_RETAIN_BOTH = ISOFLAG_RETAIN_COMMIT | ISOFLAG_RETAIN_ABORT,
|
---|
96 | ISOFLAG_RETAIN_NONE = ISOFLAG_RETAIN_COMMIT_NO | ISOFLAG_RETAIN_ABORT_NO,
|
---|
97 | ISOFLAG_OPTIMISTIC = 16,
|
---|
98 | ISOFLAG_READONLY = 32
|
---|
99 | } ISOFLAG;
|
---|
100 |
|
---|
101 | typedef enum XACTTC {
|
---|
102 | XACTTC_NONE = 0,
|
---|
103 | XACTTC_SYNC_PHASEONE = 1,
|
---|
104 | XACTTC_SYNC_PHASETWO = 2,
|
---|
105 | XACTTC_SYNC = 2,
|
---|
106 | XACTTC_ASYNC_PHASEONE = 4,
|
---|
107 | XACTTC_ASYNC = 4
|
---|
108 | } XACTTC;
|
---|
109 |
|
---|
110 | typedef enum XACTRM {
|
---|
111 | XACTRM_OPTIMISTICLASTWINS = 1,
|
---|
112 | XACTRM_NOREADONLYPREPARES
|
---|
113 | } XACTRM;
|
---|
114 |
|
---|
115 | typedef enum XACTCONST {
|
---|
116 | XACTCONST_TIMEOUTINFINITE
|
---|
117 | } XACTCONST;
|
---|
118 |
|
---|
119 | typedef enum XACTHEURISTIC {
|
---|
120 | XACTHEURISTIC_ABORT = 1,
|
---|
121 | XACTHEURISTIC_COMMIT,
|
---|
122 | XACTHEURISTIC_DAMAGE,
|
---|
123 | XACTHEURISTIC_DANGER
|
---|
124 | } XACTHEURISTIC;
|
---|
125 |
|
---|
126 | typedef enum XACTSTAT {
|
---|
127 | XACTSTAT_NONE = 0,
|
---|
128 | XACTSTAT_OPENNORMAL = 0x1,
|
---|
129 | XACTSTAT_OPENREFUSED = 0x2,
|
---|
130 | XACTSTAT_PREPARING = 0x4,
|
---|
131 | XACTSTAT_PREPARED = 0x8,
|
---|
132 | XACTSTAT_PREPARERETAINING = 0x10,
|
---|
133 | XACTSTAT_PREPARERETAINED = 0x20,
|
---|
134 | XACTSTAT_COMMITTING = 0x40,
|
---|
135 | XACTSTAT_COMMITRETAINING = 0x80,
|
---|
136 | XACTSTAT_ABORTING = 0x100,
|
---|
137 | XACTSTAT_ABORTED = 0x200,
|
---|
138 | XACTSTAT_COMMITTED = 0x400,
|
---|
139 | XACTSTAT_HEURISTIC_ABORT = 0x800,
|
---|
140 | XACTSTAT_HEURISTIC_COMMIT = 0x1000,
|
---|
141 | XACTSTAT_HEURISTIC_DAMAGE = 0x2000,
|
---|
142 | XACTSTAT_HEURISTIC_DANGER = 0x4000,
|
---|
143 | XACTSTAT_FORCED_ABORT = 0x8000,
|
---|
144 | XACTSTAT_FORCED_COMMIT = 0x10000,
|
---|
145 | XACTSTAT_INDOUBT = 0x20000,
|
---|
146 | XACTSTAT_CLOSED = 0x40000,
|
---|
147 | XACTSTAT_OPEN = 0x3,
|
---|
148 | XACTSTAT_NOTPREPARED = 0x7ffc3,
|
---|
149 | XACTSTAT_ALL = 0x7ffff
|
---|
150 | } XACTSTAT;
|
---|
151 |
|
---|
152 | typedef struct XACTOPT {
|
---|
153 | ULONG ulTimeout;
|
---|
154 | char szDescription[40 ];
|
---|
155 | } XACTOPT;
|
---|
156 |
|
---|
157 | [
|
---|
158 | object,
|
---|
159 | uuid(0fb15084-af41-11ce-bd2b-204c4f4f5020)
|
---|
160 | ]
|
---|
161 | interface ITransaction : IUnknown {
|
---|
162 | HRESULT Commit([in] BOOL fRetaining,
|
---|
163 | [in] DWORD grfTC,
|
---|
164 | [in] DWORD grfRM);
|
---|
165 | HRESULT Abort([in, unique] BOID *pboidReason,
|
---|
166 | [in] BOOL fRetaining,
|
---|
167 | [in] BOOL fAsync);
|
---|
168 | HRESULT GetTransactionInfo([out] XACTTRANSINFO *pinfo);
|
---|
169 | };
|
---|
170 |
|
---|
171 | [
|
---|
172 | object,
|
---|
173 | uuid(02656950-2152-11d0-944C-00A0C905416E)
|
---|
174 | ]
|
---|
175 | interface ITransactionCloner : ITransaction {
|
---|
176 | HRESULT CloneWithCommitDisabled([out] ITransaction **ppITransaction);
|
---|
177 | };
|
---|
178 |
|
---|
179 | [
|
---|
180 | object,
|
---|
181 | uuid(34021548-0065-11d3-bac1-00c04f797be2)
|
---|
182 | ]
|
---|
183 | interface ITransaction2 : ITransactionCloner {
|
---|
184 | HRESULT GetTransactionInfo2([out] XACTTRANSINFO *pinfo);
|
---|
185 | };
|
---|
186 |
|
---|
187 | [
|
---|
188 | object,
|
---|
189 | uuid(3A6AD9E1-23B9-11cf-AD60-00AA00A74CCD)
|
---|
190 | ]
|
---|
191 | interface ITransactionDispenser : IUnknown {
|
---|
192 | HRESULT GetOptionsObject([out] ITransactionOptions **ppOptions);
|
---|
193 | HRESULT BeginTransaction([in, unique] IUnknown *punkOuter,
|
---|
194 | [in] ISOLEVEL isoLevel,
|
---|
195 | [in] ULONG isoFlags,
|
---|
196 | [in, unique] ITransactionOptions *pOptions,
|
---|
197 | [out] ITransaction **ppTransaction);
|
---|
198 | };
|
---|
199 |
|
---|
200 | [
|
---|
201 | object,
|
---|
202 | uuid(3A6AD9E0-23B9-11cf-AD60-00AA00A74CCD)
|
---|
203 | ]
|
---|
204 | interface ITransactionOptions : IUnknown {
|
---|
205 | HRESULT SetOptions([in] XACTOPT *pOptions);
|
---|
206 | HRESULT GetOptions([in, out] XACTOPT *pOptions);
|
---|
207 | };
|
---|
208 |
|
---|
209 | [
|
---|
210 | object,
|
---|
211 | uuid(3A6AD9E2-23B9-11cf-AD60-00AA00A74CCD)
|
---|
212 | ]
|
---|
213 | interface ITransactionOutcomeEvents : IUnknown {
|
---|
214 | HRESULT Committed([in] BOOL fRetaining,
|
---|
215 | [in, unique] XACTUOW *pNewUOW,
|
---|
216 | [in] HRESULT hr);
|
---|
217 | HRESULT Aborted([in, unique] BOID *pboidReason,
|
---|
218 | [in] BOOL fRetaining,
|
---|
219 | [in, unique] XACTUOW *pNewUOW,
|
---|
220 | [in] HRESULT hr);
|
---|
221 | HRESULT HeuristicDecision([in] DWORD dwDecision,
|
---|
222 | [in, unique] BOID *pboidReason,
|
---|
223 | [in] HRESULT hr);
|
---|
224 | HRESULT Indoubt(void);
|
---|
225 | };
|
---|
226 |
|
---|
227 | [
|
---|
228 | object,
|
---|
229 | uuid(30274F88-6EE4-474e-9B95-7807BC9EF8CF)
|
---|
230 | ]
|
---|
231 | interface ITmNodeName : IUnknown {
|
---|
232 | HRESULT GetNodeNameSize([out] ULONG *pcbNodeNameSize);
|
---|
233 | HRESULT GetNodeName([in] ULONG cbNodeNameBufferSize,
|
---|
234 | [in, out] LPWSTR pNodeNameBuffer);
|
---|
235 | };
|
---|