dbs.idl 27.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright (C) 2006 Mike McCormack
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

19 20 21 22
#if 0
#pragma makedep install
#endif

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
typedef DWORD DBKIND;

enum DBKINDENUM {
    DBKIND_GUID_NAME,
    DBKIND_GUID_PROPID,
    DBKIND_NAME,
    DBKIND_PGUID_NAME,
    DBKIND_PGUID_PROPID,
    DBKIND_PROPID,
    DBKIND_GUID,
};

typedef struct tagDBID {
    [switch_type(DBKIND), switch_is(eKind)] union
    {
    [case(DBKIND_GUID_NAME, DBKIND_GUID_PROPID, DBKIND_GUID, DBKIND_NAME, DBKIND_PROPID)]
        GUID guid;
    [case(DBKIND_PGUID_NAME, DBKIND_PGUID_PROPID)]
        GUID *pguid;
    [default]
        ;
    } uGuid;
    DBKIND eKind;
    [switch_type(DBKIND), switch_is(eKind)] union
    {
    [case(DBKIND_GUID_NAME, DBKIND_NAME, DBKIND_PGUID_NAME)]
        LPOLESTR pwszName;
    [case(DBKIND_GUID_PROPID, DBKIND_GUID, DBKIND_PGUID_PROPID, DBKIND_PROPID)]
        ULONG ulPropid;
    [default]
        ;
    } uName;
} DBID;

57 58 59 60 61 62 63
typedef struct tagDB_NUMERIC {
    BYTE precision;
    BYTE scale;
    BYTE sign;
    BYTE val[16];
} DB_NUMERIC;

64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
typedef DWORD DBPROPID;

typedef struct tagDBPROPIDSET {
    [size_is(cPropertyIDs)] DBPROPID *rgPropertyIDs;
    ULONG cPropertyIDs;
    GUID guidPropertySet;
} DBPROPIDSET;

typedef DWORD DBPROPOPTIONS;

enum DBPROPOPTIONENUM {
    DBPROPOPTIONS_REQUIRED = 0,
    DBPROPOPTIONS_SETIFCHEAP = 1,
    DBPROPOPTIONS_OPTIONAL = 1,
};

typedef DWORD DBPROPSTATUS;

typedef struct tagDBPROP {
    DBPROPID dwPropertyID;
    DBPROPOPTIONS dwOptions;
    DBPROPSTATUS dwStatus;
    DBID colid;
    VARIANT vValue;
} DBPROP;

typedef struct tagDBPROPSET {
    [size_is(cProperties)] DBPROP *rgProperties;
    ULONG cProperties;
    GUID guidPropertySet;
} DBPROPSET;

typedef DWORD DBPROPFLAGS;

typedef struct tagDBPROPINFO {
    LPOLESTR pwszDescription;
    DBPROPID dwPropertyID;
    DBPROPFLAGS dwFlags;
    VARTYPE vtType;
    VARIANT vValues;
} DBPROPINFO;

typedef DBPROPINFO *PDBPROPINFO;

typedef struct tagDBPROPINFOSET {
    [size_is(cPropertyInfos)] PDBPROPINFO rgPropertyInfos;
    ULONG cPropertyInfos;
    GUID guidPropertySet;
} DBPROPINFOSET;
Huw Davies's avatar
Huw Davies committed
113 114 115 116 117 118 119 120 121 122

typedef DWORD DBBINDURLFLAG;
typedef DWORD DBBINDURLSTATUS;

typedef struct tagDBIMPLICITSESSION
{
    IUnknown *pUnkOuter;
    IID *piid;
    IUnknown *pSession;
} DBIMPLICITSESSION;
Huw Davies's avatar
Huw Davies committed
123 124 125

typedef WORD DBTYPE;

Huw Davies's avatar
Huw Davies committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
enum DBTYPEENUM
{
    DBTYPE_EMPTY         = 0,
    DBTYPE_NULL          = 1,
    DBTYPE_I2            = 2,
    DBTYPE_I4            = 3,
    DBTYPE_R4            = 4,
    DBTYPE_R8            = 5,
    DBTYPE_CY            = 6,
    DBTYPE_DATE          = 7,
    DBTYPE_BSTR          = 8,
    DBTYPE_IDISPATCH     = 9,
    DBTYPE_ERROR         = 10,
    DBTYPE_BOOL          = 11,
    DBTYPE_VARIANT       = 12,
    DBTYPE_IUNKNOWN      = 13,
    DBTYPE_DECIMAL       = 14,
    DBTYPE_I1            = 16,
    DBTYPE_UI1           = 17,
    DBTYPE_UI2           = 18,
    DBTYPE_UI4           = 19,
    DBTYPE_I8            = 20,
    DBTYPE_UI8           = 21,
    DBTYPE_GUID          = 72,
    DBTYPE_BYTES         = 128,
    DBTYPE_STR           = 129,
    DBTYPE_WSTR          = 130,
    DBTYPE_NUMERIC       = 131,
    DBTYPE_UDT           = 132,
    DBTYPE_DBDATE        = 133,
    DBTYPE_DBTIME        = 134,
    DBTYPE_DBTIMESTAMP   = 135,

