1 | /*
|
---|
2 | * Copyright (C) 2006 Mike McCormack
|
---|
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 | * Sun 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, Sun 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 | typedef DWORD DBKIND;
|
---|
29 |
|
---|
30 | enum DBKINDENUM {
|
---|
31 | DBKIND_GUID_NAME,
|
---|
32 | DBKIND_GUID_PROPID,
|
---|
33 | DBKIND_NAME,
|
---|
34 | DBKIND_PGUID_NAME,
|
---|
35 | DBKIND_PGUID_PROPID,
|
---|
36 | DBKIND_PROPID,
|
---|
37 | DBKIND_GUID,
|
---|
38 | };
|
---|
39 |
|
---|
40 | typedef struct tagDBID {
|
---|
41 | [switch_type(DBKIND), switch_is(eKind)] union
|
---|
42 | {
|
---|
43 | [case(DBKIND_GUID_NAME, DBKIND_GUID_PROPID, DBKIND_GUID, DBKIND_NAME, DBKIND_PROPID)]
|
---|
44 | GUID guid;
|
---|
45 | [case(DBKIND_PGUID_NAME, DBKIND_PGUID_PROPID)]
|
---|
46 | GUID *pguid;
|
---|
47 | [default]
|
---|
48 | ;
|
---|
49 | } uGuid;
|
---|
50 | DBKIND eKind;
|
---|
51 | [switch_type(DBKIND), switch_is(eKind)] union
|
---|
52 | {
|
---|
53 | [case(DBKIND_GUID_NAME, DBKIND_NAME, DBKIND_PGUID_NAME)]
|
---|
54 | LPOLESTR pwszName;
|
---|
55 | [case(DBKIND_GUID_PROPID, DBKIND_GUID, DBKIND_PGUID_PROPID, DBKIND_PROPID)]
|
---|
56 | ULONG ulPropid;
|
---|
57 | [default]
|
---|
58 | ;
|
---|
59 | } uName;
|
---|
60 | } DBID;
|
---|
61 |
|
---|
62 | typedef DWORD DBPROPID;
|
---|
63 |
|
---|
64 | typedef struct tagDBPROPIDSET {
|
---|
65 | [size_is(cPropertyIDs)] DBPROPID *rgPropertyIDs;
|
---|
66 | ULONG cPropertyIDs;
|
---|
67 | GUID guidPropertySet;
|
---|
68 | } DBPROPIDSET;
|
---|
69 |
|
---|
70 | typedef DWORD DBPROPOPTIONS;
|
---|
71 |
|
---|
72 | enum DBPROPOPTIONENUM {
|
---|
73 | DBPROPOPTIONS_REQUIRED = 0,
|
---|
74 | DBPROPOPTIONS_SETIFCHEAP = 1,
|
---|
75 | DBPROPOPTIONS_OPTIONAL = 1,
|
---|
76 | };
|
---|
77 |
|
---|
78 | typedef DWORD DBPROPSTATUS;
|
---|
79 |
|
---|
80 | typedef struct tagDBPROP {
|
---|
81 | DBPROPID dwPropertyID;
|
---|
82 | DBPROPOPTIONS dwOptions;
|
---|
83 | DBPROPSTATUS dwStatus;
|
---|
84 | DBID colid;
|
---|
85 | VARIANT vValue;
|
---|
86 | } DBPROP;
|
---|
87 |
|
---|
88 | typedef struct tagDBPROPSET {
|
---|
89 | [size_is(cProperties)] DBPROP *rgProperties;
|
---|
90 | ULONG cProperties;
|
---|
91 | GUID guidPropertySet;
|
---|
92 | } DBPROPSET;
|
---|
93 |
|
---|
94 | typedef DWORD DBPROPFLAGS;
|
---|
95 |
|
---|
96 | typedef struct tagDBPROPINFO {
|
---|
97 | LPOLESTR pwszDescription;
|
---|
98 | DBPROPID dwPropertyID;
|
---|
99 | DBPROPFLAGS dwFlags;
|
---|
100 | VARTYPE vtType;
|
---|
101 | VARIANT vValues;
|
---|
102 | } DBPROPINFO;
|
---|
103 |
|
---|
104 | typedef DBPROPINFO *PDBPROPINFO;
|
---|
105 |
|
---|
106 | typedef struct tagDBPROPINFOSET {
|
---|
107 | [size_is(cPropertyInfos)] PDBPROPINFO rgPropertyInfos;
|
---|
108 | ULONG cPropertyInfos;
|
---|
109 | GUID guidPropertySet;
|
---|
110 | } DBPROPINFOSET;
|
---|
111 |
|
---|
112 | typedef DWORD DBBINDURLFLAG;
|
---|
113 | typedef DWORD DBBINDURLSTATUS;
|
---|
114 |
|
---|
115 | typedef struct tagDBIMPLICITSESSION
|
---|
116 | {
|
---|
117 | IUnknown *pUnkOuter;
|
---|
118 | IID *piid;
|
---|
119 | IUnknown *pSession;
|
---|
120 | } DBIMPLICITSESSION;
|
---|
121 |
|
---|
122 | typedef WORD DBTYPE;
|
---|
123 |
|
---|
124 | enum DBTYPEENUM
|
---|
125 | {
|
---|
126 | DBTYPE_EMPTY = 0,
|
---|
127 | DBTYPE_NULL = 1,
|
---|
128 | DBTYPE_I2 = 2,
|
---|
129 | DBTYPE_I4 = 3,
|
---|
130 | DBTYPE_R4 = 4,
|
---|
131 | DBTYPE_R8 = 5,
|
---|
132 | DBTYPE_CY = 6,
|
---|
133 | DBTYPE_DATE = 7,
|
---|
134 | DBTYPE_BSTR = 8,
|
---|
135 | DBTYPE_IDISPATCH = 9,
|
---|
136 | DBTYPE_ERROR = 10,
|
---|
137 | DBTYPE_BOOL = 11,
|
---|
138 | DBTYPE_VARIANT = 12,
|
---|
139 | DBTYPE_IUNKNOWN = 13,
|
---|
140 | DBTYPE_DECIMAL = 14,
|
---|
141 | DBTYPE_I1 = 16,
|
---|
142 | DBTYPE_UI1 = 17,
|
---|
143 | DBTYPE_UI2 = 18,
|
---|
144 | DBTYPE_UI4 = 19,
|
---|
145 | DBTYPE_I8 = 20,
|
---|
146 | DBTYPE_UI8 = 21,
|
---|
147 | DBTYPE_GUID = 72,
|
---|
148 | DBTYPE_BYTES = 128,
|
---|
149 | DBTYPE_STR = 129,
|
---|
150 | DBTYPE_WSTR = 130,
|
---|
151 | DBTYPE_NUMERIC = 131,
|
---|
152 | DBTYPE_UDT = 132,
|
---|
153 | DBTYPE_DBDATE = 133,
|
---|
154 | DBTYPE_DBTIME = 134,
|
---|
155 | DBTYPE_DBTIMESTAMP = 135,
|
---|
156 |
|
---|
157 | DBTYPE_VECTOR = 0x1000,
|
---|
158 | DBTYPE_ARRAY = 0x2000,
|
---|
159 | DBTYPE_BYREF = 0x4000,
|
---|
160 | DBTYPE_RESERVED = 0x8000
|
---|
161 | };
|
---|
162 |
|
---|
163 | enum DBTYPEENUM15
|
---|
164 | {
|
---|
165 | DBTYPE_HCHAPTER = 136
|
---|
166 | };
|
---|
167 |
|
---|
168 | enum DBTYPEENUM20
|
---|
169 | {
|
---|
170 | DBTYPE_FILETIME = 64,
|
---|
171 | DBTYPE_PROPVARIANT = 138,
|
---|
172 | DBTYPE_VARNUMERIC = 139
|
---|
173 | };
|
---|
174 |
|
---|
175 | typedef DWORD DBSTATUS;
|
---|
176 |
|
---|
177 | enum DBSTATUSENUM
|
---|
178 | {
|
---|
179 | DBSTATUS_S_OK = 0,
|
---|
180 | DBSTATUS_E_BADACCESSOR = 1,
|
---|
181 | DBSTATUS_E_CANTCONVERTVALUE = 2,
|
---|
182 | DBSTATUS_S_ISNULL = 3,
|
---|
183 | DBSTATUS_S_TRUNCATED = 4,
|
---|
184 | DBSTATUS_E_SIGNMISMATCH = 5,
|
---|
185 | DBSTATUS_E_DATAOVERFLOW = 6,
|
---|
186 | DBSTATUS_E_CANTCREATE = 7,
|
---|
187 | DBSTATUS_E_UNAVAILABLE = 8,
|
---|
188 | DBSTATUS_E_PERMISSIONDENIED = 9,
|
---|
189 | DBSTATUS_E_INTEGRITYVIOLATION = 10,
|
---|
190 | DBSTATUS_E_SCHEMAVIOLATION = 11,
|
---|
191 | DBSTATUS_E_BADSTATUS = 12,
|
---|
192 | DBSTATUS_S_DEFAULT = 13
|
---|
193 | };
|
---|
194 |
|
---|
195 | cpp_quote("#ifdef DBINITCONSTANTS")
|
---|
196 | cpp_quote("#ifdef __cplusplus")
|
---|
197 | cpp_quote("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
|
---|
198 | cpp_quote(" EXTERN_C const GUID name DECLSPEC_HIDDEN; \\")
|
---|
199 | cpp_quote(" EXTERN_C const GUID name = \\")
|
---|
200 | cpp_quote(" { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }")
|
---|
201 | cpp_quote("#else")
|
---|
202 | cpp_quote("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
|
---|
203 | cpp_quote(" const GUID name DECLSPEC_HIDDEN; \\")
|
---|
204 | cpp_quote(" const GUID name = \\")
|
---|
205 | cpp_quote(" { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }")
|
---|
206 | cpp_quote("#endif")
|
---|
207 | cpp_quote("#else")
|
---|
208 | cpp_quote("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
|
---|
209 | cpp_quote(" EXTERN_C const GUID name DECLSPEC_HIDDEN")
|
---|
210 | cpp_quote("#endif")
|
---|
211 |
|
---|
212 | cpp_quote("DEFINE_DBGUID(DBGUID_SESSION, 0xc8b522f5, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
|
---|
213 | cpp_quote("DEFINE_DBGUID(DBGUID_ROWSET, 0xc8b522f6, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
|
---|
214 | cpp_quote("DEFINE_DBGUID(DBGUID_ROW, 0xc8b522f7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
|
---|
215 | cpp_quote("DEFINE_DBGUID(DBGUID_STREAM, 0xc8b522f9, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
|
---|
216 |
|
---|
217 | typedef struct tagDBCOLUMNACCESS
|
---|
218 | {
|
---|
219 | void *pData;
|
---|
220 | DBID columnid;
|
---|
221 | DBLENGTH cbDataLen;
|
---|
222 | DBSTATUS dwStatus;
|
---|
223 | DBLENGTH cbMaxLen;
|
---|
224 | DB_DWRESERVE dwReserved;
|
---|
225 | DBTYPE wType;
|
---|
226 | BYTE bPrecision;
|
---|
227 | BYTE bScale;
|
---|
228 | } DBCOLUMNACCESS;
|
---|
229 |
|
---|
230 | typedef DWORD DBROWSTATUS;
|
---|
231 |
|
---|
232 | enum DBROWSTATUSENUM
|
---|
233 | {
|
---|
234 | DBROWSTATUS_S_OK = 0,
|
---|
235 | /* FIXME */
|
---|
236 | DBROWSTATUS_E_FAIL = 19,
|
---|
237 |
|
---|
238 | };
|
---|
239 |
|
---|
240 | typedef DWORD DBPART;
|
---|
241 |
|
---|
242 | enum DBPARTENUM
|
---|
243 | {
|
---|
244 | DBPART_INVALID = 0,
|
---|
245 | DBPART_VALUE = 1,
|
---|
246 | DBPART_LENGTH = 2,
|
---|
247 | DBPART_STATUS = 4,
|
---|
248 | };
|
---|
249 |
|
---|
250 | typedef DWORD DBPARAMIO;
|
---|
251 |
|
---|
252 | enum DBPARAMIOENUM
|
---|
253 | {
|
---|
254 | DBPARAMIO_NOTPARAM = 0,
|
---|
255 | DBPARAMIO_INPUT = 1,
|
---|
256 | DBPARAMIO_OUTPUT = 2,
|
---|
257 | };
|
---|
258 |
|
---|
259 | typedef DWORD DBMEMOWNER;
|
---|
260 |
|
---|
261 | enum DBMEMOWNERENUM
|
---|
262 | {
|
---|
263 | DBMEMOWNER_CLIENTOWNED = 0,
|
---|
264 | DBMEMOWNER_PROVIDEROWNED = 1,
|
---|
265 | };
|
---|
266 |
|
---|
267 | typedef struct tagDBOBJECT
|
---|
268 | {
|
---|
269 | DWORD dwFlags;
|
---|
270 | IID iid;
|
---|
271 | } DBOBJECT;
|
---|
272 |
|
---|
273 | typedef struct tagDBBINDEXT
|
---|
274 | {
|
---|
275 | [size_is((ULONG)ulExtension)] BYTE *pExtension;
|
---|
276 | DBCOUNTITEM ulExtension;
|
---|
277 | } DBBINDEXT;
|
---|
278 |
|
---|
279 | typedef struct tagDBBINDING
|
---|
280 | {
|
---|
281 | DBORDINAL iOrdinal;
|
---|
282 | DBBYTEOFFSET obValue;
|
---|
283 | DBBYTEOFFSET obLength;
|
---|
284 | DBBYTEOFFSET obStatus;
|
---|
285 | ITypeInfo *pTypeInfo;
|
---|
286 | DBOBJECT *pObject;
|
---|
287 | DBBINDEXT *pBindExt;
|
---|
288 | DBPART dwPart;
|
---|
289 | DBMEMOWNER dwMemOwner;
|
---|
290 | DBPARAMIO eParamIO;
|
---|
291 | DBLENGTH cbMaxLen;
|
---|
292 | DWORD dwFlags;
|
---|
293 | DBTYPE wType;
|
---|
294 | BYTE bPrecision;
|
---|
295 | BYTE bScale;
|
---|
296 | } DBBINDING;
|
---|
297 |
|
---|
298 | typedef ULONG_PTR HACCESSOR;
|
---|
299 |
|
---|
300 | cpp_quote("#define DB_INVALID_HACCESSOR 0x00")
|
---|
301 |
|
---|
302 | typedef ULONG_PTR HROW;
|
---|
303 |
|
---|
304 | cpp_quote("#define DB_NULL_HROW 0x00")
|
---|
305 |
|
---|
306 | typedef ULONG_PTR HWATCHREGION;
|
---|
307 |
|
---|
308 | cpp_quote("#define DBWATCHREGION_NULL NULL")
|
---|
309 |
|
---|
310 | typedef ULONG_PTR HCHAPTER;
|
---|
311 |
|
---|
312 | cpp_quote("#define DB_NULL_HCHAPTER 0x00")
|
---|
313 |
|
---|
314 | typedef struct tagDBPARAMS
|
---|
315 | {
|
---|
316 | void *pData;
|
---|
317 | DB_UPARAMS cParamSets;
|
---|
318 | HACCESSOR hAccessor;
|
---|
319 | } DBPARAMS;
|
---|
320 |
|
---|
321 | typedef DWORD DBASYNCHOP;
|
---|
322 |
|
---|
323 | enum DBASYNCHOPENUM
|
---|
324 | {
|
---|
325 | DBSYNCHOP_OPEN,
|
---|
326 | };
|
---|
327 |
|
---|
328 | typedef DWORD DBASYNCHPHASE;
|
---|
329 |
|
---|
330 | enum DBASYNCHPHASEENUM
|
---|
331 | {
|
---|
332 | DBASYNCHPHASE_INITIALIZATION,
|
---|
333 | DBASYNCHPHASE_POPULATION,
|
---|
334 | DBASYNCHPHASE_COMPLETE,
|
---|
335 | DBASYNCHPHASE_CANCELED,
|
---|
336 | };
|
---|
337 |
|
---|
338 | typedef struct tagRMTPACK
|
---|
339 | {
|
---|
340 | ISequentialStream *pISeqStream;
|
---|
341 | ULONG cbData;
|
---|
342 | ULONG cBSTR;
|
---|
343 | [size_is(cBSTR)] BSTR *rgBSTR;
|
---|
344 | ULONG cVARIANT;
|
---|
345 | [size_is(cVARIANT)] VARIANT *rgVARIANT;
|
---|
346 | ULONG cIDISPATCH;
|
---|
347 | [size_is(cIDISPATCH)] IDispatch **rgIDISPATCH;
|
---|
348 | ULONG cIUNKNOWN;
|
---|
349 | [size_is(cIUNKNOWN)] IUnknown **rgIUNKNOWN;
|
---|
350 | ULONG cPROPVARIANT;
|
---|
351 | [size_is(cPROPVARIANT)] PROPVARIANT *rgPROPVARIANT;
|
---|
352 | ULONG cArray;
|
---|
353 | [size_is(cArray)] VARIANT *rgArray;
|
---|
354 | } RMTPACK;
|
---|