2 * Copyright (C) 2006 Mike McCormack
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
31 typedef struct tagDBID
{
32 [switch_type(DBKIND
), switch_is(eKind
)] union
34 [case(DBKIND_GUID_NAME
, DBKIND_GUID_PROPID
, DBKIND_GUID
, DBKIND_NAME
, DBKIND_PROPID
)]
36 [case(DBKIND_PGUID_NAME
, DBKIND_PGUID_PROPID
)]
42 [switch_type(DBKIND
), switch_is(eKind
)] union
44 [case(DBKIND_GUID_NAME
, DBKIND_NAME
, DBKIND_PGUID_NAME
)]
46 [case(DBKIND_GUID_PROPID
, DBKIND_GUID
, DBKIND_PGUID_PROPID
, DBKIND_PROPID
)]
53 typedef DWORD DBPROPID
;
55 typedef struct tagDBPROPIDSET
{
56 [size_is(cPropertyIDs
)] DBPROPID
*rgPropertyIDs
;
61 typedef DWORD DBPROPOPTIONS
;
63 enum DBPROPOPTIONENUM
{
64 DBPROPOPTIONS_REQUIRED
= 0,
65 DBPROPOPTIONS_SETIFCHEAP
= 1,
66 DBPROPOPTIONS_OPTIONAL
= 1,
69 typedef DWORD DBPROPSTATUS
;
71 typedef struct tagDBPROP
{
72 DBPROPID dwPropertyID
;
73 DBPROPOPTIONS dwOptions
;
74 DBPROPSTATUS dwStatus
;
79 typedef struct tagDBPROPSET
{
80 [size_is(cProperties
)] DBPROP
*rgProperties
;
85 typedef DWORD DBPROPFLAGS
;
87 typedef struct tagDBPROPINFO
{
88 LPOLESTR pwszDescription
;
89 DBPROPID dwPropertyID
;
95 typedef DBPROPINFO
*PDBPROPINFO
;
97 typedef struct tagDBPROPINFOSET
{
98 [size_is(cPropertyInfos
)] PDBPROPINFO rgPropertyInfos
;
100 GUID guidPropertySet
;
103 typedef DWORD DBBINDURLFLAG
;
104 typedef DWORD DBBINDURLSTATUS
;
106 typedef struct tagDBIMPLICITSESSION
126 DBTYPE_IDISPATCH
= 9,
130 DBTYPE_IUNKNOWN
= 13,
142 DBTYPE_NUMERIC
= 131,
146 DBTYPE_DBTIMESTAMP
= 135,
148 DBTYPE_VECTOR
= 0x1000,
149 DBTYPE_ARRAY
= 0x2000,
150 DBTYPE_BYREF
= 0x4000,
151 DBTYPE_RESERVED
= 0x8000
156 DBTYPE_HCHAPTER
= 136
161 DBTYPE_FILETIME
= 64,
162 DBTYPE_PROPVARIANT
= 138,
163 DBTYPE_VARNUMERIC
= 139
166 typedef DWORD DBSTATUS
;
171 DBSTATUS_E_BADACCESSOR
= 1,
172 DBSTATUS_E_CANTCONVERTVALUE
= 2,
173 DBSTATUS_S_ISNULL
= 3,
174 DBSTATUS_S_TRUNCATED
= 4,
175 DBSTATUS_E_SIGNMISMATCH
= 5,
176 DBSTATUS_E_DATAOVERFLOW
= 6,
177 DBSTATUS_E_CANTCREATE
= 7,
178 DBSTATUS_E_UNAVAILABLE
= 8,
179 DBSTATUS_E_PERMISSIONDENIED
= 9,
180 DBSTATUS_E_INTEGRITYVIOLATION
= 10,
181 DBSTATUS_E_SCHEMAVIOLATION
= 11,
182 DBSTATUS_E_BADSTATUS
= 12,
183 DBSTATUS_S_DEFAULT
= 13
188 DBPROP_ABORTPRESERVE
= 0x00000002,
189 DBPROP_ACTIVESESSIONS
= 0x00000003,
190 DBPROP_ASYNCTXNCOMMIT
= 0x00000004,
191 DBPROP_AUTH_CACHE_AUTHINFO
= 0x00000005,
192 DBPROP_AUTH_ENCRYPT_PASSWORD
= 0x00000006,
193 DBPROP_AUTH_INTEGRATED
= 0x00000007,
194 DBPROP_AUTH_MASK_PASSWORD
= 0x00000008,
195 DBPROP_AUTH_PASSWORD
= 0x00000009,
196 DBPROP_AUTH_PERSIST_ENCRYPTED
= 0x0000000a,
197 DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO
= 0x0000000b,
198 DBPROP_AUTH_USERID
= 0x0000000c,
199 DBPROP_BLOCKINGSTORAGEOBJECTS
= 0x0000000d,
200 DBPROP_BOOKMARKS
= 0x0000000e,
201 DBPROP_BOOKMARKSKIPPED
= 0x0000000f,
202 DBPROP_BOOKMARKTYPE
= 0x00000010,
203 DBPROP_CACHEDEFERRED
= 0x00000011,
204 DBPROP_CANFETCHBACKWARDS
= 0x00000012,
205 DBPROP_CANHOLDROWS
= 0x00000013,
206 DBPROP_CANSCROLLBACKWARDS
= 0x00000015,
207 DBPROP_CATALOGLOCATION
= 0x00000016,
208 DBPROP_CATALOGTERM
= 0x00000017,
209 DBPROP_CATALOGUSAGE
= 0x00000018,
210 DBPROP_COL_AUTOINCREMENT
= 0x0000001a,
211 DBPROP_COL_DEFAULT
= 0x0000001b,
212 DBPROP_COL_DESCRIPTION
= 0x0000001c,
213 DBPROP_COL_NULLABLE
= 0x0000001d,
214 DBPROP_COL_PRIMARYKEY
= 0x0000001e,
215 DBPROP_COL_UNIQUE
= 0x0000001f,
216 DBPROP_COLUMNDEFINITION
= 0x00000020,
217 DBPROP_COLUMNRESTRICT
= 0x00000021,
218 DBPROP_COMMANDTIMEOUT
= 0x00000022,
219 DBPROP_COMMITPRESERVE
= 0x00000023,
220 DBPROP_CONCATNULLBEHAVIOR
= 0x00000024,
221 DBPROP_CURRENTCATALOG
= 0x00000025,
222 DBPROP_DATASOURCENAME
= 0x00000026,
223 DBPROP_DATASOURCEREADONLY
= 0x00000027,
224 DBPROP_DBMSNAME
= 0x00000028,
225 DBPROP_DBMSVER
= 0x00000029,
226 DBPROP_DEFERRED
= 0x0000002a,
227 DBPROP_DELAYSTORAGEOBJECTS
= 0x0000002b,
228 DBPROP_GROUPBY
= 0x0000002c,
229 DBPROP_HETEROGENEOUSTABLES
= 0x0000002d,
230 DBPROP_IDENTIFIERCASE
= 0x0000002e,
231 DBPROP_IMMOBILEROWS
= 0x0000002f,
232 DBPROP_INDEX_AUTOUPDATE
= 0x00000030,
233 DBPROP_INDEX_CLUSTERED
= 0x00000031,
234 DBPROP_INDEX_FILLFACTOR
= 0x00000032,
235 DBPROP_INDEX_INITIALSIZE
= 0x00000033,
236 DBPROP_INDEX_NULLCOLLATION
= 0x00000034,
237 DBPROP_INDEX_NULLS
= 0x00000035,
238 DBPROP_INDEX_PRIMARYKEY
= 0x00000036,
239 DBPROP_INDEX_SORTBOOKMARKS
= 0x00000037,
240 DBPROP_INDEX_TYPE
= 0x00000038,
241 DBPROP_INDEX_UNIQUE
= 0x00000039,
242 DBPROP_INIT_DATASOURCE
= 0x0000003b,
243 DBPROP_INIT_HWND
= 0x0000003c,
244 DBPROP_INIT_IMPERSONATION_LEVEL
= 0x0000003d,
245 DBPROP_INIT_LOCATION
= 0x0000003e,
246 DBPROP_INIT_MODE
= 0x0000003f,
247 DBPROP_INIT_PROMPT
= 0x00000040,
248 DBPROP_INIT_PROTECTION_LEVEL
= 0x00000041,
249 DBPROP_INIT_TIMEOUT
= 0x00000042,
250 DBPROP_LITERALBOOKMARKS
= 0x00000043,
251 DBPROP_LITERALIDENTITY
= 0x00000044,
252 DBPROP_MAXINDEXSIZE
= 0x00000046,
253 DBPROP_MAXOPENROWS
= 0x00000047,
254 DBPROP_MAXPENDINGROWS
= 0x00000048,
255 DBPROP_MAXROWS
= 0x00000049,
256 DBPROP_MAXROWSIZE
= 0x0000004a,
257 DBPROP_MAXROWSIZEINCLUDESBLOB
= 0x0000004b,
258 DBPROP_MAXTABLESINSELECT
= 0x0000004c,
259 DBPROP_MAYWRITECOLUMN
= 0x0000004d,
260 DBPROP_MEMORYUSAGE
= 0x0000004e,
261 DBPROP_MULTIPLESTORAGEOBJECTS
= 0x00000050,
262 DBPROP_MULTITABLEUPDATE
= 0x00000051,
263 DBPROP_NOTIFICATIONPHASES
= 0x00000052,
264 DBPROP_NULLCOLLATION
= 0x00000053,
265 DBPROP_OLEOBJECTS
= 0x00000054,
266 DBPROP_ORDERBYCOLUMNSINSELECT
= 0x00000055,
267 DBPROP_ORDEREDBOOKMARKS
= 0x00000056,
268 DBPROP_OTHERINSERT
= 0x00000057,
269 DBPROP_OTHERUPDATEDELETE
= 0x00000058,
270 DBPROP_OWNINSERT
= 0x00000059,
271 DBPROP_OWNUPDATEDELETE
= 0x0000005a,
272 DBPROP_PREPAREABORTBEHAVIOR
= 0x0000005b,
273 DBPROP_PREPARECOMMITBEHAVIOR
= 0x0000005c,
274 DBPROP_PROCEDURETERM
= 0x0000005d,
275 DBPROP_PROVIDERNAME
= 0x00000060,
276 DBPROP_PROVIDEROLEDBVER
= 0x00000061,
277 DBPROP_PROVIDERVER
= 0x00000062,
278 DBPROP_QUICKRESTART
= 0x00000063,
279 DBPROP_QUOTEDIDENTIFIERCASE
= 0x00000064,
280 DBPROP_REENTRANTEVENTS
= 0x00000065,
281 DBPROP_REMOVEDELETED
= 0x00000066,
282 DBPROP_REPORTMULTIPLECHANGES
= 0x00000067,
283 DBPROP_ROWRESTRICT
= 0x00000068,
284 DBPROP_ROWTHREADMODEL
= 0x00000069,
285 DBPROP_SCHEMATERM
= 0x0000006a,
286 DBPROP_SCHEMAUSAGE
= 0x0000006b,
287 DBPROP_SERVERCURSOR
= 0x0000006c,
288 DBPROP_SQLSUPPORT
= 0x0000006d,
289 DBPROP_STRUCTUREDSTORAGE
= 0x0000006f,
290 DBPROP_SUBQUERIES
= 0x00000070,
291 DBPROP_SUPPORTEDTXNISOLEVELS
= 0x00000071,
292 DBPROP_SUPPORTEDTXNISORETAIN
= 0x00000072,
293 DBPROP_TABLETERM
= 0x00000073,
294 DBPROP_TRANSACTEDOBJECT
= 0x00000074,
295 DBPROP_UPDATABILITY
= 0x00000075,
296 DBPROP_USERNAME
= 0x00000076,
297 DBPROP_STRONGIDENTITY
= 0x00000077,
298 DBPROP_BYREFACCESSORS
= 0x00000078,
299 DBPROP_IAccessor
= 0x00000079,
300 DBPROP_IColumnsInfo
= 0x0000007a,
301 DBPROP_IColumnsRowset
= 0x0000007b,
302 DBPROP_IConnectionPointContainer
= 0x0000007c,
303 DBPROP_IRowset
= 0x0000007e,
304 DBPROP_IRowsetChange
= 0x0000007f,
305 DBPROP_IRowsetIdentity
= 0x00000080,
306 DBPROP_IRowsetInfo
= 0x00000081,
307 DBPROP_IRowsetLocate
= 0x00000082,
308 DBPROP_IRowsetResynch
= 0x00000084,
309 DBPROP_IRowsetScroll
= 0x00000085,
310 DBPROP_IRowsetUpdate
= 0x00000086,
311 DBPROP_ISupportErrorInfo
= 0x00000087,
312 DBPROP_ILockBytes
= 0x00000088,
313 DBPROP_ISequentialStream
= 0x00000089,
314 DBPROP_IStorage
= 0x0000008a,
315 DBPROP_IStream
= 0x0000008b,
316 DBPROP_TBL_TEMPTABLE
= 0x0000008c,
317 DBPROP_IRowsetIndex
= 0x0000009f,
318 DBPROP_INIT_PROVIDERSTRING
= 0x000000a0,
319 DBPROP_SUPPORTEDTXNDDL
= 0x000000a1,
320 DBPROP_INDEX_TEMPINDEX
= 0x000000a3,
321 DBPROP_COL_FIXEDLENGTH
= 0x000000a7,
322 DBPROP_ASYNCTXNABORT
= 0x000000a8,
323 DBPROP_DSOTHREADMODEL
= 0x000000a9,
324 DBPROP_NOTIFYCOLUMNSET
= 0x000000ab,
325 DBPROP_NOTIFYROWDELETE
= 0x000000ad,
326 DBPROP_NOTIFYROWFIRSTCHANGE
= 0x000000ae,
327 DBPROP_NOTIFYROWINSERT
= 0x000000af,
328 DBPROP_NOTIFYROWRESYNCH
= 0x000000b1,
329 DBPROP_NOTIFYROWSETRELEASE
= 0x000000b2,
330 DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE
= 0x000000b3,
331 DBPROP_NOTIFYROWUNDOCHANGE
= 0x000000b4,
332 DBPROP_NOTIFYROWUNDODELETE
= 0x000000b5,
333 DBPROP_NOTIFYROWUNDOINSERT
= 0x000000b6,
334 DBPROP_NOTIFYROWUPDATE
= 0x000000b7,
335 DBPROP_OUTPUTPARAMETERAVAILABILITY
= 0x000000b8,
336 DBPROP_PERSISTENTIDTYPE
= 0x000000b9,
337 DBPROP_INIT_LCID
= 0x000000ba,
338 DBPROP_APPENDONLY
= 0x000000bb,
339 DBPROP_CHANGEINSERTEDROWS
= 0x000000bc,
340 DBPROP_RETURNPENDINGINSERTS
= 0x000000bd,
341 DBPROP_SESS_AUTOCOMMITISOLEVELS
= 0x000000be,
342 DBPROP_MULTIPLEPARAMSETS
= 0x000000bf,
343 DBPROP_ROWSETCONVERSIONSONCOMMAND
= 0x000000c0,
344 DBPROP_IConvertType
= 0x000000c2,
345 DBPROP_MULTIPLERESULTS
= 0x000000c4,
346 DBPROP_NOTIFICATIONGRANULARITY
= 0x000000c6,
347 DBPROP_NOTIFYROWSETCHANGED
= 0x000000d3,
350 cpp_quote
("#ifdef DBINITCONSTANTS")
351 cpp_quote
("#ifdef __cplusplus")
352 cpp_quote
("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
353 cpp_quote
(" EXTERN_C const GUID name DECLSPEC_HIDDEN; \\")
354 cpp_quote
(" EXTERN_C const GUID name = \\")
355 cpp_quote
(" { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }")
357 cpp_quote
("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
358 cpp_quote
(" const GUID name DECLSPEC_HIDDEN; \\")
359 cpp_quote
(" const GUID name = \\")
360 cpp_quote
(" { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }")
363 cpp_quote
("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
364 cpp_quote
(" EXTERN_C const GUID name DECLSPEC_HIDDEN")
367 cpp_quote
("DEFINE_DBGUID(DB_NULLGUID, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);")
368 cpp_quote
("DEFINE_DBGUID(DBPROPSET_DBINIT, 0xc8b522bc, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
369 cpp_quote
("DEFINE_DBGUID(DBGUID_SESSION, 0xc8b522f5, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
370 cpp_quote
("DEFINE_DBGUID(DBGUID_ROWSET, 0xc8b522f6, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
371 cpp_quote
("DEFINE_DBGUID(DBGUID_ROW, 0xc8b522f7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
372 cpp_quote
("DEFINE_DBGUID(DBGUID_STREAM, 0xc8b522f9, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
374 cpp_quote
("#define DBPROMPT_PROMPT 0x01")
375 cpp_quote
("#define DBPROMPT_COMPLETE 0x02")
376 cpp_quote
("#define DBPROMPT_COMPLETEREQUIRED 0x03")
377 cpp_quote
("#define DBPROMPT_NOPROMPT 0x04")
380 typedef struct tagDBCOLUMNACCESS
387 DB_DWRESERVE dwReserved
;
393 typedef DWORD DBROWSTATUS
;
397 DBROWSTATUS_S_OK
= 0,
399 DBROWSTATUS_E_FAIL
= 19,
403 typedef DWORD DBPART
;
413 typedef DWORD DBPARAMIO
;
417 DBPARAMIO_NOTPARAM
= 0,
419 DBPARAMIO_OUTPUT
= 2,
422 typedef DWORD DBMEMOWNER
;
426 DBMEMOWNER_CLIENTOWNED
= 0,
427 DBMEMOWNER_PROVIDEROWNED
= 1,
430 typedef struct tagDBOBJECT
436 typedef struct tagDBBINDEXT
438 [size_is((ULONG
)ulExtension
)] BYTE *pExtension
;
439 DBCOUNTITEM ulExtension
;
442 typedef struct tagDBBINDING
445 DBBYTEOFFSET obValue
;
446 DBBYTEOFFSET obLength
;
447 DBBYTEOFFSET obStatus
;
448 ITypeInfo
*pTypeInfo
;
452 DBMEMOWNER dwMemOwner
;
461 typedef ULONG_PTR HACCESSOR
;
463 cpp_quote
("#define DB_INVALID_HACCESSOR 0x00")
465 typedef ULONG_PTR HROW
;
467 cpp_quote
("#define DB_NULL_HROW 0x00")
469 typedef ULONG_PTR HWATCHREGION
;
471 cpp_quote
("#define DBWATCHREGION_NULL NULL")
473 typedef ULONG_PTR HCHAPTER
;
475 cpp_quote
("#define DB_NULL_HCHAPTER 0x00")
477 typedef struct tagDBPARAMS
480 DB_UPARAMS cParamSets
;
484 typedef DWORD DBASYNCHOP
;
491 typedef DWORD DBASYNCHPHASE
;
493 enum DBASYNCHPHASEENUM
495 DBASYNCHPHASE_INITIALIZATION
,
496 DBASYNCHPHASE_POPULATION
,
497 DBASYNCHPHASE_COMPLETE
,
498 DBASYNCHPHASE_CANCELED
,
501 typedef struct tagRMTPACK
503 ISequentialStream
*pISeqStream
;
506 [size_is(cBSTR
)] BSTR *rgBSTR
;
508 [size_is(cVARIANT
)] VARIANT *rgVARIANT
;
510 [size_is(cIDISPATCH
)] IDispatch
**rgIDISPATCH
;
512 [size_is(cIUNKNOWN
)] IUnknown
**rgIUNKNOWN
;
514 [size_is(cPROPVARIANT
)] PROPVARIANT
*rgPROPVARIANT
;
516 [size_is(cArray
)] VARIANT *rgArray
;