    DBTYPE_VECTOR        = 0x1000,
    DBTYPE_ARRAY         = 0x2000,
    DBTYPE_BYREF         = 0x4000,
    DBTYPE_RESERVED      = 0x8000
};

165 166 167 168 169 170 171 172 173 174 175 176
enum DBTYPEENUM15
{
    DBTYPE_HCHAPTER      = 136
};

enum DBTYPEENUM20
{
    DBTYPE_FILETIME      = 64,
    DBTYPE_PROPVARIANT   = 138,
    DBTYPE_VARNUMERIC    = 139
};

Huw Davies's avatar
Huw Davies committed
177
typedef DWORD DBSTATUS;
Huw Davies's avatar
Huw Davies committed
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195

enum DBSTATUSENUM
{
    DBSTATUS_S_OK = 0,
    DBSTATUS_E_BADACCESSOR = 1,
    DBSTATUS_E_CANTCONVERTVALUE = 2,
    DBSTATUS_S_ISNULL = 3,
    DBSTATUS_S_TRUNCATED = 4,
    DBSTATUS_E_SIGNMISMATCH = 5,
    DBSTATUS_E_DATAOVERFLOW = 6,
    DBSTATUS_E_CANTCREATE = 7,
    DBSTATUS_E_UNAVAILABLE = 8,
    DBSTATUS_E_PERMISSIONDENIED = 9,
    DBSTATUS_E_INTEGRITYVIOLATION = 10,
    DBSTATUS_E_SCHEMAVIOLATION = 11,
    DBSTATUS_E_BADSTATUS = 12,
    DBSTATUS_S_DEFAULT = 13
};
196

