2 * Copyright (C) 2013 Daniel JeliĆski
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.
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.
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
21 cpp_quote
("#include <winerror.h>")
23 interface ITransaction
;
24 interface ITransactionCloner
;
25 interface ITransaction2
;
26 interface ITransactionDispenser
;
27 interface ITransactionOptions
;
28 interface ITransactionOutcomeEvents
;
29 interface ITmNodeName
;
35 cpp_quote
("#ifndef MAX_TRAN_DESC_DEFINED")
36 cpp_quote
("#define MAX_TRAN_DESC_DEFINED")
37 typedef enum TX_MISC_CONSTANTS
{
43 typedef LONG ISOLEVEL
;
45 typedef enum ISOLATIONLEVEL
{
46 ISOLATIONLEVEL_UNSPECIFIED
= 0xffffffff,
47 ISOLATIONLEVEL_CHAOS
= 0x10,
48 ISOLATIONLEVEL_READUNCOMMITTED
= 0x100,
49 ISOLATIONLEVEL_BROWSE
= 0x100,
50 ISOLATIONLEVEL_CURSORSTABILITY
= 0x1000,
51 ISOLATIONLEVEL_READCOMMITTED
= 0x1000,
52 ISOLATIONLEVEL_REPEATABLEREAD
= 0x10000,
53 ISOLATIONLEVEL_SERIALIZABLE
= 0x100000,
54 ISOLATIONLEVEL_ISOLATED
= 0x100000
57 typedef struct XACTTRANSINFO
{
63 DWORD grfTCSupportedRetaining
;
64 DWORD grfRMSupportedRetaining
;
67 typedef struct XACTSTATS
{
74 ULONG cHeuristicDecision
;
75 FILETIME timeTransactionsUp
;
78 typedef enum ISOFLAG
{
79 ISOFLAG_RETAIN_COMMIT_DC
= 1,
80 ISOFLAG_RETAIN_COMMIT
= 2,
81 ISOFLAG_RETAIN_COMMIT_NO
= 3,
82 ISOFLAG_RETAIN_ABORT_DC
= 4,
83 ISOFLAG_RETAIN_ABORT
= 8,
84 ISOFLAG_RETAIN_ABORT_NO
= 12,
85 ISOFLAG_RETAIN_DONTCARE
= ISOFLAG_RETAIN_COMMIT_DC | ISOFLAG_RETAIN_ABORT_DC
,
86 ISOFLAG_RETAIN_BOTH
= ISOFLAG_RETAIN_COMMIT | ISOFLAG_RETAIN_ABORT
,
87 ISOFLAG_RETAIN_NONE
= ISOFLAG_RETAIN_COMMIT_NO | ISOFLAG_RETAIN_ABORT_NO
,
88 ISOFLAG_OPTIMISTIC
= 16,
94 XACTTC_SYNC_PHASEONE
= 1,
95 XACTTC_SYNC_PHASETWO
= 2,
97 XACTTC_ASYNC_PHASEONE
= 4,
101 typedef enum XACTRM
{
102 XACTRM_OPTIMISTICLASTWINS
= 1,
103 XACTRM_NOREADONLYPREPARES
106 typedef enum XACTCONST
{
107 XACTCONST_TIMEOUTINFINITE
110 typedef enum XACTHEURISTIC
{
111 XACTHEURISTIC_ABORT
= 1,
112 XACTHEURISTIC_COMMIT
,
113 XACTHEURISTIC_DAMAGE
,
117 typedef enum XACTSTAT
{
119 XACTSTAT_OPENNORMAL
= 0x1,
120 XACTSTAT_OPENREFUSED
= 0x2,
121 XACTSTAT_PREPARING
= 0x4,
122 XACTSTAT_PREPARED
= 0x8,
123 XACTSTAT_PREPARERETAINING
= 0x10,
124 XACTSTAT_PREPARERETAINED
= 0x20,
125 XACTSTAT_COMMITTING
= 0x40,
126 XACTSTAT_COMMITRETAINING
= 0x80,
127 XACTSTAT_ABORTING
= 0x100,
128 XACTSTAT_ABORTED
= 0x200,
129 XACTSTAT_COMMITTED
= 0x400,
130 XACTSTAT_HEURISTIC_ABORT
= 0x800,
131 XACTSTAT_HEURISTIC_COMMIT
= 0x1000,
132 XACTSTAT_HEURISTIC_DAMAGE
= 0x2000,
133 XACTSTAT_HEURISTIC_DANGER
= 0x4000,
134 XACTSTAT_FORCED_ABORT
= 0x8000,
135 XACTSTAT_FORCED_COMMIT
= 0x10000,
136 XACTSTAT_INDOUBT
= 0x20000,
137 XACTSTAT_CLOSED
= 0x40000,
139 XACTSTAT_NOTPREPARED
= 0x7ffc3,
140 XACTSTAT_ALL
= 0x7ffff
143 typedef struct XACTOPT
{
145 char szDescription
[40 ];
150 uuid(0fb15084
-af41
-11ce
-bd2b
-204c4f4f5020
)
152 interface ITransaction
: IUnknown
{
153 HRESULT Commit
([in] BOOL fRetaining
,
156 HRESULT Abort
([in, unique] BOID
*pboidReason
,
157 [in] BOOL fRetaining
,
159 HRESULT GetTransactionInfo
([out] XACTTRANSINFO
*pinfo
);
164 uuid(02656950-2152-11d0
-944C
-00A0C905416E
)
166 interface ITransactionCloner
: ITransaction
{
167 HRESULT CloneWithCommitDisabled
([out] ITransaction
**ppITransaction
);
172 uuid(34021548-0065-11d3
-bac1
-00c04f797be2
)
174 interface ITransaction2
: ITransactionCloner
{
175 HRESULT GetTransactionInfo2
([out] XACTTRANSINFO
*pinfo
);
180 uuid(3A6AD9E1
-23B9
-11cf
-AD60
-00AA00A74CCD
)
182 interface ITransactionDispenser
: IUnknown
{
183 HRESULT GetOptionsObject
([out] ITransactionOptions
**ppOptions
);
184 HRESULT BeginTransaction
([in, unique] IUnknown
*punkOuter
,
185 [in] ISOLEVEL isoLevel
,
187 [in, unique] ITransactionOptions
*pOptions
,
188 [out] ITransaction
**ppTransaction
);
193 uuid(3A6AD9E0
-23B9
-11cf
-AD60
-00AA00A74CCD
)
195 interface ITransactionOptions
: IUnknown
{
196 HRESULT SetOptions
([in] XACTOPT
*pOptions
);
197 HRESULT GetOptions
([in, out] XACTOPT
*pOptions
);
202 uuid(3A6AD9E2
-23B9
-11cf
-AD60
-00AA00A74CCD
)
204 interface ITransactionOutcomeEvents
: IUnknown
{
205 HRESULT Committed
([in] BOOL fRetaining
,
206 [in, unique] XACTUOW
*pNewUOW
,
208 HRESULT Aborted
([in, unique] BOID
*pboidReason
,
209 [in] BOOL fRetaining
,
210 [in, unique] XACTUOW
*pNewUOW
,
212 HRESULT HeuristicDecision
([in] DWORD dwDecision
,
213 [in, unique] BOID
*pboidReason
,
215 HRESULT Indoubt
(void);
220 uuid(30274F88
-6EE4
-474e-9B95
-7807BC9EF8CF
)
222 interface ITmNodeName
: IUnknown
{
223 HRESULT GetNodeNameSize
([out] ULONG
*pcbNodeNameSize
);
224 HRESULT GetNodeName
([in] ULONG cbNodeNameBufferSize
,
225 [in, out] LPWSTR pNodeNameBuffer
);