197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
enum DBPROPENUM
{
    DBPROP_ABORTPRESERVE                   = 0x00000002,
    DBPROP_ACTIVESESSIONS                  = 0x00000003,
    DBPROP_ASYNCTXNCOMMIT                  = 0x00000004,
    DBPROP_AUTH_CACHE_AUTHINFO             = 0x00000005,
    DBPROP_AUTH_ENCRYPT_PASSWORD           = 0x00000006,
    DBPROP_AUTH_INTEGRATED                 = 0x00000007,
    DBPROP_AUTH_MASK_PASSWORD              = 0x00000008,
    DBPROP_AUTH_PASSWORD                   = 0x00000009,
    DBPROP_AUTH_PERSIST_ENCRYPTED          = 0x0000000a,
    DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO = 0x0000000b,
    DBPROP_AUTH_USERID                     = 0x0000000c,
    DBPROP_BLOCKINGSTORAGEOBJECTS          = 0x0000000d,
    DBPROP_BOOKMARKS                       = 0x0000000e,
    DBPROP_BOOKMARKSKIPPED                 = 0x0000000f,
    DBPROP_BOOKMARKTYPE                    = 0x00000010,
    DBPROP_CACHEDEFERRED                   = 0x00000011,
    DBPROP_CANFETCHBACKWARDS               = 0x00000012,
    DBPROP_CANHOLDROWS                     = 0x00000013,
    DBPROP_CANSCROLLBACKWARDS              = 0x00000015,
    DBPROP_CATALOGLOCATION                 = 0x00000016,
    DBPROP_CATALOGTERM                     = 0x00000017,
    DBPROP_CATALOGUSAGE                    = 0x00000018,
    DBPROP_COL_AUTOINCREMENT               = 0x0000001a,
    DBPROP_COL_DEFAULT                     = 0x0000001b,
    DBPROP_COL_DESCRIPTION                 = 0x0000001c,
    DBPROP_COL_NULLABLE                    = 0x0000001d,
    DBPROP_COL_PRIMARYKEY                  = 0x0000001e,
    DBPROP_COL_UNIQUE                      = 0x0000001f,
    DBPROP_COLUMNDEFINITION                = 0x00000020,
    DBPROP_COLUMNRESTRICT                  = 0x00000021,
    DBPROP_COMMANDTIMEOUT                  = 0x00000022,
    DBPROP_COMMITPRESERVE                  = 0x00000023,
    DBPROP_CONCATNULLBEHAVIOR              = 0x00000024,
    DBPROP_CURRENTCATALOG                  = 0x00000025,
    DBPROP_DATASOURCENAME                  = 0x00000026,
    DBPROP_DATASOURCEREADONLY              = 0x00000027,
    DBPROP_DBMSNAME                        = 0x00000028,
    DBPROP_DBMSVER                         = 0x00000029,
    DBPROP_DEFERRED                        = 0x0000002a,
    DBPROP_DELAYSTORAGEOBJECTS             = 0x0000002b,
    DBPROP_GROUPBY                         = 0x0000002c,
    DBPROP_HETEROGENEOUSTABLES             = 0x0000002d,
    DBPROP_IDENTIFIERCASE                  = 0x0000002e,
    DBPROP_IMMOBILEROWS                    = 0x0000002f,
    DBPROP_INDEX_AUTOUPDATE                = 0x00000030,
    DBPROP_INDEX_CLUSTERED                 = 0x00000031,
    DBPROP_INDEX_FILLFACTOR                = 0x00000032,
    DBPROP_INDEX_INITIALSIZE               = 0x00000033,
    DBPROP_INDEX_NULLCOLLATION             = 0x00000034,
    DBPROP_INDEX_NULLS                     = 0x00000035,
    DBPROP_INDEX_PRIMARYKEY                = 0x00000036,
    DBPROP_INDEX_SORTBOOKMARKS             = 0x00000037,
    DBPROP_INDEX_TYPE                      = 0x00000038,
    DBPROP_INDEX_UNIQUE                    = 0x00000039,
    DBPROP_INIT_DATASOURCE                 = 0x0000003b,
    DBPROP_INIT_HWND                       = 0x0000003c,
    DBPROP_INIT_IMPERSONATION_LEVEL        = 0x0000003d,
    DBPROP_INIT_LOCATION                   = 0x0000003e,
    DBPROP_INIT_MODE                       = 0x0000003f,
    DBPROP_INIT_PROMPT                     = 0x00000040,
    DBPROP_INIT_PROTECTION_LEVEL           = 0x00000041,
    DBPROP_INIT_TIMEOUT                    = 0x00000042,
    DBPROP_LITERALBOOKMARKS                = 0x00000043,
    DBPROP_LITERALIDENTITY                 = 0x00000044,
    DBPROP_MAXINDEXSIZE                    = 0x00000046,
    DBPROP_MAXOPENROWS                     = 0x00000047,
    DBPROP_MAXPENDINGROWS                  = 0x00000048,
    DBPROP_MAXROWS                         = 0x00000049,
    DBPROP_MAXROWSIZE                      = 0x0000004a,
    DBPROP_MAXROWSIZEINCLUDESBLOB          = 0x0000004b,
    DBPROP_MAXTABLESINSELECT               = 0x0000004c,
    DBPROP_MAYWRITECOLUMN                  = 0x0000004d,
    DBPROP_MEMORYUSAGE                     = 0x0000004e,
    DBPROP_MULTIPLESTORAGEOBJECTS          = 0x00000050,
    DBPROP_MULTITABLEUPDATE                = 0x00000051,
    DBPROP_NOTIFICATIONPHASES              = 0x00000052,
    DBPROP_NULLCOLLATION                   = 0x00000053,
    DBPROP_OLEOBJECTS                      = 0x00000054,
    DBPROP_ORDERBYCOLUMNSINSELECT          = 0x00000055,
    DBPROP_ORDEREDBOOKMARKS                = 0x00000056,
    DBPROP_OTHERINSERT                     = 0x00000057,
    DBPROP_OTHERUPDATEDELETE               = 0x00000058,
    DBPROP_OWNINSERT                       = 0x00000059,
    DBPROP_OWNUPDATEDELETE                 = 0x0000005a,
    DBPROP_PREPAREABORTBEHAVIOR            = 0x0000005b,
    DBPROP_PREPARECOMMITBEHAVIOR           = 0x0000005c,
    DBPROP_PROCEDURETERM                   = 0x0000005d,
    DBPROP_PROVIDERNAME                    = 0x00000060,
    DBPROP_PROVIDEROLEDBVER                = 0x00000061,
    DBPROP_PROVIDERVER                     = 0x00000062,
    DBPROP_QUICKRESTART                    = 0x00000063,
    DBPROP_QUOTEDIDENTIFIERCASE            = 0x00000064,
    DBPROP_REENTRANTEVENTS                 = 0x00000065,
    DBPROP_REMOVEDELETED                   = 0x00000066,
    DBPROP_REPORTMULTIPLECHANGES           = 0x00000067,
    DBPROP_ROWRESTRICT                     = 0x00000068,
    DBPROP_ROWTHREADMODEL                  = 0x00000069,
    DBPROP_SCHEMATERM                      = 0x0000006a,
    DBPROP_SCHEMAUSAGE                     = 0x0000006b,
    DBPROP_SERVERCURSOR                    = 0x0000006c,
    DBPROP_SQLSUPPORT                      = 0x0000006d,
    DBPROP_STRUCTUREDSTORAGE               = 0x0000006f,
    DBPROP_SUBQUERIES                      = 0x00000070,
    DBPROP_SUPPORTEDTXNISOLEVELS           = 0x00000071,
    DBPROP_SUPPORTEDTXNISORETAIN           = 0x00000072,
    DBPROP_TABLETERM                       = 0x00000073,
    DBPROP_TRANSACTEDOBJECT                = 0x00000074,
    DBPROP_UPDATABILITY                    = 0x00000075,
    DBPROP_USERNAME                        = 0x00000076,
    DBPROP_STRONGIDENTITY                  = 0x00000077,
    DBPROP_BYREFACCESSORS                  = 0x00000078,
    DBPROP_IAccessor                       = 0x00000079,
    DBPROP_IColumnsInfo                    = 0x0000007a,
    DBPROP_IColumnsRowset                  = 0x0000007b,
    DBPROP_IConnectionPointContainer       = 0x0000007c,
    DBPROP_IRowset                         = 0x0000007e,
    DBPROP_IRowsetChange                   = 0x0000007f,
    DBPROP_IRowsetIdentity                 = 0x00000080,
    DBPROP_IRowsetInfo                     = 0x00000081,
    DBPROP_IRowsetLocate                   = 0x00000082,
    DBPROP_IRowsetResynch                  = 0x00000084,
    DBPROP_IRowsetScroll                   = 0x00000085,
    DBPROP_IRowsetUpdate                   = 0x00000086,
    DBPROP_ISupportErrorInfo               = 0x00000087,
    DBPROP_ILockBytes                      = 0x00000088,
    DBPROP_ISequentialStream               = 0x00000089,
    DBPROP_IStorage                        = 0x0000008a,
    DBPROP_IStream                         = 0x0000008b,
    DBPROP_TBL_TEMPTABLE                   = 0x0000008c,
    DBPROP_IRowsetIndex                    = 0x0000009f,
    DBPROP_INIT_PROVIDERSTRING             = 0x000000a0,
    DBPROP_SUPPORTEDTXNDDL                 = 0x000000a1,
    DBPROP_INDEX_TEMPINDEX                 = 0x000000a3,
    DBPROP_COL_FIXEDLENGTH                 = 0x000000a7,
    DBPROP_ASYNCTXNABORT                   = 0x000000a8,
    DBPROP_DSOTHREADMODEL                  = 0x000000a9,
    DBPROP_NOTIFYCOLUMNSET                 = 0x000000ab,
    DBPROP_NOTIFYROWDELETE                 = 0x000000ad,
    DBPROP_NOTIFYROWFIRSTCHANGE            = 0x000000ae,
    DBPROP_NOTIFYROWINSERT                 = 0x000000af,
    DBPROP_NOTIFYROWRESYNCH                = 0x000000b1,
    DBPROP_NOTIFYROWSETRELEASE             = 0x000000b2,
    DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE = 0x000000b3,
    DBPROP_NOTIFYROWUNDOCHANGE             = 0x000000b4,
    DBPROP_NOTIFYROWUNDODELETE             = 0x000000b5,
    DBPROP_NOTIFYROWUNDOINSERT             = 0x000000b6,
    DBPROP_NOTIFYROWUPDATE                 = 0x000000b7,
    DBPROP_OUTPUTPARAMETERAVAILABILITY     = 0x000000b8,
    DBPROP_PERSISTENTIDTYPE                = 0x000000b9,
    DBPROP_INIT_LCID                       = 0x000000ba,
    DBPROP_APPENDONLY                      = 0x000000bb,
    DBPROP_CHANGEINSERTEDROWS              = 0x000000bc,
    DBPROP_RETURNPENDINGINSERTS            = 0x000000bd,
    DBPROP_SESS_AUTOCOMMITISOLEVELS        = 0x000000be,
    DBPROP_MULTIPLEPARAMSETS               = 0x000000bf,
    DBPROP_ROWSETCONVERSIONSONCOMMAND      = 0x000000c0,
    DBPROP_IConvertType                    = 0x000000c2,
    DBPROP_MULTIPLERESULTS                 = 0x000000c4,
    DBPROP_NOTIFICATIONGRANULARITY         = 0x000000c6,
    DBPROP_NOTIFYROWSETCHANGED             = 0x000000d3,
};

361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
enum DBPROPENUM15 {
    DBPROP_FILTERCOMPAREOPS                = 0x000000d1,
    DBPROP_FINDCOMPAREOPS                  = 0x000000d2,
    DBPROP_IChapteredRowset                = 0x000000ca,
    DBPROP_IDBAsynchStatus                 = 0x000000cb,
    DBPROP_IRowsetFind                     = 0x000000cc,
    DBPROP_IRowsetView                     = 0x000000d4,
    DBPROP_IViewChapter                    = 0x000000d5,
    DBPROP_IViewFilter                     = 0x000000d6,
    DBPROP_IViewRowset                     = 0x000000d7,
    DBPROP_IViewSort                       = 0x000000d8,
    DBPROP_INIT_ASYNCH                     = 0x000000c8,
    DBPROP_MAXOPENCHAPTERS                 = 0x000000c7,
    DBPROP_MAXORSINFILTER                  = 0x000000cd,
    DBPROP_MAXSORTCOLUMNS                  = 0x000000ce,
    DBPROP_ROWSET_ASYNCH                   = 0x000000c9,
    DBPROP_SORTONINDEX                     = 0x000000cf
};

enum DBPROPENUM20 {
    DBPROP_IMultipleResults                = 0x000000d9,
    DBPROP_DATASOURCE_TYPE                 = 0x000000fb,
    MDPROP_AXES                            = 0x000000fc,
    MDPROP_FLATTENING_SUPPORT              = 0x000000fd,
    MDPROP_MDX_JOINCUBES                   = 0x000000fe,
    MDPROP_NAMED_LEVELS                    = 0x000000ff,
    MDPROP_RANGEROWSET                     = 0x00000100,
    MDPROP_MDX_SLICER                      = 0x000000da,
    MDPROP_MDX_CUBEQUALIFICATION           = 0x000000db,
    MDPROP_MDX_OUTERREFERENCE              = 0x000000dc,
    MDPROP_MDX_QUERYBYPROPERTY             = 0x000000dd,
    MDPROP_MDX_CASESUPPORT                 = 0x000000de,
    MDPROP_MDX_STRING_COMPOP               = 0x000000e0,
    MDPROP_MDX_DESCFLAGS                   = 0x000000e1,
    MDPROP_MDX_SET_FUNCTIONS               = 0x000000e2,
    MDPROP_MDX_MEMBER_FUNCTIONS            = 0x000000e3,
    MDPROP_MDX_NUMERIC_FUNCTIONS           = 0x000000e4,
    MDPROP_MDX_FORMULAS                    = 0x000000e5,
    MDPROP_AGGREGATECELL_UPDATE            = 0x000000e6,
    MDPROP_MDX_AGGREGATECELL_UPDATE        = MDPROP_AGGREGATECELL_UPDATE,
    MDPROP_MDX_OBJQUALIFICATION            = 0x00000105,
    MDPROP_MDX_NONMEASURE_EXPRESSIONS      = 0x00000106,
    DBPROP_ACCESSORDER                     = 0x000000e7,
    DBPROP_BOOKMARKINFO                    = 0x000000e8,
    DBPROP_INIT_CATALOG                    = 0x000000e9,
    DBPROP_ROW_BULKOPS                     = 0x000000ea,
    DBPROP_PROVIDERFRIENDLYNAME            = 0x000000eb,
    DBPROP_LOCKMODE                        = 0x000000ec,
    DBPROP_MULTIPLECONNECTIONS             = 0x000000ed,
    DBPROP_UNIQUEROWS                      = 0x000000ee,
    DBPROP_SERVERDATAONINSERT              = 0x000000ef,
    DBPROP_STORAGEFLAGS                    = 0x000000f0,
    DBPROP_CONNECTIONSTATUS                = 0x000000f4,
    DBPROP_ALTERCOLUMN                     = 0x000000f5,
    DBPROP_COLUMNLCID                      = 0x000000f6,
    DBPROP_RESETDATASOURCE                 = 0x000000f7,
    DBPROP_INIT_OLEDBSERVICES              = 0x000000f8,
    DBPROP_IRowsetRefresh                  = 0x000000f9,
    DBPROP_SERVERNAME                      = 0x000000fa,
    DBPROP_IParentRowset                   = 0x00000101,
    DBPROP_HIDDENCOLUMNS                   = 0x00000102,
    DBPROP_PROVIDERMEMORY                  = 0x00000103,
    DBPROP_CLIENTCURSOR                    = 0x00000104
};


enum DBPROPENUM21 {
    DBPROP_TRUSTEE_USERNAME                = 0x000000f1,
    DBPROP_TRUSTEE_AUTHENTICATION          = 0x000000f2,
    DBPROP_TRUSTEE_NEWAUTHENTICATION       = 0x000000f3,
    DBPROP_IRow                            = 0x00000107,
    DBPROP_IRowChange                      = 0x00000108,
    DBPROP_IRowSchemaChange                = 0x00000109,
    DBPROP_IGetRow                         = 0x0000010a,
    DBPROP_IScopedOperations               = 0x0000010b,
    DBPROP_IBindResource                   = 0x0000010c,
    DBPROP_ICreateRow                      = 0x0000010d,
    DBPROP_INIT_BINDFLAGS                  = 0x0000010e,
    DBPROP_INIT_LOCKOWNER                  = 0x0000010f,
    DBPROP_GENERATEURL                     = 0x00000111,
    DBPROP_IDBBinderProperties             = 0x00000112,
    DBPROP_IColumnsInfo2                   = 0x00000113,
    DBPROP_IRegisterProvider               = 0x00000114,
    DBPROP_IGetSession                     = 0x00000115,
    DBPROP_IGetSourceRow                   = 0x00000116,
    DBPROP_IRowsetCurrentIndex             = 0x00000117,
    DBPROP_OPENROWSETSUPPORT               = 0x00000118,
    DBPROP_COL_ISLONG                      = 0x00000119
};

enum DBPROPENUM25 {
    DBPROP_COL_SEED                        = 0x0000011a,
    DBPROP_COL_INCREMENT                   = 0x0000011b,
    DBPROP_INIT_GENERALTIMEOUT             = 0x0000011c,
    DBPROP_COMSERVICES                     = 0x0000011d
};

enum DBPROPENUM26 {
    DBPROP_OUTPUTSTREAM                    = 0x0000011e,
    DBPROP_OUTPUTENCODING                  = 0x0000011f,
    DBPROP_TABLESTATISTICS                 = 0x00000120,
    DBPROP_SKIPROWCOUNTRESULTS             = 0x00000123,
    DBPROP_IRowsetBookmark                 = 0x00000124,
    MDPROP_VISUALMODE                      = 0x00000125,
};

467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
cpp_quote("#ifdef DBINITCONSTANTS")
cpp_quote("#ifdef __cplusplus")
cpp_quote("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
cpp_quote("        EXTERN_C const GUID name DECLSPEC_HIDDEN;     \\")
cpp_quote("        EXTERN_C const GUID name =                    \\")
cpp_quote("	{ l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }")
cpp_quote("#else")
cpp_quote("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
cpp_quote("        const GUID name DECLSPEC_HIDDEN;      \\")
cpp_quote("        const GUID name =                             \\")
cpp_quote("	{ l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }")
cpp_quote("#endif")
cpp_quote("#else")
cpp_quote("#define DEFINE_DBGUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\")
cpp_quote("    EXTERN_C const GUID name DECLSPEC_HIDDEN")
cpp_quote("#endif")

484 485
cpp_quote("DEFINE_DBGUID(DB_NULLGUID,       0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);")
cpp_quote("DEFINE_DBGUID(DBPROPSET_DBINIT,  0xc8b522bc, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
486 487 488 489
cpp_quote("DEFINE_DBGUID(DBGUID_SESSION,    0xc8b522f5, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_ROWSET,     0xc8b522f6, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_ROW,        0xc8b522f7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_STREAM,     0xc8b522f9, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
Huw Davies's avatar
Huw Davies committed
490

491 492 493 494 495
cpp_quote("#define DBPROMPT_PROMPT              0x01")
cpp_quote("#define DBPROMPT_COMPLETE            0x02")
cpp_quote("#define DBPROMPT_COMPLETEREQUIRED    0x03")
cpp_quote("#define DBPROMPT_NOPROMPT            0x04")

496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
cpp_quote("#define DBPROPVAL_STGM_READ                 OF_READ")
cpp_quote("#define DBPROPVAL_STGM_WRITE                OF_WRITE")
cpp_quote("#define DBPROPVAL_STGM_READWRITE            OF_READWRITE")
cpp_quote("#define DBPROPVAL_STGM_SHARE_DENY_NONE      OF_SHARE_DENY_NONE")
cpp_quote("#define DBPROPVAL_STGM_SHARE_DENY_READ      OF_SHARE_DENY_READ")
cpp_quote("#define DBPROPVAL_STGM_SHARE_DENY_WRITE     OF_SHARE_DENY_WRITE)")
cpp_quote("#define DBPROPVAL_STGM_SHARE_EXCLUSIVE      OF_SHARE_EXCLUSIVE")
cpp_quote("#define DBPROPVAL_STGM_DIRECT               0x00010000")
cpp_quote("#define DBPROPVAL_STGM_TRANSACTED           0x00020000")
cpp_quote("#define DBPROPVAL_STGM_CREATE               OF_CREATE")
cpp_quote("#define DBPROPVAL_STGM_CONVERT              0x00040000")
cpp_quote("#define DBPROPVAL_STGM_FAILIFTHERE          0x00080000")
cpp_quote("#define DBPROPVAL_STGM_PRIORITY             0x00100000")
cpp_quote("#define DBPROPVAL_STGM_DELETEONRELEASE      0x00200000")
cpp_quote("#define DBPROPVAL_GB_COLLATE                __MSABI_LONG(0x00000010)")
cpp_quote("#define DBPROPVAL_CS_UNINITIALIZED          __MSABI_LONG(0x00000000)")
cpp_quote("#define DBPROPVAL_CS_INITIALIZED            __MSABI_LONG(0x00000001)")
cpp_quote("#define DBPROPVAL_CS_COMMUNICATIONFAILURE   __MSABI_LONG(0x00000002)")

cpp_quote("#define DBPROPVAL_RD_RESETALL               __MSABI_LONG(0xffffffff)")
cpp_quote("#define DBPROPVAL_OS_RESOURCEPOOLING        __MSABI_LONG(0x00000001)")
cpp_quote("#define DBPROPVAL_OS_TXNENLISTMENT          __MSABI_LONG(0x00000002)")
cpp_quote("#define DBPROPVAL_OS_CLIENTCURSOR           __MSABI_LONG(0x00000004)")
cpp_quote("#define DBPROPVAL_OS_ENABLEALL              __MSABI_LONG(0xffffffff)")
cpp_quote("#define DBPROPVAL_BI_CROSSROWSET            __MSABI_LONG(0x00000001)")

522 523 524 525 526 527 528
cpp_quote("#define DB_MODE_READ                        0x01")
cpp_quote("#define DB_MODE_WRITE                       0x02")
cpp_quote("#define DB_MODE_READWRITE                   0x03")
cpp_quote("#define DB_MODE_SHARE_DENY_READ             0x04")
cpp_quote("#define DB_MODE_SHARE_DENY_WRITE            0x08")
cpp_quote("#define DB_MODE_SHARE_EXCLUSIVE             0x0c")
cpp_quote("#define DB_MODE_SHARE_DENY_NONE             0x10")
529

530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
typedef struct tagDBCOLUMNACCESS
{
    void *pData;
    DBID columnid;
    DBLENGTH cbDataLen;
    DBSTATUS dwStatus;
    DBLENGTH cbMaxLen;
    DB_DWRESERVE dwReserved;
    DBTYPE wType;
    BYTE bPrecision;
    BYTE bScale;
} DBCOLUMNACCESS;

typedef DWORD DBROWSTATUS;

enum DBROWSTATUSENUM
{
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
    DBROWSTATUS_S_OK,
    DBROWSTATUS_S_LOCKUPGRADED,
    DBROWSTATUS_S_MULTIPLECHANGES,
    DBROWSTATUS_S_PENDINGCHANGES,
    DBROWSTATUS_E_CANCELED,
    DBROWSTATUS_E_CANTLOCKROW,
    DBROWSTATUS_E_CANTRELEASE,
    DBROWSTATUS_E_CONCURRENCYVIOLATION,
    DBROWSTATUS_E_DELETED,
    DBROWSTATUS_E_PENDINGINSERT,
    DBROWSTATUS_E_NEWLYINSERTED,
    DBROWSTATUS_E_INTEGRITYVIOLATION,
    DBROWSTATUS_E_INVALID,
    DBROWSTATUS_E_MAXPENDCHANGESEXCEEDED,
    DBROWSTATUS_E_OBJECTOPEN,
    DBROWSTATUS_E_OUTOFMEMORY,
    DBROWSTATUS_E_PERMISSIONDENIED,
    DBROWSTATUS_E_LIMITREACHED,
    DBROWSTATUS_E_SCHEMAVIOLATION,
    DBROWSTATUS_E_FAIL,
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650

};

typedef DWORD DBPART;

enum DBPARTENUM
{
    DBPART_INVALID  = 0,
    DBPART_VALUE    = 1,
    DBPART_LENGTH   = 2,
    DBPART_STATUS   = 4,
};

typedef DWORD DBPARAMIO;

enum DBPARAMIOENUM
{
    DBPARAMIO_NOTPARAM = 0,
    DBPARAMIO_INPUT    = 1,
    DBPARAMIO_OUTPUT   = 2,
};

typedef DWORD DBMEMOWNER;

enum DBMEMOWNERENUM
{
    DBMEMOWNER_CLIENTOWNED    = 0,
    DBMEMOWNER_PROVIDEROWNED  = 1,
};

typedef struct tagDBOBJECT
{
    DWORD dwFlags;
    IID iid;
} DBOBJECT;

typedef struct tagDBBINDEXT
{
    [size_is((ULONG)ulExtension)] BYTE *pExtension;
    DBCOUNTITEM ulExtension;
} DBBINDEXT;

typedef struct tagDBBINDING
{
    DBORDINAL iOrdinal;
    DBBYTEOFFSET obValue;
    DBBYTEOFFSET obLength;
    DBBYTEOFFSET obStatus;
    ITypeInfo *pTypeInfo;
    DBOBJECT *pObject;
    DBBINDEXT *pBindExt;
    DBPART dwPart;
    DBMEMOWNER dwMemOwner;
    DBPARAMIO eParamIO;
    DBLENGTH cbMaxLen;
    DWORD dwFlags;
    DBTYPE wType;
    BYTE bPrecision;
    BYTE bScale;
} DBBINDING;

typedef ULONG_PTR HACCESSOR;

cpp_quote("#define DB_INVALID_HACCESSOR 0x00")

typedef ULONG_PTR HROW;

cpp_quote("#define DB_NULL_HROW 0x00")

typedef ULONG_PTR HWATCHREGION;

cpp_quote("#define DBWATCHREGION_NULL NULL")

typedef ULONG_PTR HCHAPTER;

cpp_quote("#define DB_NULL_HCHAPTER 0x00")

typedef struct tagDBPARAMS
{
    void *pData;
    DB_UPARAMS cParamSets;
    HACCESSOR hAccessor;
} DBPARAMS;

Huw Davies's avatar
Huw Davies committed
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667
typedef DWORD DBASYNCHOP;

enum DBASYNCHOPENUM
{
    DBSYNCHOP_OPEN,
};

typedef DWORD DBASYNCHPHASE;

enum DBASYNCHPHASEENUM
{
    DBASYNCHPHASE_INITIALIZATION,
    DBASYNCHPHASE_POPULATION,
    DBASYNCHPHASE_COMPLETE,
    DBASYNCHPHASE_CANCELED,
};

668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684
typedef struct tagRMTPACK
{
    ISequentialStream *pISeqStream;
    ULONG cbData;
    ULONG cBSTR;
    [size_is(cBSTR)] BSTR *rgBSTR;
    ULONG cVARIANT;
    [size_is(cVARIANT)] VARIANT *rgVARIANT;
    ULONG cIDISPATCH;
    [size_is(cIDISPATCH)] IDispatch **rgIDISPATCH;
    ULONG cIUNKNOWN;
    [size_is(cIUNKNOWN)] IUnknown **rgIUNKNOWN;
    ULONG cPROPVARIANT;
    [size_is(cPROPVARIANT)] PROPVARIANT *rgPROPVARIANT;
    ULONG cArray;
    [size_is(cArray)] VARIANT *rgArray;
} RMTPACK;
685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706

typedef struct tagDBDATE {
	SHORT year;
	USHORT month;
	USHORT day;
} DBDATE;

typedef struct tagDBTIME {
	USHORT hour;
	USHORT minute;
	USHORT second;
} DBTIME;

typedef struct tagDBTIMESTAMP {
	SHORT year;
	USHORT month;
	USHORT day;
	USHORT hour;
	USHORT minute;
	USHORT second;
	ULONG fraction;
} DBTIMESTAMP;
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742

typedef DWORD DBREASON;
typedef DWORD DBEVENTPHASE;

enum DBEVENTPHASEENUM {
    DBEVENTPHASE_OKTODO,
    DBEVENTPHASE_ABOUTTODO,
    DBEVENTPHASE_SYNCHAFTER,
    DBEVENTPHASE_FAILEDTODO,
    DBEVENTPHASE_DIDEVENT
};

enum DBREASONENUM {
    DBREASON_ROWSET_FETCHPOSITIONCHANGE,
    DBREASON_ROWSET_RELEASE,
    DBREASON_COLUMN_SET,
    DBREASON_COLUMN_RECALCULATED,
    DBREASON_ROW_ACTIVATE,
    DBREASON_ROW_RELEASE,
    DBREASON_ROW_DELETE,
    DBREASON_ROW_FIRSTCHANCE,
    DBREASON_ROW_INSERT,
    DBREASON_ROW_RESYNCH,
    DBREASON_ROW_UNDOCHANGE,
    DBREASON_ROW_UNDOINSERT,
    DBREASON_ROW_UNDODELETE,
    DBREASON_ROW_UPDATE,
    DBREASON_ROWSET_CHANGED
};

enum DBREASONENUM15 {
    DBREASON_ROWPOSITION_CHANGED = DBREASON_ROWSET_CHANGED + 1,
    DBREASON_ROWPOSITION_CHAPTERCHANGED,
    DBREASON_ROWPOSITION_CLEARED,
    DBREASON_ROW_ASYNCHINSERT
};
743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770

typedef DWORD DBCOLUMNFLAGS;

enum DBCOLUMNFLAGSENUM {
    DBCOLUMNFLAGS_ISBOOKMARK    = 0x0001,
    DBCOLUMNFLAGS_MAYDEFER      = 0x0002,
    DBCOLUMNFLAGS_WRITE         = 0x0004,
    DBCOLUMNFLAGS_WRITEUNKNOWN  = 0x0008,
    DBCOLUMNFLAGS_ISFIXEDLENGTH = 0x0010,
    DBCOLUMNFLAGS_ISNULLABLE    = 0x0020,
    DBCOLUMNFLAGS_MAYBENULL     = 0x0040,
    DBCOLUMNFLAGS_ISLONG        = 0x0080,
    DBCOLUMNFLAGS_ISROWID       = 0x0100,
    DBCOLUMNFLAGS_ISROWVER      = 0x0200,
    DBCOLUMNFLAGS_CACHEDEFERRED = 0x1000
};

typedef struct tagDBCOLUMNINFO {
    LPOLESTR      pwszName;
    ITypeInfo    *pTypeInfo;
    DBORDINAL     iOrdinal;
    DBCOLUMNFLAGS dwFlags;
    DBLENGTH      ulColumnSize;
    DBTYPE        wType;
    BYTE          bPrecision;
    BYTE          bScale;
    DBID          columnid;
} DBCOLUMNINFO;