Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2977 lines
130 KiB

  1. #if _MSC_VER > 1000
  2. #pragma once
  3. #endif
  4. #define eseVersion 0x5600
  5. // HISTORY:
  6. // 0x5500 - ESE97 (Exchange 5.5)
  7. // 0x5580 - ESENT97 (W2k)
  8. // 0x5600 - ESENT98 (Whistler)
  9. // 0x6000 - ESE98 (Exchange 2000)
  10. #if !defined(_JET_INCLUDED)
  11. #define _JET_INCLUDED
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define JET_cbPage 4096 // UNDONE: Remove when no more components reference this.
  16. #if defined(_M_AMD64) || defined(_M_IA64)
  17. #include <pshpack8.h>
  18. #else
  19. #include <pshpack4.h>
  20. #endif
  21. #pragma warning(push)
  22. #pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
  23. #define JET_API __stdcall
  24. #define JET_NODSAPI __stdcall
  25. #ifdef _WIN64
  26. typedef unsigned __int64 JET_API_PTR;
  27. #else
  28. typedef unsigned long JET_API_PTR;
  29. #endif
  30. typedef long JET_ERR;
  31. typedef JET_API_PTR JET_HANDLE; /* backup file handle */
  32. typedef JET_API_PTR JET_INSTANCE; /* Instance Identifier */
  33. typedef JET_API_PTR JET_SESID; /* Session Identifier */
  34. typedef JET_API_PTR JET_TABLEID; /* Table Identifier */
  35. typedef JET_API_PTR JET_LS; /* Local Storage */
  36. typedef unsigned long JET_COLUMNID; /* Column Identifier */
  37. typedef struct tagJET_INDEXID
  38. {
  39. unsigned long cbStruct;
  40. unsigned char rgbIndexId[sizeof(JET_API_PTR)+sizeof(unsigned long)+sizeof(unsigned long)];
  41. } JET_INDEXID;
  42. typedef unsigned long JET_DBID; /* Database Identifier */
  43. typedef unsigned long JET_OBJTYP; /* Object Type */
  44. typedef unsigned long JET_COLTYP; /* Column Type */
  45. typedef unsigned long JET_GRBIT; /* Group of Bits */
  46. typedef unsigned long JET_SNP; /* Status Notification Process */
  47. typedef unsigned long JET_SNT; /* Status Notification Type */
  48. typedef unsigned long JET_SNC; /* Status Notification Code */
  49. typedef double JET_DATESERIAL; /* JET_coltypDateTime format */
  50. typedef unsigned long JET_DLLID; /* ID of DLL for hook functions */
  51. typedef unsigned long JET_CBTYP; /* Callback Types */
  52. typedef JET_ERR (__stdcall *JET_PFNSTATUS)(JET_SESID sesid, JET_SNP snp, JET_SNT snt, void *pv);
  53. /* required for Exchange to make RSTMAP RPC capable
  54. /**/
  55. #ifdef MIDL_PASS
  56. #define xRPC_STRING [string]
  57. #else
  58. #define xRPC_STRING
  59. #if !defined(_NATIVE_WCHAR_T_DEFINED)
  60. typedef unsigned short WCHAR;
  61. #else
  62. typedef wchar_t WCHAR;
  63. #endif
  64. #endif
  65. typedef struct
  66. {
  67. xRPC_STRING char *szDatabaseName;
  68. xRPC_STRING char *szNewDatabaseName;
  69. } JET_RSTMAP; /* restore map */
  70. /* required for Exchange unicode support
  71. /**/
  72. #define UNICODE_RSTMAP
  73. typedef struct tagJET_RSTMAPW {
  74. xRPC_STRING WCHAR *wszDatabaseName;
  75. xRPC_STRING WCHAR *wszNewDatabaseName;
  76. } JET_RSTMAPW, *PJET_RSTMAPW;
  77. // For edbutil convert only.
  78. typedef struct tagCONVERT
  79. {
  80. char *szOldDll;
  81. union
  82. {
  83. unsigned long fFlags;
  84. struct
  85. {
  86. unsigned long fSchemaChangesOnly:1;
  87. };
  88. };
  89. } JET_CONVERT;
  90. typedef enum
  91. {
  92. // Database operations
  93. opDBUTILConsistency,
  94. opDBUTILDumpData,
  95. opDBUTILDumpMetaData,
  96. opDBUTILDumpPage,
  97. opDBUTILDumpNode,
  98. opDBUTILDumpSpace,
  99. opDBUTILSetHeaderState,
  100. opDBUTILDumpHeader,
  101. opDBUTILDumpLogfile,
  102. opDBUTILDumpLogfileTrackNode,
  103. opDBUTILDumpCheckpoint,
  104. opDBUTILEDBDump,
  105. opDBUTILEDBRepair,
  106. opDBUTILMunge,
  107. opDBUTILEDBScrub,
  108. opDBUTILSLVMove,
  109. opDBUTILDBConvertRecords,
  110. opDBUTILDBDefragment,
  111. opDBUTILDumpExchangeSLVInfo,
  112. opDBUTILDumpUnicodeFixupTable,
  113. } DBUTIL_OP;
  114. typedef enum
  115. {
  116. opEDBDumpTables,
  117. opEDBDumpIndexes,
  118. opEDBDumpColumns,
  119. opEDBDumpCallbacks,
  120. opEDBDumpPage,
  121. } EDBDUMP_OP;
  122. typedef struct tagDBUTIL
  123. {
  124. unsigned long cbStruct;
  125. JET_SESID sesid;
  126. JET_DBID dbid;
  127. JET_TABLEID tableid;
  128. DBUTIL_OP op;
  129. EDBDUMP_OP edbdump;
  130. JET_GRBIT grbitOptions;
  131. char *szDatabase;
  132. char *szSLV;
  133. char *szBackup;
  134. char *szTable;
  135. char *szIndex;
  136. char *szIntegPrefix;
  137. long pgno;
  138. long iline;
  139. long lGeneration;
  140. long isec;
  141. long ib;
  142. long cRetry;
  143. void * pfnCallback;
  144. void * pvCallback;
  145. } JET_DBUTIL;
  146. #define JET_bitDBUtilOptionAllNodes 0x00000001
  147. #define JET_bitDBUtilOptionKeyStats 0x00000002
  148. #define JET_bitDBUtilOptionPageDump 0x00000004
  149. #define JET_bitDBUtilOptionDumpVerbose 0x10000000 // DEBUG only
  150. #define JET_bitDBUtilOptionCheckBTree 0x20000000 // DEBUG only
  151. #define JET_bitDBUtilOptionStats 0x00000008
  152. #define JET_bitDBUtilOptionVerbose 0x00000010
  153. #define JET_bitDBUtilOptionIgnoreErrors 0x00000020
  154. #define JET_bitDBUtilOptionVerify 0x00000040
  155. #define JET_bitDBUtilOptionReportErrors 0x00000080
  156. #define JET_bitDBUtilOptionDontRepair 0x00000100
  157. #define JET_bitDBUtilOptionRepairAll 0x00000200
  158. #define JET_bitDBUtilOptionRepairIndexes 0x00000400
  159. #define JET_bitDBUtilOptionDontBuildIndexes 0x00000800
  160. // Online defragmentation options
  161. #define JET_bitDefragmentBatchStart 0x00000001
  162. #define JET_bitDefragmentBatchStop 0x00000002
  163. #define JET_bitDefragmentTest 0x00000004 /* run internal tests (non-RTM builds only) */
  164. #define JET_bitDefragmentSLVBatchStart 0x00000008
  165. #define JET_bitDefragmentSLVBatchStop 0x00000010
  166. #define JET_bitDefragmentScrubSLV 0x00000020 /* syncronously zero free pages in the streaming file */
  167. #define JET_bitDefragmentAvailSpaceTreesOnly 0x00000040 /* only defrag AvailExt trees */
  168. /* Callback-function types */
  169. #define JET_cbtypNull 0x00000000
  170. #define JET_cbtypFinalize 0x00000001 /* a finalizable column has gone to zero */
  171. #define JET_cbtypBeforeInsert 0x00000002 /* about to insert a record */
  172. #define JET_cbtypAfterInsert 0x00000004 /* finished inserting a record */
  173. #define JET_cbtypBeforeReplace 0x00000008 /* about to modify a record */
  174. #define JET_cbtypAfterReplace 0x00000010 /* finished modifying a record */
  175. #define JET_cbtypBeforeDelete 0x00000020 /* about to delete a record */
  176. #define JET_cbtypAfterDelete 0x00000040 /* finished deleting the record */
  177. #define JET_cbtypUserDefinedDefaultValue 0x00000080 /* calculating a user-defined default */
  178. #define JET_cbtypOnlineDefragCompleted 0x00000100 /* a call to JetDefragment2 has completed */
  179. #define JET_cbtypFreeCursorLS 0x00000200 /* the Local Storage associated with a cursor must be freed */
  180. #define JET_cbtypFreeTableLS 0x00000400 /* the Local Storage associated with a table must be freed */
  181. #define JET_cbtypDTCQueryPreparedTransaction 0x00001000 /* recovery is attempting to resolve a PreparedToCommit transaction */
  182. #define JET_cbtypOnlineDefragProgress 0x00002000 /* online defragmentation has made progress */
  183. /* Callback-function prototype */
  184. typedef JET_ERR (__stdcall *JET_CALLBACK)(
  185. JET_SESID sesid,
  186. JET_DBID dbid,
  187. JET_TABLEID tableid,
  188. JET_CBTYP cbtyp,
  189. void * pvArg1,
  190. void * pvArg2,
  191. void * pvContext,
  192. JET_API_PTR ulUnused );
  193. /* Session information bits */
  194. #define JET_bitCIMCommitted 0x00000001
  195. #define JET_bitCIMDirty 0x00000002
  196. #define JET_bitAggregateTransaction 0x00000008
  197. /* Status Notification Structures */
  198. typedef struct /* Status Notification Progress */
  199. {
  200. unsigned long cbStruct; /* Size of this structure */
  201. unsigned long cunitDone; /* Number of units of work completed */
  202. unsigned long cunitTotal; /* Total number of units of work */
  203. } JET_SNPROG;
  204. typedef struct /* Status Notification Message */
  205. {
  206. unsigned long cbStruct; /* Size of this structure */
  207. JET_SNC snc; /* Status Notification Code */
  208. unsigned long ul; /* Numeric identifier */
  209. char sz[256]; /* Identifier */
  210. } JET_SNMSG;
  211. typedef struct
  212. {
  213. unsigned long cbStruct;
  214. unsigned long cbFilesizeLow; // file's current size (low DWORD)
  215. unsigned long cbFilesizeHigh; // file's current size (high DWORD)
  216. unsigned long cbFreeSpaceRequiredLow; // estimate of free disk space required for in-place upgrade (low DWORD)
  217. unsigned long cbFreeSpaceRequiredHigh;// estimate of free disk space required for in-place upgrade (high DWORD)
  218. unsigned long csecToUpgrade; // estimate of time required, in seconds, for upgrade
  219. union
  220. {
  221. unsigned long ulFlags;
  222. struct
  223. {
  224. unsigned long fUpgradable:1;
  225. unsigned long fAlreadyUpgraded:1;
  226. };
  227. };
  228. } JET_DBINFOUPGRADE;
  229. typedef struct
  230. {
  231. unsigned long cbStruct;
  232. JET_OBJTYP objtyp;
  233. JET_DATESERIAL dtCreate; // XXX -- to be deleted
  234. JET_DATESERIAL dtUpdate; // XXX -- to be deleted
  235. JET_GRBIT grbit;
  236. unsigned long flags;
  237. unsigned long cRecord;
  238. unsigned long cPage;
  239. } JET_OBJECTINFO;
  240. /* The following flags appear in the grbit field above */
  241. #define JET_bitTableInfoUpdatable 0x00000001
  242. #define JET_bitTableInfoBookmark 0x00000002
  243. #define JET_bitTableInfoRollback 0x00000004
  244. #define JET_bitTableSequential 0x00008000
  245. /* The following flags occur in the flags field above */
  246. #define JET_bitObjectSystem 0x80000000 // Internal use only
  247. #define JET_bitObjectTableFixedDDL 0x40000000 // Table's DDL is fixed
  248. #define JET_bitObjectTableTemplate 0x20000000 // Table's DDL is inheritable (implies FixedDDL)
  249. #define JET_bitObjectTableDerived 0x10000000 // Table's DDL is inherited from a template table
  250. #define JET_bitObjectSystemDynamic (JET_bitObjectSystem|0x08000000) // Internal use only (dynamic system objects)
  251. #define JET_bitObjectTableNoFixedVarColumnsInDerivedTables 0x04000000 // used in conjunction with JET_bitObjectTableTemplate
  252. // to disallow fixed/var columns in derived tables (so that
  253. // fixed/var columns may be added to the template in the future)
  254. typedef struct
  255. {
  256. unsigned long cbStruct;
  257. JET_TABLEID tableid;
  258. unsigned long cRecord;
  259. JET_COLUMNID columnidcontainername;
  260. JET_COLUMNID columnidobjectname;
  261. JET_COLUMNID columnidobjtyp;
  262. JET_COLUMNID columniddtCreate; // XXX -- to be deleted
  263. JET_COLUMNID columniddtUpdate; // XXX -- to be deleted
  264. JET_COLUMNID columnidgrbit;
  265. JET_COLUMNID columnidflags;
  266. JET_COLUMNID columnidcRecord; /* Level 2 info */
  267. JET_COLUMNID columnidcPage; /* Level 2 info */
  268. } JET_OBJECTLIST;
  269. #define cObjectInfoCols 9
  270. typedef struct
  271. {
  272. unsigned long cbStruct;
  273. JET_TABLEID tableid;
  274. unsigned long cRecord;
  275. JET_COLUMNID columnidPresentationOrder;
  276. JET_COLUMNID columnidcolumnname;
  277. JET_COLUMNID columnidcolumnid;
  278. JET_COLUMNID columnidcoltyp;
  279. JET_COLUMNID columnidCountry;
  280. JET_COLUMNID columnidLangid;
  281. JET_COLUMNID columnidCp;
  282. JET_COLUMNID columnidCollate;
  283. JET_COLUMNID columnidcbMax;
  284. JET_COLUMNID columnidgrbit;
  285. JET_COLUMNID columnidDefault;
  286. JET_COLUMNID columnidBaseTableName;
  287. JET_COLUMNID columnidBaseColumnName;
  288. JET_COLUMNID columnidDefinitionName;
  289. } JET_COLUMNLIST;
  290. #define cColumnInfoCols 14
  291. typedef struct
  292. {
  293. unsigned long cbStruct;
  294. JET_COLUMNID columnid;
  295. JET_COLTYP coltyp;
  296. unsigned short wCountry;
  297. unsigned short langid;
  298. unsigned short cp;
  299. unsigned short wCollate; /* Must be 0 */
  300. unsigned long cbMax;
  301. JET_GRBIT grbit;
  302. } JET_COLUMNDEF;
  303. typedef struct
  304. {
  305. unsigned long cbStruct;
  306. JET_COLUMNID columnid;
  307. JET_COLTYP coltyp;
  308. unsigned short wCountry;
  309. unsigned short langid;
  310. unsigned short cp;
  311. unsigned short wFiller; /* Must be 0 */
  312. unsigned long cbMax;
  313. JET_GRBIT grbit;
  314. char szBaseTableName[256];
  315. char szBaseColumnName[256];
  316. } JET_COLUMNBASE;
  317. typedef struct
  318. {
  319. unsigned long cbStruct;
  320. JET_TABLEID tableid;
  321. unsigned long cRecord;
  322. JET_COLUMNID columnidindexname;
  323. JET_COLUMNID columnidgrbitIndex;
  324. JET_COLUMNID columnidcKey;
  325. JET_COLUMNID columnidcEntry;
  326. JET_COLUMNID columnidcPage;
  327. JET_COLUMNID columnidcColumn;
  328. JET_COLUMNID columnidiColumn;
  329. JET_COLUMNID columnidcolumnid;
  330. JET_COLUMNID columnidcoltyp;
  331. JET_COLUMNID columnidCountry;
  332. JET_COLUMNID columnidLangid;
  333. JET_COLUMNID columnidCp;
  334. JET_COLUMNID columnidCollate;
  335. JET_COLUMNID columnidgrbitColumn;
  336. JET_COLUMNID columnidcolumnname;
  337. JET_COLUMNID columnidLCMapFlags;
  338. } JET_INDEXLIST;
  339. #define cIndexInfoCols 15
  340. typedef struct tag_JET_COLUMNCREATE
  341. {
  342. unsigned long cbStruct; // size of this structure (for future expansion)
  343. char *szColumnName; // column name
  344. JET_COLTYP coltyp; // column type
  345. unsigned long cbMax; // the maximum length of this column (only relevant for binary and text columns)
  346. JET_GRBIT grbit; // column options
  347. void *pvDefault; // default value (NULL if none)
  348. unsigned long cbDefault; // length of default value
  349. unsigned long cp; // code page (for text columns only)
  350. JET_COLUMNID columnid; // returned column id
  351. JET_ERR err; // returned error code
  352. } JET_COLUMNCREATE;
  353. // This is the information needed to create a column with a user-defined default. It should be passed in using
  354. // the pvDefault and cbDefault in a JET_COLUMNCREATE structure
  355. typedef struct tag_JET_USERDEFINEDDEFAULT
  356. {
  357. char * szCallback;
  358. unsigned char * pbUserData;
  359. unsigned long cbUserData;
  360. char * szDependantColumns;
  361. } JET_USERDEFINEDDEFAULT;
  362. typedef struct tagJET_INDEXCREATEOLD // [4/15/97]: to be phased out eventually (laurionb)
  363. {
  364. unsigned long cbStruct; // size of this structure (for future expansion)
  365. char *szIndexName; // index name
  366. char *szKey; // index key
  367. unsigned long cbKey; // length of key
  368. JET_GRBIT grbit; // index options
  369. unsigned long ulDensity; // index density
  370. JET_ERR err; // returned error code
  371. } JET_INDEXCREATEOLD;
  372. typedef struct tagJET_CONDITIONALCOLUMN
  373. {
  374. unsigned long cbStruct; // size of this structure (for future expansion)
  375. char *szColumnName; // column that we are conditionally indexed on
  376. JET_GRBIT grbit; // conditional column options
  377. } JET_CONDITIONALCOLUMN;
  378. typedef struct tagJET_UNICODEINDEX
  379. {
  380. unsigned long lcid;
  381. unsigned long dwMapFlags;
  382. } JET_UNICODEINDEX;
  383. typedef struct tagJET_TUPLELIMITS
  384. {
  385. unsigned long chLengthMin;
  386. unsigned long chLengthMax;
  387. unsigned long chToIndexMax;
  388. } JET_TUPLELIMITS;
  389. typedef struct tagJET_INDEXCREATE
  390. {
  391. unsigned long cbStruct; // size of this structure (for future expansion)
  392. char *szIndexName; // index name
  393. char *szKey; // index key
  394. unsigned long cbKey; // length of key
  395. JET_GRBIT grbit; // index options
  396. unsigned long ulDensity; // index density
  397. union
  398. {
  399. unsigned long lcid; // lcid for the index (if JET_bitIndexUnicode NOT specified)
  400. JET_UNICODEINDEX *pidxunicode; // pointer to JET_UNICODEINDEX struct (if JET_bitIndexUnicode specified)
  401. };
  402. union
  403. {
  404. unsigned long cbVarSegMac; // maximum length of variable length columns in index key (if JET_bitIndexTupleLimits specified)
  405. JET_TUPLELIMITS *ptuplelimits; // pointer to JET_TUPLELIMITS struct (if JET_bitIndexTupleLimits specified)
  406. };
  407. JET_CONDITIONALCOLUMN *rgconditionalcolumn; // pointer to conditional column structure
  408. unsigned long cConditionalColumn; // number of conditional columns
  409. JET_ERR err; // returned error code
  410. } JET_INDEXCREATE;
  411. typedef struct tagJET_TABLECREATE
  412. {
  413. unsigned long cbStruct; // size of this structure (for future expansion)
  414. char *szTableName; // name of table to create.
  415. char *szTemplateTableName; // name of table from which to inherit base DDL
  416. unsigned long ulPages; // initial pages to allocate for table.
  417. unsigned long ulDensity; // table density.
  418. JET_COLUMNCREATE *rgcolumncreate; // array of column creation info
  419. unsigned long cColumns; // number of columns to create
  420. JET_INDEXCREATE *rgindexcreate; // array of index creation info
  421. unsigned long cIndexes; // number of indexes to create
  422. JET_GRBIT grbit;
  423. JET_TABLEID tableid; // returned tableid.
  424. unsigned long cCreated; // count of objects created (columns+table+indexes).
  425. } JET_TABLECREATE;
  426. typedef struct tagJET_TABLECREATE2
  427. {
  428. unsigned long cbStruct; // size of this structure (for future expansion)
  429. char *szTableName; // name of table to create.
  430. char *szTemplateTableName; // name of table from which to inherit base DDL
  431. unsigned long ulPages; // initial pages to allocate for table.
  432. unsigned long ulDensity; // table density.
  433. JET_COLUMNCREATE *rgcolumncreate; // array of column creation info
  434. unsigned long cColumns; // number of columns to create
  435. JET_INDEXCREATE *rgindexcreate; // array of index creation info
  436. unsigned long cIndexes; // number of indexes to create
  437. char *szCallback; // callback to use for this table
  438. JET_CBTYP cbtyp; // when the callback should be called
  439. JET_GRBIT grbit;
  440. JET_TABLEID tableid; // returned tableid.
  441. unsigned long cCreated; // count of objects created (columns+table+indexes+callbacks).
  442. } JET_TABLECREATE2;
  443. typedef struct
  444. {
  445. unsigned long cbStruct;
  446. unsigned long ibLongValue;
  447. unsigned long itagSequence;
  448. JET_COLUMNID columnidNextTagged;
  449. } JET_RETINFO;
  450. typedef struct
  451. {
  452. unsigned long cbStruct;
  453. unsigned long ibLongValue;
  454. unsigned long itagSequence;
  455. } JET_SETINFO;
  456. typedef struct
  457. {
  458. unsigned long cbStruct;
  459. unsigned long centriesLT;
  460. unsigned long centriesInRange;
  461. unsigned long centriesTotal;
  462. } JET_RECPOS;
  463. typedef struct
  464. {
  465. unsigned long cbStruct;
  466. JET_TABLEID tableid;
  467. unsigned long cRecord;
  468. JET_COLUMNID columnidBookmark;
  469. } JET_RECORDLIST;
  470. typedef struct
  471. {
  472. unsigned long cbStruct;
  473. JET_TABLEID tableid;
  474. JET_GRBIT grbit;
  475. } JET_INDEXRANGE;
  476. // for database DDL conversion
  477. typedef enum
  478. {
  479. opDDLConvNull,
  480. opDDLConvAddCallback,
  481. opDDLConvChangeColumn,
  482. opDDLConvAddConditionalColumnsToAllIndexes,
  483. opDDLConvAddColumnCallback,
  484. opDDLConvIncreaseMaxColumnSize,
  485. opDDLConvChangeIndexDensity,
  486. opDDLConvMax
  487. } JET_OPDDLCONV;
  488. typedef struct tagDDLADDCALLBACK
  489. {
  490. char *szTable;
  491. char *szCallback;
  492. JET_CBTYP cbtyp;
  493. } JET_DDLADDCALLBACK;
  494. typedef struct tagDDLCHANGECOLUMN
  495. {
  496. char *szTable;
  497. char *szColumn;
  498. JET_COLTYP coltypNew;
  499. JET_GRBIT grbitNew;
  500. } JET_DDLCHANGECOLUMN;
  501. typedef struct tagDDLMAXCOLUMNSIZE
  502. {
  503. char *szTable;
  504. char *szColumn;
  505. unsigned long cbMax;
  506. } JET_DDLMAXCOLUMNSIZE;
  507. typedef struct tagDDLADDCONDITIONALCOLUMNSTOALLINDEXES
  508. {
  509. char * szTable; // name of table to convert
  510. JET_CONDITIONALCOLUMN * rgconditionalcolumn; // pointer to conditional column structure
  511. unsigned long cConditionalColumn; // number of conditional columns
  512. } JET_DDLADDCONDITIONALCOLUMNSTOALLINDEXES;
  513. typedef struct tagDDLADDCOLUMCALLBACK
  514. {
  515. char *szTable;
  516. char *szColumn;
  517. char *szCallback;
  518. void *pvCallbackData;
  519. unsigned long cbCallbackData;
  520. } JET_DDLADDCOLUMNCALLBACK;
  521. typedef struct tagDDLINDEXDENSITY
  522. {
  523. char *szTable;
  524. char *szIndex; // pass NULL to change density of primary index
  525. unsigned long ulDensity;
  526. } JET_DDLINDEXDENSITY;
  527. // The caller need to setup JET_OLP with a signal wait for the signal to be set.
  528. typedef struct {
  529. void *pvReserved1; // internally use
  530. void *pvReserved2;
  531. unsigned long cbActual; // the actual number of bytes read through this IO
  532. JET_HANDLE hSig; // a manual reset signal to wait for the IO to complete.
  533. JET_ERR err; // Err code for this assync IO.
  534. } JET_OLP;
  535. #include <pshpack1.h>
  536. #define JET_MAX_COMPUTERNAME_LENGTH 15
  537. typedef struct {
  538. char bSeconds; // 0 - 60
  539. char bMinutes; // 0 - 60
  540. char bHours; // 0 - 24
  541. char bDay; // 1 - 31
  542. char bMonth; // 0 - 11
  543. char bYear; // current year - 1900
  544. char bFiller1;
  545. char bFiller2;
  546. } JET_LOGTIME;
  547. typedef struct
  548. {
  549. unsigned short ib; // must be the last so that lgpos can
  550. unsigned short isec; // index of disksec starting logsec
  551. long lGeneration; // generation of logsec
  552. } JET_LGPOS; // be casted to TIME.
  553. typedef struct
  554. {
  555. unsigned long ulRandom; // a random number
  556. JET_LOGTIME logtimeCreate; // time db created, in logtime format
  557. char szComputerName[ JET_MAX_COMPUTERNAME_LENGTH + 1 ]; // where db is created
  558. } JET_SIGNATURE;
  559. typedef struct
  560. {
  561. JET_LGPOS lgposMark; // id for this backup
  562. JET_LOGTIME logtimeMark;
  563. unsigned long genLow;
  564. unsigned long genHigh;
  565. } JET_BKINFO;
  566. #include <poppack.h>
  567. typedef struct {
  568. unsigned long ulVersion; // version of DAE the db created (see ulDAEVersion)
  569. unsigned long ulUpdate; // used to track incremental database format updates that
  570. // are backward-compatible (see ulDAEUpdate)
  571. JET_SIGNATURE signDb; // (28 bytes) signature of the db (incl. creation time).
  572. unsigned long dbstate; // consistent/inconsistent state
  573. JET_LGPOS lgposConsistent; // null if in inconsistent state
  574. JET_LOGTIME logtimeConsistent; // null if in inconsistent state
  575. JET_LOGTIME logtimeAttach; // Last attach time.
  576. JET_LGPOS lgposAttach;
  577. JET_LOGTIME logtimeDetach; // Last detach time.
  578. JET_LGPOS lgposDetach;
  579. JET_SIGNATURE signLog; // (28 bytes) log signature for this attachments
  580. JET_BKINFO bkinfoFullPrev; // Last successful full backup.
  581. JET_BKINFO bkinfoIncPrev; // Last successful Incremental backup.
  582. // Reset when bkinfoFullPrev is set
  583. JET_BKINFO bkinfoFullCur; // current backup. Succeed if a
  584. // corresponding pat file generated.
  585. unsigned long fShadowingDisabled;
  586. unsigned long fUpgradeDb;
  587. // NT version information. This is needed to decide if an index need
  588. // be recreated due to sort table changes.
  589. unsigned long dwMajorVersion; /* OS version info */
  590. unsigned long dwMinorVersion;
  591. unsigned long dwBuildNumber;
  592. long lSPNumber;
  593. unsigned long cbPageSize; // database page size (0 = 4k pages)
  594. } JET_DBINFOMISC;
  595. typedef struct {
  596. unsigned long cpageOwned; // number of owned pages in the streaming file
  597. unsigned long cpageAvail; // number of available pages in the streaming file (subset of cpageOwned)
  598. } JET_STREAMINGFILESPACEINFO;
  599. //typedef struct
  600. // {
  601. // unsigned long cDiscont;
  602. // unsigned long cUnfixedMessyPage;
  603. // unsigned long centriesLT;
  604. // unsigned long centriesTotal;
  605. // unsigned long cpgCompactFreed;
  606. // } JET_OLCSTAT;
  607. /************************************************************************/
  608. /************************* JET CONSTANTS ************************/
  609. /************************************************************************/
  610. #define JET_instanceNil (~(JET_INSTANCE)0)
  611. #define JET_sesidNil (~(JET_SESID)0)
  612. #define JET_tableidNil (~(JET_TABLEID)0)
  613. #define JET_columnidNil (~(JET_COLUMNID)0)
  614. /* Max size of a bookmark */
  615. #define JET_cbBookmarkMost 256
  616. /* Max length of a object/column/index/property name */
  617. #define JET_cbNameMost 64
  618. /* Max length of a "name.name.name..." construct */
  619. #define JET_cbFullNameMost 255
  620. /* Max size of long-value (LongBinary or LongText) column chunk */
  621. // #define JET_cbColumnLVChunkMost ( JET_cbPage - 82 ) to the following:
  622. // Get cbPage from GetSystemParameter.
  623. // changed JET_cbColumnLVChunkMOst reference to cbPage - JET_cbColumnLVPageOverhead
  624. #define JET_cbColumnLVPageOverhead 82
  625. #define JET_cbColumnLVChunkMost ( 4096 - 82 ) // This def will be removed after other components change not to use this def
  626. #define JET_cbColumnLVChunkMost_OLD 4035
  627. /* Max size of long-value (LongBinary or LongText) column default value */
  628. #define JET_cbLVDefaultValueMost 255
  629. /* Max size of non-long-value column data */
  630. #define JET_cbColumnMost 255
  631. /* Max size of a sort/index key */
  632. #define JET_cbKeyMost 255
  633. #define JET_cbLimitKeyMost 256 // maximum key size when key is formed using a Limit grbit (eg. JET_bitStrLimit)
  634. #define JET_cbPrimaryKeyMost 255
  635. #define JET_cbSecondaryKeyMost 255
  636. #define JET_cbKeyMost_OLD 255
  637. /* Max number of components in a sort/index key */
  638. #define JET_ccolKeyMost 12
  639. // maximum number of columns
  640. #define JET_ccolMost 0x0000fee0
  641. #define JET_ccolFixedMost 0x0000007f
  642. #define JET_ccolVarMost 0x00000080
  643. #define JET_ccolTaggedMost ( JET_ccolMost - 0x000000ff )
  644. // event logging level (only on and off for now - will add more in the future)
  645. #define JET_EventLoggingDisable 0
  646. #define JET_EventLoggingLevelMax 100
  647. // system paramters
  648. //
  649. // location parameters
  650. //
  651. #define JET_paramSystemPath 0 // path to check point file [".\\"]
  652. #define JET_paramTempPath 1 // path to the temporary database [".\\"]
  653. #define JET_paramLogFilePath 2 // path to the log file directory [".\\"]
  654. #define JET_paramBaseName 3 // base name for all DBMS object names ["edb"]
  655. #define JET_paramEventSource 4 // language independent process descriptor string [""]
  656. // performance parameters
  657. //
  658. #define JET_paramMaxSessions 5 // maximum number of sessions [16]
  659. #define JET_paramMaxOpenTables 6 // maximum number of open directories [300]
  660. // need 1 for each open table index,
  661. // plus 1 for each open table with no indexes,
  662. // plus 1 for each table with long column data,
  663. // plus a few more.
  664. // for 4.1, 1/3 for regular table, 2/3 for index
  665. #define JET_paramPreferredMaxOpenTables 7 // preferred maximum number of open directories [300]
  666. #define JET_paramMaxCursors 8 // maximum number of open cursors [1024]
  667. #define JET_paramMaxVerPages 9 // maximum version store size in 16kByte units [64]
  668. #define JET_paramPreferredVerPages 63 // preferred version store size in 16kByte units [64 * 0.9]
  669. #define JET_paramGlobalMinVerPages 81 // minimum version store size for all instances in 16kByte units [64]
  670. #define JET_paramVersionStoreTaskQueueMax 105 // maximum number of tasks in the task queue before start dropping the tasks [32]
  671. #define JET_paramMaxTemporaryTables 10 // maximum concurrent open temporary table/index creation [20]
  672. #define JET_paramLogFileSize 11 // log file size in kBytes [5120]
  673. #define JET_paramLogBuffers 12 // log buffers in 512 bytes [80]
  674. #define JET_paramWaitLogFlush 13 // log flush wait time in milliseconds [0] DEFUNCT
  675. #define JET_paramLogCheckpointPeriod 14 // checkpoint period in 512 bytes [1024] DEFUNCT
  676. #define JET_paramLogWaitingUserMax 15 // maximum sessions waiting log flush [3] DEFUNCT
  677. #define JET_paramCommitDefault 16 // default grbit for JetCommitTransaction [0]
  678. #define JET_paramCircularLog 17 // boolean flag for circular logging [0]
  679. #define JET_paramDbExtensionSize 18 // database extension size in pages [256] DEFUNCT
  680. #define JET_paramPageTempDBMin 19 // minimum size temporary database in pages [0] DEFUNCT
  681. #define JET_paramPageFragment 20 // maximum disk extent considered fragment in pages [8] DEFUNCT
  682. #define JET_paramPageReadAheadMax 21 // maximum read-ahead in pages [20] DEFUNCT
  683. // cache performance parameters
  684. //
  685. #define JET_paramBatchIOBufferMax 22 // maximum batch I/O buffers in pages [64] DEFUNCT
  686. #define JET_paramCacheSize 41 // current cache size in pages [512]
  687. #define JET_paramCacheSizeMin 60 // minimum cache size in pages [64]
  688. #define JET_paramCacheSizeMax 23 // maximum cache size in pages [512]
  689. #define JET_paramCheckpointDepthMax 24 // maximum checkpoint depth in bytes [20MB]
  690. #define JET_paramLRUKCorrInterval 25 // time (usec) under which page accesses are correlated [128000], it was 10000
  691. #define JET_paramLRUKHistoryMax 26 // maximum LRUK history records [1024] (proportional to cache size max) DEFUNCT
  692. #define JET_paramLRUKPolicy 27 // K-ness of LRUK page eviction algorithm (1...2) [2]
  693. #define JET_paramLRUKTimeout 28 // time (sec) after which cached pages are always evictable [100]
  694. #define JET_paramLRUKTrxCorrInterval 29 // Not Used: time (usec) under which page accesses by the same transaction are correlated [5000000] DEFUNCT
  695. #define JET_paramOutstandingIOMax 30 // maximum outstanding I/Os [64] DEFUNCT
  696. #define JET_paramStartFlushThreshold 31 // evictable pages at which to start a flush [100] (proportional to CacheSizeMax)
  697. #define JET_paramStopFlushThreshold 32 // evictable pages at which to stop a flush [400] (proportional to CacheSizeMax)
  698. #define JET_paramTableClassName 33 // table stats class name (class #, string)
  699. #define JET_paramIdleFlushTime 106 // time interval (msec) over which all dirty pages should be written to disk after idle conditions are detected. [0]
  700. #define JET_paramVAReserve 109 // amount of address space (bytes) to reserve from use by the cache [0]
  701. // debug only parameters
  702. //
  703. #define JET_paramRecovery 34 // enable recovery [-1]
  704. #define JET_paramOnLineCompact 35 // enable online defrag [TRUE by default]
  705. #define JET_paramEnableOnlineDefrag 35 // enable online defrag [TRUE by default]
  706. #define JET_paramAssertAction 36 // action on assert
  707. #define JET_paramPrintFunction 37 // synched print function [NULL]
  708. #define JET_paramTransactionLevel 38 // transaction level of session
  709. #define JET_paramRFS2IOsPermitted 39 // #IOs permitted to succeed [-1 = all]
  710. #define JET_paramRFS2AllocsPermitted 40 // #allocs permitted to success [-1 = all]
  711. // 41 // JET_paramCacheSize defined above
  712. #define JET_paramCacheRequests 42 // #cache requests (Read Only)
  713. #define JET_paramCacheHits 43 // #cache hits (Read Only)
  714. // Application specific parameter
  715. //
  716. #define JET_paramCheckFormatWhenOpenFail 44 // JetInit may return JET_errDatabaseXXXformat instead of database corrupt when it is set
  717. #define JET_paramEnableTempTableVersioning 46 // Enable versioning of temp tables (TRUE by default)
  718. #define JET_paramIgnoreLogVersion 47 // Do not check the log version
  719. #define JET_paramDeleteOldLogs 48 // Delete the log files if the version is old, after deleting may make database non-recoverable
  720. #define JET_paramEventSourceKey 49 // Event source registration key value
  721. #define JET_paramNoInformationEvent 50 // Disable logging information event [ FALSE by default ]
  722. #define JET_paramEventLoggingLevel 51 // Set the type of information that goes to event log [ eventLoggingLevelMax by default ]
  723. #define JET_paramDeleteOutOfRangeLogs 52 // Delete the log files that are not matching (generation wise) during soft recovery [false]
  724. #define JET_paramAccessDeniedRetryPeriod 53 // Number of milliseconds to retry when about to fail with AccessDenied [10000 milliseconds]
  725. // Index-checking parameters
  726. //
  727. // Different versions of windows normalize unicode text in different ways. That means indexes built under one version of Windows may
  728. // not work on other versions. Windows server 2003 Beta 3 introduced an API which can be used to determine the version of unicode normalization
  729. // that the OS currently provides. Indexes built in server 2003 are flagged with the version of unicode normalization that they were
  730. // built with (older indexes have no version information). Most unicode normalization changes consist of adding new characters -- codepoints
  731. // which were previously undefined are defined and normalize differently. Thus, if binary data is stored in a unicode column it will normalize
  732. // differently as new codepoints are defined.
  733. //
  734. // As of Windows Server 2003 RC1 Jet tracks unicode index entries that contain undefined codepoints. These can be used to fixup an index when the
  735. // set of defined unicode characters changes.
  736. //
  737. // These parameters control what happens when Jet attaches to a database that was last used under a different build of the OS (the OS version
  738. // is stamped in the database header).
  739. //
  740. // If JET_paramEnableIndexChecking is TRUE JetAttachDatabase() will delete indexes if JET_bitDbDeleteCorruptIndexes or return an error if
  741. // the grbit was not specified and there are indexes which need deletion. If it is set to FALSE then JetAttachDatabase() will succeed, even
  742. // if there are potentially corrupt indexes.
  743. //
  744. // If JET_paramEnableIndexCleanup is set, the internal fixup table will be used to fixup index entries. This may not fixup all index corruptions
  745. // but will be transparent to the application.
  746. //
  747. #define JET_paramEnableIndexChecking 45 // Enable checking OS version for indexes (FALSE by default)
  748. #define JET_paramEnableIndexCleanup 54 // Enable cleanup of out-of-date index entries (TRUE by default)
  749. // 60 // JET_paramCacheSizeMin defined above
  750. #define JET_paramLogFileFailoverPath 61 // path to use if the log file disk should fail [none]
  751. #define JET_paramEnableImprovedSeekShortcut 62 // check to see if we are seeking for the record we are currently on [false]
  752. // 63 // JET_paramPreferredVerPages defined above
  753. #define JET_paramDatabasePageSize 64 // set database page size
  754. #define JET_paramDisableCallbacks 65 // turn off callback resolution (for defrag/repair)
  755. #define JET_paramDisablePerfmon 107 // disable perfmon support for this process [FALSE]
  756. #define JET_paramAbortRetryFailCallback 108 // I/O error callback (JET_ABORTRETRYFAILCALLBACK) [NULL]
  757. // Backup performance parameters
  758. //
  759. #define JET_paramBackupChunkSize 66 // backup read size in pages [16]
  760. #define JET_paramBackupOutstandingReads 67 // backup maximum reads outstanding [8]
  761. #define JET_paramSLVProviderEnable 68 // Enable SLV Provider [0]
  762. #define JET_paramLogFileCreateAsynch 69 // prepares next log file while logging to the current one to smooth response time [true]
  763. #define JET_paramErrorToString 70 // turns a JET_err into a string (taken from the comment in jet.h)
  764. #define JET_paramZeroDatabaseDuringBackup 71 // Overwrite deleted records/LVs during backup [false]
  765. #define JET_paramUnicodeIndexDefault 72 // default LCMapString() lcid and flags to use for CreateIndex() and unique multi-values check
  766. // (pass JET_UNICODEINDEX structure for lParam)
  767. #define JET_paramRuntimeCallback 73 // pointer to runtime-only callback function
  768. #define JET_paramSLVDefragFreeThreshold 74 // chunks whose free % is > this will be allocated from
  769. #define JET_paramSLVDefragMoveThreshold 75 // chunks whose free % is > this will be relocated
  770. #define JET_paramEnableSortedRetrieveColumns 76 // internally sort (in a dynamically allocated parallel array) JET_RETRIEVECOLUMN structures passed to JetRetrieveColumns()
  771. #define JET_paramCleanupMismatchedLogFiles 77 // instead of erroring out after a successful recovery with JET_errLogFileSizeMismatchDatabasesConsistent, ESE will silently delete the old log files and checkpoint file and continue operations
  772. #define JET_paramRecordUpgradeDirtyLevel 78 // how aggresively should pages with their record format converted be flushed (0-3) [1]
  773. #define JET_paramRecoveryCurrentLogfile 79 // which generation is currently being replayed (JetGetSystemParameter only)
  774. #define JET_paramReplayingReplicatedLogfiles 80 // if a logfile doesn't exist, wait for it to be created
  775. // 81 // JET_paramGlobalMinVerPages defined above
  776. #define JET_paramOSSnapshotTimeout 82 // timeout for the freeze period in msec [1000 * 20]
  777. #define JET_paramUnicodeIndexLibrary 83 // alternate library used for Unicode-index sorting (contains Win32 calls LCMapStringW and CompareStringW; also contains versioning API GetLCMapStringWVer)
  778. #define JET_paramExceptionAction 98 // what to do with exceptions generated within JET
  779. #define JET_paramEventLogCache 99 // number of bytes of eventlog records to cache if service is not available [0]
  780. #define JET_paramCreatePathIfNotExist 100 // create system/temp/log/log-failover paths if they do not exist
  781. #define JET_paramPageHintCacheSize 101 // maximum size of the fast page latch hint cache in bytes [256kb]
  782. #define JET_paramOneDatabasePerSession 102 // allow just one open user database per session [false]
  783. #define JET_paramMaxDatabasesPerInstance 103 // maximum number of databases per instance [6]
  784. #define JET_paramMaxInstances 104 // maximum number of instances per process [1 for ESENT, 16 for Exchange]
  785. // 105 // JET_paramVersionStoreTaskQueueMax
  786. // 106 // JET_paramIdleFlushTime
  787. // 107 // JET_paramDisablePerfmon
  788. // 108 // JET_paramAbortRetryFailCallback
  789. // 109 // JET_paramVAReserve
  790. #define JET_paramIndexTuplesLengthMin 110 // for tuple indexes, minimum length of a tuple [3]
  791. #define JET_paramIndexTuplesLengthMax 111 // for tuple indexes, maximum length of a tuple [10]
  792. #define JET_paramIndexTuplesToIndexMax 112 // for tuple indexes, maximum number of characters in a given string to index [32767]
  793. #define JET_paramAlternateDatabaseRecoveryPath 113 // recovery-only - search for dirty-shutdown databases in specified location only
  794. // for backward compatibility
  795. //
  796. #define JET_paramSysDbPath_OLD 0 /* path to the system database (defunct) ["<base name>.<base ext>"] */
  797. #define JET_paramSystemPath_OLD 0 /* path to check point file ["."] */
  798. #define JET_paramTempPath_OLD 1 /* path to the temporary database ["."] */
  799. #define JET_paramMaxBuffers_OLD 8 /* maximum page cache size in pages [512] */
  800. #define JET_paramMaxSessions_OLD 9 /* maximum number of sessions [128] */
  801. #define JET_paramMaxOpenTables_OLD 10 /* maximum number of open tables [300] */
  802. #define JET_paramPreferredMaxOpenTables_OLD 59 /* prefered maximum number of open tables [300] */
  803. #define JET_paramMaxVerPages_OLD 11 /* maximum version store size in 16KB buckets [64] */
  804. #define JET_paramMaxCursors_OLD 12 /* maximum number of open cursors [1024] */
  805. #define JET_paramLogFilePath_OLD 13 /* path to the log file directory ["."] */
  806. #define JET_paramMaxOpenTableIndexes_OLD 14 /* maximum open table indexes [300] */
  807. #define JET_paramMaxTemporaryTables_OLD 15 /* maximum concurrent JetCreateIndex [20] */
  808. #define JET_paramLogBuffers_OLD 16 /* maximum log buffers in 512 bytes [21] */
  809. #define JET_paramLogFileSize_OLD 17 /* maximum log file size in kBytes [5120] */
  810. #define JET_paramBfThrshldLowPrcnt_OLD 19 /* low percentage clean buffer flush start [20] */
  811. #define JET_paramBfThrshldHighPrcnt_OLD 20 /* high percentage clean buffer flush stop [80] */
  812. #define JET_paramWaitLogFlush_OLD 21 /* log flush wait time in milliseconds [15] */
  813. #define JET_paramLogCheckpointPeriod_OLD 23 /* checkpoint period in 512 bytes [1024] */
  814. #define JET_paramLogWaitingUserMax_OLD 24 /* maximum sessions waiting log flush [3] */
  815. #define JET_paramRecovery_OLD 30 /* Switch for log on/off */
  816. #define JET_paramSessionInfo_OLD 33 /* per session information [0] */
  817. #define JET_paramPageFragment_OLD 34 /* maximum disk extent considered fragment in pages [8] */
  818. #define JET_paramMaxOpenDatabases_OLD 36 /* maximum number of open databases [100] */
  819. #define JET_paramBufBatchIOMax_OLD 41 /* maximum batch IO in pages [64] */
  820. #define JET_paramPageReadAheadMax_OLD 42 /* maximum read-ahead IO in pages [20] */
  821. #define JET_paramAsynchIOMax_OLD 43 /* maximum asynchronous IO in pages [64] */
  822. #define JET_paramEventSource_OLD 45 /* language independant process descriptor string [""] */
  823. #define JET_paramDbExtensionSize_OLD 48 /* database extension size in pages [16] */
  824. #define JET_paramCommitDefault_OLD 50 /* default grbit for JetCommitTransaction [0] */
  825. #define JET_paramBufLogGenAgeThreshold_OLD 51 /* age threshold in log files [2] */
  826. #define JET_paramCircularLog_OLD 52 /* boolean flag for circular logging [0] */
  827. #define JET_paramPageTempDBMin_OLD 53 /* minimum size temporary database in pages [0] */
  828. #define JET_paramBaseName_OLD 56 /* base name for all DBMS object names ["edb"] */
  829. #define JET_paramBaseExtension_OLD 57 /* base extension for all DBMS object names ["edb"] */
  830. #define JET_paramTableClassName_OLD 58 /* table stats class name (class #, string) */
  831. /* Flags for JetInit2 */
  832. #define JET_bitReplayReplicatedLogFiles 0x00000001
  833. //#define JET_bitCreateSFSVolumeIfNotExist 0x00000002
  834. // IGNORE_MISSING_ATTACH, ignoring hanging asserts for missing databases during recovery
  835. #define JET_bitReplayIgnoreMissingDB 0x00000004 /* ignore missing databases */
  836. /* Flags for JetTerm2 */
  837. #define JET_bitTermComplete 0x00000001
  838. #define JET_bitTermAbrupt 0x00000002
  839. #define JET_bitTermStopBackup 0x00000004
  840. /* Flags for JetIdle */
  841. #define JET_bitIdleFlushBuffers 0x00000001
  842. #define JET_bitIdleCompact 0x00000002
  843. #define JET_bitIdleStatus 0x00000004
  844. #define JET_bitIdleVersionStoreTest 0x00000008 /* INTERNAL USE ONLY. call version store consistency check */
  845. /* Flags for JetEndSession */
  846. #define JET_bitForceSessionClosed 0x00000001
  847. /* Flags for JetAttach/OpenDatabase */
  848. #define JET_bitDbReadOnly 0x00000001
  849. #define JET_bitDbExclusive 0x00000002 /* multiple opens allowed */
  850. #define JET_bitDbSingleExclusive 0x00000002 /* NOT CURRENTLY IMPLEMENTED - currently maps to JET_bitDbExclusive */
  851. #define JET_bitDbDeleteCorruptIndexes 0x00000010 /* delete indexes possibly corrupted by NT version upgrade */
  852. #define JET_bitDbRebuildCorruptIndexes 0x00000020 /* NOT CURRENTLY IMPLEMENTED - recreate indexes possibly corrupted by NT version upgrade */
  853. #define JET_bitDbDeleteUnicodeIndexes 0x00000400 /* delete all indexes with unicode columns */
  854. #define JET_bitDbUpgrade 0x00000200 /* */
  855. /* Flags for JetDetachDatabase2 */
  856. #define JET_bitForceDetach 0x00000001
  857. #define JET_bitForceCloseAndDetach (0x00000002 | JET_bitForceDetach)
  858. /* Flags for JetCreateDatabase */
  859. #define JET_bitDbRecoveryOff 0x00000008 /* disable logging/recovery for this database */
  860. #define JET_bitDbVersioningOff 0x00000040 /* INTERNAL USE ONLY */
  861. #define JET_bitDbShadowingOff 0x00000080 /* disable catalog shadowing */
  862. #define JET_bitDbCreateStreamingFile 0x00000100 /* create streaming file with same name as db */
  863. #define JET_bitDbOverwriteExisting 0x00000200 /* overwrite existing database with same name */
  864. /* Flags for JetBackup */
  865. #define JET_bitBackupIncremental 0x00000001
  866. #define JET_bitKeepOldLogs 0x00000002
  867. #define JET_bitBackupAtomic 0x00000004
  868. #define JET_bitBackupFullWithAllLogs 0x00000008
  869. #define JET_bitBackupSnapshot 0x00000010
  870. /* Database types */
  871. #define JET_dbidNil ((JET_DBID) 0xFFFFFFFF)
  872. #define JET_dbidNoValid ((JET_DBID) 0xFFFFFFFE) /* used as a flag to indicate that there is no valid dbid */
  873. /* Flags for JetCreateTableColumnIndex */
  874. #define JET_bitTableCreateFixedDDL 0x00000001 /* DDL is fixed */
  875. #define JET_bitTableCreateTemplateTable 0x00000002 /* DDL is inheritable (implies FixedDDL) */
  876. #define JET_bitTableCreateNoFixedVarColumnsInDerivedTables 0x00000004
  877. // used in conjunction with JET_bitTableCreateTemplateTable
  878. // to disallow fixed/var columns in derived tables (so that
  879. // fixed/var columns may be added to the template in the future)
  880. #define JET_bitTableCreateSystemTable 0x80000000 /* INTERNAL USE ONLY */
  881. /* Flags for JetAddColumn, JetGetColumnInfo, JetOpenTempTable */
  882. #define JET_bitColumnFixed 0x00000001
  883. #define JET_bitColumnTagged 0x00000002
  884. #define JET_bitColumnNotNULL 0x00000004
  885. #define JET_bitColumnVersion 0x00000008
  886. #define JET_bitColumnAutoincrement 0x00000010
  887. #define JET_bitColumnUpdatable 0x00000020 /* JetGetColumnInfo only */
  888. #define JET_bitColumnTTKey 0x00000040 /* JetOpenTempTable only */
  889. #define JET_bitColumnTTDescending 0x00000080 /* JetOpenTempTable only */
  890. #define JET_bitColumnMultiValued 0x00000400
  891. #define JET_bitColumnEscrowUpdate 0x00000800 /* escrow updated */
  892. #define JET_bitColumnUnversioned 0x00001000 /* for add column only - add column unversioned */
  893. #define JET_bitColumnMaybeNull 0x00002000 /* for retrieve column info of outer join where no match from the inner table */
  894. #define JET_bitColumnFinalize 0x00004000 /* this is a finalizable column (issue callback if escrow value equals 0) */
  895. #define JET_bitColumnUserDefinedDefault 0x00008000 /* default value from a user-provided callback */
  896. #define JET_bitColumnRenameConvertToPrimaryIndexPlaceholder 0x00010000 // FOR JetRenameColumn() ONLY: rename and convert to primary index placeholder (ie. no longer part of primary index ecxept as a placeholder)
  897. #define JET_bitColumnDeleteOnZero 0x00020000 /* this is a finalizable column (delete record if escrow value equals 0) */
  898. // flags for JetDeleteColumn
  899. #define JET_bitDeleteColumnIgnoreTemplateColumns 0x00000001 // for derived tables, don't bother looking in template columns
  900. /* Flags for JetSetCurrentIndex */
  901. #define JET_bitMoveFirst 0x00000000
  902. #define JET_bitMoveBeforeFirst 0x00000001 // unsupported -- DO NOT USE
  903. #define JET_bitNoMove 0x00000002
  904. /* Flags for JetMakeKey */
  905. #define JET_bitNewKey 0x00000001
  906. #define JET_bitStrLimit 0x00000002
  907. #define JET_bitSubStrLimit 0x00000004
  908. #define JET_bitNormalizedKey 0x00000008
  909. #define JET_bitKeyDataZeroLength 0x00000010
  910. #define JET_bitKeyOverridePrimaryIndexPlaceholder 0x00000020
  911. #define JET_maskLimitOptions 0x00000f00
  912. #define JET_bitFullColumnStartLimit 0x00000100
  913. #define JET_bitFullColumnEndLimit 0x00000200
  914. #define JET_bitPartialColumnStartLimit 0x00000400
  915. #define JET_bitPartialColumnEndLimit 0x00000800
  916. /* Flags for ErrDispSetIndexRange */
  917. #define JET_bitRangeInclusive 0x00000001
  918. #define JET_bitRangeUpperLimit 0x00000002
  919. #define JET_bitRangeInstantDuration 0x00000004
  920. #define JET_bitRangeRemove 0x00000008
  921. /* Flags for JetGetLock */
  922. #define JET_bitReadLock 0x00000001
  923. #define JET_bitWriteLock 0x00000002
  924. /* Constants for JetMove */
  925. #define JET_MoveFirst (0x80000000)
  926. #define JET_MovePrevious (-1)
  927. #define JET_MoveNext (+1)
  928. #define JET_MoveLast (0x7fffffff)
  929. /* Flags for JetMove */
  930. #define JET_bitMoveKeyNE 0x00000001
  931. /* Flags for JetSeek */
  932. #define JET_bitSeekEQ 0x00000001
  933. #define JET_bitSeekLT 0x00000002
  934. #define JET_bitSeekLE 0x00000004
  935. #define JET_bitSeekGE 0x00000008
  936. #define JET_bitSeekGT 0x00000010
  937. #define JET_bitSetIndexRange 0x00000020
  938. #define JET_bitCheckUniqueness 0x00000040 // to be used with JET_bitSeekEQ only, returns JET_wrnUniqueKey if seek lands on a key which has no dupes
  939. // Flags for JetGotoSecondaryIndexBookmark
  940. #define JET_bitBookmarkPermitVirtualCurrency 0x00000001 // place cursor on relative position in index if specified bookmark no longer exists
  941. /* Flags for JET_CONDITIONALCOLUMN */
  942. #define JET_bitIndexColumnMustBeNull 0x00000001
  943. #define JET_bitIndexColumnMustBeNonNull 0x00000002
  944. /* Flags for JET_INDEXRANGE */
  945. #define JET_bitRecordInIndex 0x00000001
  946. #define JET_bitRecordNotInIndex 0x00000002
  947. /* Flags for JetCreateIndex */
  948. #define JET_bitIndexUnique 0x00000001
  949. #define JET_bitIndexPrimary 0x00000002
  950. #define JET_bitIndexDisallowNull 0x00000004
  951. #define JET_bitIndexIgnoreNull 0x00000008
  952. #define JET_bitIndexClustered40 0x00000010 /* for backward compatibility */
  953. #define JET_bitIndexIgnoreAnyNull 0x00000020
  954. #define JET_bitIndexIgnoreFirstNull 0x00000040
  955. #define JET_bitIndexLazyFlush 0x00000080
  956. #define JET_bitIndexEmpty 0x00000100 // don't attempt to build index, because all entries would evaluate to NULL (MUST also specify JET_bitIgnoreAnyNull)
  957. #define JET_bitIndexUnversioned 0x00000200
  958. #define JET_bitIndexSortNullsHigh 0x00000400 // NULL sorts after data for all columns in the index
  959. #define JET_bitIndexUnicode 0x00000800 // LCID field of JET_INDEXCREATE actually points to a JET_UNICODEINDEX struct to allow user-defined LCMapString() flags
  960. #define JET_bitIndexTuples 0x00001000 // index on substring tuples (text columns only)
  961. #define JET_bitIndexTupleLimits 0x00002000 // cbVarSegMac field of JET_INDEXCREATE actually points to a JET_TUPLELIMITS struct to allow custom tuple index limits (implies JET_bitIndexTuples)
  962. // UNDONE: Remove the following:
  963. // #define JET_bitIndexClustered JET_bitIndexPrimary primary index is the clustered index
  964. // #define JET_bitIndexEmptyTable 0x40000000
  965. /* Flags for index key definition */
  966. #define JET_bitKeyAscending 0x00000000
  967. #define JET_bitKeyDescending 0x00000001
  968. /* Flags for JetOpenTable */
  969. #define JET_bitTableDenyWrite 0x00000001
  970. #define JET_bitTableDenyRead 0x00000002
  971. #define JET_bitTableReadOnly 0x00000004
  972. #define JET_bitTableUpdatable 0x00000008
  973. #define JET_bitTablePermitDDL 0x00000010 /* override table flagged as FixedDDL (must be used with DenyRead) */
  974. #define JET_bitTableNoCache 0x00000020 /* don't cache the pages for this table */
  975. #define JET_bitTablePreread 0x00000040 /* assume the table is probably not in the buffer cache */
  976. #define JET_bitTableDelete 0x10000000 /* INTERNAL USE ONLY */
  977. #define JET_bitTableCreate 0x20000000 /* INTERNAL USE ONLY */
  978. #define JET_bitTableClassMask 0x000F0000 /* table stats class mask */
  979. #define JET_bitTableClassNone 0x00000000 /* table belongs to no stats class (default) */
  980. #define JET_bitTableClass1 0x00010000 /* table belongs to stats class 1 */
  981. #define JET_bitTableClass2 0x00020000 /* table belongs to stats class 2 */
  982. #define JET_bitTableClass3 0x00030000 /* table belongs to stats class 3 */
  983. #define JET_bitTableClass4 0x00040000 /* table belongs to stats class 4 */
  984. #define JET_bitTableClass5 0x00050000 /* table belongs to stats class 5 */
  985. #define JET_bitTableClass6 0x00060000 /* table belongs to stats class 6 */
  986. #define JET_bitTableClass7 0x00070000 /* table belongs to stats class 7 */
  987. #define JET_bitTableClass8 0x00080000 /* table belongs to stats class 8 */
  988. #define JET_bitTableClass9 0x00090000 /* table belongs to stats class 9 */
  989. #define JET_bitTableClass10 0x000A0000 /* table belongs to stats class 10 */
  990. #define JET_bitTableClass11 0x000B0000 /* table belongs to stats class 11 */
  991. #define JET_bitTableClass12 0x000C0000 /* table belongs to stats class 12 */
  992. #define JET_bitTableClass13 0x000D0000 /* table belongs to stats class 13 */
  993. #define JET_bitTableClass14 0x000E0000 /* table belongs to stats class 14 */
  994. #define JET_bitTableClass15 0x000F0000 /* table belongs to stats class 15 */
  995. #define JET_bitLSReset 0x00000001 /* reset LS value */
  996. #define JET_bitLSCursor 0x00000002 /* set/retrieve LS of table cursor */
  997. #define JET_bitLSTable 0x00000004 /* set/retrieve LS of table */
  998. #define JET_LSNil (~(JET_LS)0)
  999. /* Flags for JetOpenTempTable and ErrIsamOpenTempTable */
  1000. #define JET_bitTTIndexed 0x00000001 /* Allow seek */
  1001. #define JET_bitTTUnique 0x00000002 /* Remove duplicates */
  1002. #define JET_bitTTUpdatable 0x00000004 /* Allow updates */
  1003. #define JET_bitTTScrollable 0x00000008 /* Allow backwards scrolling */
  1004. #define JET_bitTTSortNullsHigh 0x00000010 /* NULL sorts after data for all columns in the index */
  1005. #define JET_bitTTForceMaterialization 0x00000020 /* Forces temp. table to be materialized into a btree (allows for duplicate detection) */
  1006. #define JET_bitTTErrorOnDuplicateInsertion JET_bitTTForceMaterialization /* Error always returned when duplicate is inserted (instead of dupe being silently removed) */
  1007. #define JET_bitTTForwardOnly 0x00000040 /* Prevents temp. table from being materialized into a btree (and enables duplicate keys) */
  1008. /* Flags for JetSetColumn */
  1009. #define JET_bitSetAppendLV 0x00000001
  1010. #define JET_bitSetOverwriteLV 0x00000004 /* overwrite JET_coltypLong* byte range */
  1011. #define JET_bitSetSizeLV 0x00000008 /* set JET_coltypLong* size */
  1012. #define JET_bitSetZeroLength 0x00000020
  1013. #define JET_bitSetSeparateLV 0x00000040 /* force LV separation */
  1014. #define JET_bitSetUniqueMultiValues 0x00000080 /* prevent duplicate multi-values */
  1015. #define JET_bitSetUniqueNormalizedMultiValues 0x00000100 /* prevent duplicate multi-values, normalizing all data before performing comparisons */
  1016. #define JET_bitSetRevertToDefaultValue 0x00000200 /* if setting last tagged instance to NULL, revert to default value instead if one exists */
  1017. #define JET_bitSetIntrinsicLV 0x00000400 /* store whole LV in record without bursting or return an error */
  1018. #define JET_bitSetSLVDataNotRecoverable 0x00001000 /* SLV data is not recoverable */
  1019. #define JET_bitSetSLVFromSLVInfo 0x00002000 /* internal use only */
  1020. /* Flags for JetSetColumn when the SLV Provider is enabled */
  1021. #define JET_bitSetSLVFromSLVFile 0x00004000 /* set SLV from an SLV File handle */
  1022. #define JET_bitSetSLVFromSLVEA 0x00008000 /* set SLV from an SLV EA list */
  1023. /* Set column parameter structure for JetSetColumns */
  1024. typedef struct {
  1025. JET_COLUMNID columnid;
  1026. const void *pvData;
  1027. unsigned long cbData;
  1028. JET_GRBIT grbit;
  1029. unsigned long ibLongValue;
  1030. unsigned long itagSequence;
  1031. JET_ERR err;
  1032. } JET_SETCOLUMN;
  1033. typedef struct {
  1034. unsigned long paramid;
  1035. JET_API_PTR lParam;
  1036. const char *sz;
  1037. JET_ERR err;
  1038. } JET_SETSYSPARAM;
  1039. /* Options for JetPrepareUpdate */
  1040. #define JET_prepInsert 0
  1041. #define JET_prepReplace 2
  1042. #define JET_prepCancel 3
  1043. #define JET_prepReplaceNoLock 4
  1044. #define JET_prepInsertCopy 5
  1045. #define JET_prepInsertCopyWithoutSLVColumns 6 // same as InsertCopy, except that SLV columns are nullified instead of copied in the new record */
  1046. #define JET_prepInsertCopyDeleteOriginal 7 // used for updating a record in the primary key; avoids the delete/insert process */
  1047. #define JET_prepReadOnlyCopy 8 // copy record into copy buffer for read-only purposes
  1048. // Flags for JetUpdate
  1049. #define JET_bitUpdateCheckESE97Compatibility 0x00000001 // check whether record fix if represented in ESE97 database format
  1050. /* Flags for JetEscrowUpdate */
  1051. #define JET_bitEscrowNoRollback 0x0001
  1052. /* Flags for JetRetrieveColumn */
  1053. #define JET_bitRetrieveCopy 0x00000001
  1054. #define JET_bitRetrieveFromIndex 0x00000002
  1055. #define JET_bitRetrieveFromPrimaryBookmark 0x00000004
  1056. #define JET_bitRetrieveTag 0x00000008
  1057. #define JET_bitRetrieveNull 0x00000010 /* for columnid 0 only */
  1058. #define JET_bitRetrieveIgnoreDefault 0x00000020 /* for columnid 0 only */
  1059. #define JET_bitRetrieveLongId 0x00000040
  1060. #define JET_bitRetrieveLongValueRefCount 0x00000080 /* for testing use only */
  1061. #define JET_bitRetrieveSLVAsSLVInfo 0x00000100 /* internal use only */
  1062. /* Flags for JetRetrieveColumn when the SLV Provider is enabled */
  1063. #define JET_bitRetrieveSLVAsSLVFile 0x00000200 /* retrieve SLV as an SLV File handle */
  1064. #define JET_bitRetrieveSLVAsSLVEA 0x00000400 /* retrieve SLV as an SLV EA list */
  1065. /* Retrieve column parameter structure for JetRetrieveColumns */
  1066. typedef struct {
  1067. JET_COLUMNID columnid;
  1068. void *pvData;
  1069. unsigned long cbData;
  1070. unsigned long cbActual;
  1071. JET_GRBIT grbit;
  1072. unsigned long ibLongValue;
  1073. unsigned long itagSequence;
  1074. JET_COLUMNID columnidNextTagged;
  1075. JET_ERR err;
  1076. } JET_RETRIEVECOLUMN;
  1077. typedef struct
  1078. {
  1079. JET_COLUMNID columnid;
  1080. unsigned short cMultiValues;
  1081. union
  1082. {
  1083. unsigned short usFlags;
  1084. struct
  1085. {
  1086. unsigned short fLongValue:1; // is column LongText/Binary?
  1087. unsigned short fDefaultValue:1; // was a default value retrieved?
  1088. unsigned short fNullOverride:1; // was there an explicit null to override a default value?
  1089. unsigned short fDerived:1; // was column derived from template table?
  1090. };
  1091. };
  1092. } JET_RETRIEVEMULTIVALUECOUNT;
  1093. /* Flags for JetEnumerateColumns */
  1094. #define JET_bitEnumerateCopy JET_bitRetrieveCopy
  1095. #define JET_bitEnumerateIgnoreDefault JET_bitRetrieveIgnoreDefault
  1096. #define JET_bitEnumerateLocal 0x00010000
  1097. #define JET_bitEnumeratePresenceOnly 0x00020000
  1098. #define JET_bitEnumerateTaggedOnly 0x00040000
  1099. #define JET_bitEnumerateCompressOutput 0x00080000
  1100. /* Parameter structures for JetEnumerateColumns */
  1101. typedef struct {
  1102. JET_COLUMNID columnid;
  1103. unsigned long ctagSequence;
  1104. unsigned long* rgtagSequence;
  1105. } JET_ENUMCOLUMNID;
  1106. typedef struct {
  1107. unsigned long itagSequence;
  1108. JET_ERR err;
  1109. unsigned long cbData;
  1110. void* pvData;
  1111. } JET_ENUMCOLUMNVALUE;
  1112. typedef struct {
  1113. JET_COLUMNID columnid;
  1114. JET_ERR err;
  1115. union {
  1116. struct { /* err != JET_wrnColumnSingleValue */
  1117. unsigned long cEnumColumnValue;
  1118. JET_ENUMCOLUMNVALUE* rgEnumColumnValue;
  1119. };
  1120. struct { /* err == JET_wrnColumnSingleValue */
  1121. unsigned long cbData;
  1122. void* pvData;
  1123. };
  1124. };
  1125. } JET_ENUMCOLUMN;
  1126. /* Realloc callback for JetEnumerateColumns */
  1127. typedef void* (JET_API *JET_PFNREALLOC)( void* pvContext, void* pv, unsigned long cb );
  1128. #pragma warning(pop)
  1129. /* Flags for JetBeginTransaction2 */
  1130. #define JET_bitTransactionReadOnly 0x00000001 /* transaction will not modify the database */
  1131. #define JET_bitDistributedTransaction 0x00000002 /* transaction will require two-phase commit */
  1132. /* Flags for JetCommitTransaction */
  1133. #define JET_bitCommitLazyFlush 0x00000001 /* lazy flush log buffers. */
  1134. #define JET_bitWaitLastLevel0Commit 0x00000002 /* wait for last level 0 commit record flushed */
  1135. #define JET_bitWaitAllLevel0Commit 0x00000008 /* wait for all level 0 commits to be flushed */
  1136. #define JET_bitCommitFlush_OLD 0x00000001 /* commit and flush page buffers. */
  1137. #define JET_bitCommitLazyFlush_OLD 0x00000004 /* lazy flush log buffers. */
  1138. #define JET_bitWaitLastLevel0Commit_OLD 0x00000010 /* wait for last level 0 commit record flushed */
  1139. /* Flags for JetRollback */
  1140. #define JET_bitRollbackAll 0x00000001
  1141. /* Info parameter for JetGetDatabaseInfo */
  1142. #define JET_DbInfoFilename 0
  1143. #define JET_DbInfoConnect 1
  1144. #define JET_DbInfoCountry 2
  1145. #define JET_DbInfoLCID 3
  1146. #define JET_DbInfoLangid 3 // OBSOLETE: use JET_DbInfoLCID instead
  1147. #define JET_DbInfoCp 4
  1148. #define JET_DbInfoCollate 5
  1149. #define JET_DbInfoOptions 6
  1150. #define JET_DbInfoTransactions 7
  1151. #define JET_DbInfoVersion 8
  1152. #define JET_DbInfoIsam 9
  1153. #define JET_DbInfoFilesize 10
  1154. #define JET_DbInfoSpaceOwned 11
  1155. #define JET_DbInfoSpaceAvailable 12
  1156. #define JET_DbInfoUpgrade 13
  1157. #define JET_DbInfoMisc 14
  1158. #define JET_DbInfoDBInUse 15
  1159. #define JET_DbInfoHasSLVFile 16
  1160. #define JET_DbInfoPageSize 17
  1161. /* Dbstates from JetGetDatabaseFileInfo */
  1162. #define JET_dbstateJustCreated 1
  1163. #define JET_dbstateDirtyShutdown 2
  1164. #define JET_dbstateInconsistent JET_dbstateDirtyShutdown
  1165. #define JET_dbstateCleanShutdown 3
  1166. #define JET_dbstateConsistent JET_dbstateCleanShutdown
  1167. #define JET_dbstateBeingConverted 4
  1168. #define JET_dbstateForceDetach 5
  1169. /* Column data types */
  1170. #define JET_coltypNil 0
  1171. #define JET_coltypBit 1 /* True or False, Never NULL */
  1172. #define JET_coltypUnsignedByte 2 /* 1-byte integer, unsigned */
  1173. #define JET_coltypShort 3 /* 2-byte integer, signed */
  1174. #define JET_coltypLong 4 /* 4-byte integer, signed */
  1175. #define JET_coltypCurrency 5 /* 8 byte integer, signed */
  1176. #define JET_coltypIEEESingle 6 /* 4-byte IEEE single precision */
  1177. #define JET_coltypIEEEDouble 7 /* 8-byte IEEE double precision */
  1178. #define JET_coltypDateTime 8 /* Integral date, fractional time */
  1179. #define JET_coltypBinary 9 /* Binary data, < 255 bytes */
  1180. #define JET_coltypText 10 /* ANSI text, case insensitive, < 255 bytes */
  1181. #define JET_coltypLongBinary 11 /* Binary data, long value */
  1182. #define JET_coltypLongText 12 /* ANSI text, long value */
  1183. #define JET_coltypSLV 13 /* SLV's */
  1184. #define JET_coltypMax 14 /* the number of column types */
  1185. /* used for validity tests and */
  1186. /* array declarations. */
  1187. /* Info levels for JetGetObjectInfo */
  1188. #define JET_ObjInfo 0U
  1189. #define JET_ObjInfoListNoStats 1U
  1190. #define JET_ObjInfoList 2U
  1191. #define JET_ObjInfoSysTabCursor 3U
  1192. #define JET_ObjInfoListACM 4U /* Blocked by JetGetObjectInfo */
  1193. #define JET_ObjInfoNoStats 5U
  1194. #define JET_ObjInfoSysTabReadOnly 6U
  1195. #define JET_ObjInfoRulesLoaded 7U
  1196. #define JET_ObjInfoMax 8U
  1197. /* Info levels for JetGetTableInfo */
  1198. #define JET_TblInfo 0U
  1199. #define JET_TblInfoName 1U
  1200. #define JET_TblInfoDbid 2U
  1201. #define JET_TblInfoMostMany 3U
  1202. #define JET_TblInfoRvt 4U
  1203. #define JET_TblInfoOLC 5U
  1204. #define JET_TblInfoResetOLC 6U
  1205. #define JET_TblInfoSpaceUsage 7U
  1206. #define JET_TblInfoDumpTable 8U
  1207. #define JET_TblInfoSpaceAlloc 9U
  1208. #define JET_TblInfoSpaceOwned 10U // OwnExt
  1209. #define JET_TblInfoSpaceAvailable 11U // AvailExt
  1210. #define JET_TblInfoTemplateTableName 12U
  1211. /* Info levels for JetGetIndexInfo and JetGetTableIndexInfo */
  1212. #define JET_IdxInfo 0U
  1213. #define JET_IdxInfoList 1U
  1214. #define JET_IdxInfoSysTabCursor 2U
  1215. #define JET_IdxInfoOLC 3U
  1216. #define JET_IdxInfoResetOLC 4U
  1217. #define JET_IdxInfoSpaceAlloc 5U
  1218. #define JET_IdxInfoLCID 6U
  1219. #define JET_IdxInfoLangid 6U // OBSOLETE: use JET_IdxInfoLCID instead
  1220. #define JET_IdxInfoCount 7U
  1221. #define JET_IdxInfoVarSegMac 8U
  1222. #define JET_IdxInfoIndexId 9U
  1223. /* Info levels for JetGetColumnInfo and JetGetTableColumnInfo */
  1224. #define JET_ColInfo 0U
  1225. #define JET_ColInfoList 1U
  1226. #define JET_ColInfoSysTabCursor 3U
  1227. #define JET_ColInfoBase 4U
  1228. #define JET_ColInfoListCompact 5U
  1229. #define JET_ColInfoByColid 6U
  1230. #define JET_ColInfoListSortColumnid 7U // same as JET_ColInfoList except PresentationOrder is set to columnid
  1231. // to force sorting by columnid
  1232. /* Engine Object Types */
  1233. #define JET_objtypNil 0
  1234. #define JET_objtypTable 1
  1235. #define JET_objtypDb 2
  1236. #define JET_objtypContainer 3
  1237. #define JET_objtypLongRoot 9 /* INTERNAL USE ONLY */
  1238. /* Compact Options */
  1239. #define JET_bitCompactStats 0x00000020 /* Dump off-line compaction stats (only when progress meter also specified) */
  1240. #define JET_bitCompactRepair 0x00000040 /* Don't preread and ignore duplicate keys */
  1241. #define JET_bitCompactSLVCopy 0x00000080 /* Recreate SLV file, do not reuse the existing one */
  1242. /* Status Notification Processes */
  1243. #define JET_snpRepair 2
  1244. #define JET_snpCompact 4
  1245. #define JET_snpRestore 8
  1246. #define JET_snpBackup 9
  1247. #define JET_snpUpgrade 10
  1248. #define JET_snpScrub 11
  1249. #define JET_snpUpgradeRecordFormat 12
  1250. /* Status Notification Types */
  1251. #define JET_sntBegin 5 /* callback for beginning of operation */
  1252. #define JET_sntRequirements 7 /* callback for returning operation requirements */
  1253. #define JET_sntProgress 0 /* callback for progress */
  1254. #define JET_sntComplete 6 /* callback for completion of operation */
  1255. #define JET_sntFail 3 /* callback for failure during progress */
  1256. /* Exception action */
  1257. #define JET_ExceptionMsgBox 0x0001 /* Display message box on exception */
  1258. #define JET_ExceptionNone 0x0002 /* Do nothing on exceptions */
  1259. /* AssertAction */
  1260. #define JET_AssertExit 0x0000 /* Exit the application */
  1261. #define JET_AssertBreak 0x0001 /* Break to debugger */
  1262. #define JET_AssertMsgBox 0x0002 /* Display message box */
  1263. #define JET_AssertStop 0x0004 /* Alert and stop */
  1264. // Online defragmentation options
  1265. #define JET_OnlineDefragDisable 0x0000 // disable online defrag
  1266. #define JET_OnlineDefragAllOBSOLETE 0x0001 // enable online defrag for everything (must be 1 for backward compatibility)
  1267. #define JET_OnlineDefragDatabases 0x0002 // enable online defrag of databases
  1268. #define JET_OnlineDefragSpaceTrees 0x0004 // enable online defrag of space trees
  1269. #define JET_OnlineDefragStreamingFiles 0x0008 // enable online defrag of streaming files
  1270. #define JET_OnlineDefragAll 0xffff // enable online defrag for everything
  1271. /* Counter flags */ // For XJET only, not for JET97
  1272. #define ctAccessPage 1
  1273. #define ctLatchConflict 2
  1274. #define ctSplitRetry 3
  1275. #define ctNeighborPageScanned 4
  1276. #define ctSplits 5
  1277. /**********************************************************************/
  1278. /*********************** ERROR CODES **************************/
  1279. /**********************************************************************/
  1280. /* SUCCESS */
  1281. #define JET_errSuccess 0 /* Successful Operation */
  1282. /* ERRORS */
  1283. #define JET_wrnNyi -1 /* Function Not Yet Implemented */
  1284. /* SYSTEM errors
  1285. /**/
  1286. #define JET_errRfsFailure -100 /* Resource Failure Simulator failure */
  1287. #define JET_errRfsNotArmed -101 /* Resource Failure Simulator not initialized */
  1288. #define JET_errFileClose -102 /* Could not close file */
  1289. #define JET_errOutOfThreads -103 /* Could not start thread */
  1290. #define JET_errTooManyIO -105 /* System busy due to too many IOs */
  1291. #define JET_errTaskDropped -106 /* A requested async task could not be executed */
  1292. #define JET_errInternalError -107 /* Fatal internal error */
  1293. // BUFFER MANAGER errors
  1294. //
  1295. #define wrnBFCacheMiss 200 /* ese97,esent only: page latch caused a cache miss */
  1296. #define errBFPageNotCached -201 /* page is not cached */
  1297. #define errBFLatchConflict -202 /* page latch conflict */
  1298. #define errBFPageCached -203 /* page is cached */
  1299. #define wrnBFPageFlushPending 204 /* page is currently being written */
  1300. #define wrnBFPageFault 205 /* page latch caused a page fault */
  1301. #define wrnBFBadLatchHint 206 /* page latch hint was incorrect */
  1302. #define errBFIPageEvicted -250 /* ese97,esent only: page evicted from the cache */
  1303. #define errBFIPageCached -251 /* ese97,esent only: page already cached */
  1304. #define errBFIOutOfOLPs -252 /* ese97,esent only: out of OLPs */
  1305. #define errBFIOutOfBatchIOBuffers -253 /* ese97,esent only: out of Batch I/O Buffers */
  1306. #define errBFINoBufferAvailable -254 /* no buffer available for immediate use */
  1307. #define JET_errDatabaseBufferDependenciesCorrupted -255 /* Buffer dependencies improperly set. Recovery failure */
  1308. #define errBFIRemainingDependencies -256 /* dependencies remain on this buffer */
  1309. #define errBFIPageFlushPending -257 /* page is currently being written */
  1310. #define errBFIPageNotEvicted -258 /* the page could not be evicted from the cache */
  1311. #define errBFIPageFlushed -259 /* page write initiated */
  1312. #define errBFIPageFaultPending -260 /* page is currently being read */
  1313. #define errBFIPageNotVerified -261 /* page data has not been verified */
  1314. #define errBFIDependentPurged -262 /* page cannot be flushed due to purged dependencies */
  1315. // VERSION STORE errors
  1316. //
  1317. #define wrnVERRCEMoved 275 /* RCE was moved instead of being cleaned */
  1318. /* DIRECTORY MANAGER errors
  1319. /**/
  1320. #define errPMOutOfPageSpace -300 /* Out of page space */
  1321. #define errPMItagTooBig -301 /* Itag too big */ // XXX -- to be deleted
  1322. #define errPMRecDeleted -302 /* Record deleted */ // XXX -- to be deleted
  1323. #define errPMTagsUsedUp -303 /* Tags used up */ // XXX -- to be deleted
  1324. #define wrnBMConflict 304 /* conflict in BM Clean up */
  1325. #define errDIRNoShortCircuit -305 /* No Short Circuit Avail */
  1326. #define errDIRCannotSplit -306 /* Cannot horizontally split FDP */
  1327. #define errDIRTop -307 /* Cannot go up */
  1328. #define errDIRFDP 308 /* On an FDP Node */
  1329. #define errDIRNotSynchronous -309 /* May have left critical section */
  1330. #define wrnDIREmptyPage 310 /* Moved through empty page */
  1331. #define errSPConflict -311 /* Device extent being extended */
  1332. #define wrnNDFoundLess 312 /* Found Less */
  1333. #define wrnNDFoundGreater 313 /* Found Greater */
  1334. #define wrnNDNotFoundInPage 314 /* for smart refresh */
  1335. #define errNDNotFound -312 /* Not found */
  1336. #define errNDOutSonRange -314 /* Son out of range */
  1337. #define errNDOutItemRange -315 /* Item out of range */
  1338. #define errNDGreaterThanAllItems -316 /* Greater than all items */
  1339. #define errNDLastItemNode -317 /* Last node of item list */
  1340. #define errNDFirstItemNode -318 /* First node of item list */
  1341. #define wrnNDDuplicateItem 319 /* Duplicated Item */
  1342. #define errNDNoItem -320 /* Item not there */
  1343. #define JET_wrnRemainingVersions 321 /* The version store is still active */
  1344. #define JET_errPreviousVersion -322 /* Version already existed. Recovery failure */
  1345. #define JET_errPageBoundary -323 /* Reached Page Boundary */
  1346. #define JET_errKeyBoundary -324 /* Reached Key Boundary */
  1347. #define errDIRInPageFather -325 /* sridFather in page to free */
  1348. #define errBMMaxKeyInPage -326 /* used by OLC to avoid cleanup of parent pages */
  1349. #define JET_errBadPageLink -327 /* Database corrupted */
  1350. #define JET_errBadBookmark -328 /* Bookmark has no corresponding address in database */
  1351. #define wrnBMCleanNullOp 329 // BMClean returns this on encountering a page
  1352. // deleted MaxKeyInPage [but there was no conflict]
  1353. #define errBTOperNone -330 // Split with no accompanying
  1354. // insert/replace
  1355. #define errSPOutOfAvailExtCacheSpace -331 // unable to make update to AvailExt tree since
  1356. // in-cursor space cache is depleted
  1357. #define errSPOutOfOwnExtCacheSpace -332 // unable to make update to OwnExt tree since
  1358. // in-cursor space cache is depleted
  1359. #define wrnBTMultipageOLC 333 // needs multipage OLC operation
  1360. #define JET_errNTSystemCallFailed -334 /* A call to the operating system failed */
  1361. #define wrnBTShallowTree 335 // BTree is only one or two levels deeps
  1362. #define errBTMergeNotSynchronous -336 // Multiple threads attempting to perform merge/split on same page (likely OLD vs. RCEClean)
  1363. #define wrnSPReservedPages 337 // space manager reserved pages for future space tree splits
  1364. #define JET_errBadParentPageLink -338 /* Database corrupted */
  1365. #define wrnSPBuildAvailExtCache 339 // AvailExt tree is sufficiently large that it should be cached
  1366. #define JET_errSPAvailExtCacheOutOfSync -340 // AvailExt cache doesn't match btree
  1367. #define JET_errSPAvailExtCorrupted -341 // AvailExt space tree is corrupt
  1368. #define JET_errSPAvailExtCacheOutOfMemory -342 // Out of memory allocating an AvailExt cache node
  1369. #define JET_errSPOwnExtCorrupted -343 // OwnExt space tree is corrupt
  1370. #define JET_errDbTimeCorrupted -344 // Dbtime on current page is greater than global database dbtime
  1371. #define JET_wrnUniqueKey 345 // seek on non-unique index yielded a unique key
  1372. /* RECORD MANAGER errors
  1373. /**/
  1374. #define wrnFLDKeyTooBig 400 /* Key too big (truncated it) */
  1375. #define errFLDTooManySegments -401 /* Too many key segments */
  1376. #define wrnFLDNullKey 402 /* Key is entirely NULL */
  1377. #define wrnFLDOutOfKeys 403 /* No more keys to extract */
  1378. #define wrnFLDNullSeg 404 /* Null segment in key */
  1379. #define wrnFLDNotPresentInIndex 405
  1380. #define JET_wrnSeparateLongValue 406 /* Column is a separated long-value */
  1381. #define wrnRECLongField 407 /* Long value */
  1382. #define JET_wrnRecordFoundGreater JET_wrnSeekNotEqual
  1383. #define JET_wrnRecordFoundLess JET_wrnSeekNotEqual
  1384. #define JET_errColumnIllegalNull JET_errNullInvalid
  1385. #define wrnFLDNullFirstSeg 408 /* Null first segment in key */
  1386. #define JET_errKeyTooBig -408 /* Key is too large */
  1387. #define wrnRECUserDefinedDefault 409 /* User-defined default value */
  1388. #define wrnRECSeparatedLV 410 /* LV stored in LV tree */
  1389. #define wrnRECIntrinsicLV 411 /* LV stored in the record */
  1390. #define wrnRECSeparatedSLV 412 /* SLV stored as a separated LV */
  1391. #define wrnRECIntrinsicSLV 413 /* SLV stored as an intrinsic LV */
  1392. #define wrnFLDIndexUpdated 414 // index update performed
  1393. #define wrnFLDOutOfTuples 415 // no more tuples for current string
  1394. /* LOGGING/RECOVERY errors
  1395. /**/
  1396. #define JET_errInvalidLoggedOperation -500 /* Logged operation cannot be redone */
  1397. #define JET_errLogFileCorrupt -501 /* Log file is corrupt */
  1398. #define errLGNoMoreRecords -502 /* Last log record read */
  1399. #define JET_errNoBackupDirectory -503 /* No backup directory given */
  1400. #define JET_errBackupDirectoryNotEmpty -504 /* The backup directory is not emtpy */
  1401. #define JET_errBackupInProgress -505 /* Backup is active already */
  1402. #define JET_errRestoreInProgress -506 /* Restore in progress */
  1403. #define JET_errMissingPreviousLogFile -509 /* Missing the log file for check point */
  1404. #define JET_errLogWriteFail -510 /* Failure writing to log file */
  1405. #define JET_errLogDisabledDueToRecoveryFailure -511 /* Try to log something after recovery faild */
  1406. #define JET_errCannotLogDuringRecoveryRedo -512 /* Try to log something during recovery redo */
  1407. #define JET_errLogGenerationMismatch -513 /* Name of logfile does not match internal generation number */
  1408. #define JET_errBadLogVersion -514 /* Version of log file is not compatible with Jet version */
  1409. #define JET_errInvalidLogSequence -515 /* Timestamp in next log does not match expected */
  1410. #define JET_errLoggingDisabled -516 /* Log is not active */
  1411. #define JET_errLogBufferTooSmall -517 /* Log buffer is too small for recovery */
  1412. #define errLGNotSynchronous -518 /* retry to LGLogRec */
  1413. #define JET_errLogSequenceEnd -519 /* Maximum log file number exceeded */
  1414. #define JET_errNoBackup -520 /* No backup in progress */
  1415. #define JET_errInvalidBackupSequence -521 /* Backup call out of sequence */
  1416. #define JET_errBackupNotAllowedYet -523 /* Cannot do backup now */
  1417. #define JET_errDeleteBackupFileFail -524 /* Could not delete backup file */
  1418. #define JET_errMakeBackupDirectoryFail -525 /* Could not make backup temp directory */
  1419. #define JET_errInvalidBackup -526 /* Cannot perform incremental backup when circular logging enabled */
  1420. #define JET_errRecoveredWithErrors -527 /* Restored with errors */
  1421. #define JET_errMissingLogFile -528 /* Current log file missing */
  1422. #define JET_errLogDiskFull -529 /* Log disk full */
  1423. #define JET_errBadLogSignature -530 /* Bad signature for a log file */
  1424. #define JET_errBadDbSignature -531 /* Bad signature for a db file */
  1425. #define JET_errBadCheckpointSignature -532 /* Bad signature for a checkpoint file */
  1426. #define JET_errCheckpointCorrupt -533 /* Checkpoint file not found or corrupt */
  1427. #define JET_errMissingPatchPage -534 /* Patch file page not found during recovery */
  1428. #define JET_errBadPatchPage -535 /* Patch file page is not valid */
  1429. #define JET_errRedoAbruptEnded -536 /* Redo abruptly ended due to sudden failure in reading logs from log file */
  1430. #define JET_errBadSLVSignature -537 /* Signature in SLV file does not agree with database */
  1431. #define JET_errPatchFileMissing -538 /* Hard restore detected that patch file is missing from backup set */
  1432. #define JET_errDatabaseLogSetMismatch -539 /* Database does not belong with the current set of log files */
  1433. #define JET_errDatabaseStreamingFileMismatch -540 /* Database and streaming file do not match each other */
  1434. #define JET_errLogFileSizeMismatch -541 /* actual log file size does not match JET_paramLogFileSize */
  1435. #define JET_errCheckpointFileNotFound -542 /* Could not locate checkpoint file */
  1436. #define JET_errRequiredLogFilesMissing -543 /* The required log files for recovery is missing. */
  1437. #define JET_errSoftRecoveryOnBackupDatabase -544 /* Soft recovery is intended on a backup database. Restore should be used instead */
  1438. #define JET_errLogFileSizeMismatchDatabasesConsistent -545 /* databases have been recovered, but the log file size used during recovery does not match JET_paramLogFileSize */
  1439. #define JET_errLogSectorSizeMismatch -546 /* the log file sector size does not match the current volume's sector size */
  1440. #define JET_errLogSectorSizeMismatchDatabasesConsistent -547 /* databases have been recovered, but the log file sector size (used during recovery) does not match the current volume's sector size */
  1441. #define JET_errLogSequenceEndDatabasesConsistent -548 /* databases have been recovered, but all possible log generations in the current sequence are used; delete all log files and the checkpoint file and backup the databases before continuing */
  1442. #define JET_errStreamingDataNotLogged -549 /* Illegal attempt to replay a streaming file operation where the data wasn't logged. Probably caused by an attempt to roll-forward with circular logging enabled */
  1443. #define JET_errDatabaseDirtyShutdown -550 /* Database was not shutdown cleanly. Recovery must first be run to properly complete database operations for the previous shutdown. */
  1444. #define JET_errDatabaseInconsistent JET_errDatabaseDirtyShutdown /* OBSOLETE */
  1445. #define JET_errConsistentTimeMismatch -551 /* Database last consistent time unmatched */
  1446. #define JET_errDatabasePatchFileMismatch -552 /* Patch file is not generated from this backup */
  1447. #define JET_errEndingRestoreLogTooLow -553 /* The starting log number too low for the restore */
  1448. #define JET_errStartingRestoreLogTooHigh -554 /* The starting log number too high for the restore */
  1449. #define JET_errGivenLogFileHasBadSignature -555 /* Restore log file has bad signature */
  1450. #define JET_errGivenLogFileIsNotContiguous -556 /* Restore log file is not contiguous */
  1451. #define JET_errMissingRestoreLogFiles -557 /* Some restore log files are missing */
  1452. #define JET_wrnExistingLogFileHasBadSignature 558 /* Existing log file has bad signature */
  1453. #define JET_wrnExistingLogFileIsNotContiguous 559 /* Existing log file is not contiguous */
  1454. #define JET_errMissingFullBackup -560 /* The database miss a previous full backup befor incremental backup */
  1455. #define JET_errBadBackupDatabaseSize -561 /* The backup database size is not in 4k */
  1456. #define JET_errDatabaseAlreadyUpgraded -562 /* Attempted to upgrade a database that is already current */
  1457. #define JET_errDatabaseIncompleteUpgrade -563 /* Attempted to use a database which was only partially converted to the current format -- must restore from backup */
  1458. #define JET_wrnSkipThisRecord 564 /* INTERNAL ERROR */
  1459. #define JET_errMissingCurrentLogFiles -565 /* Some current log files are missing for continous restore */
  1460. #define JET_errDbTimeTooOld -566 /* dbtime on page smaller than dbtimeBefore in record */
  1461. #define JET_errDbTimeTooNew -567 /* dbtime on page in advence of the dbtimeBefore in record */
  1462. #define wrnCleanedUpMismatchedFiles 568 /* INTERNAL WARNING: indicates that the redo function cleaned up logs/checkpoint because of a size mismatch (see JET_paramCleanupMismatchedLogFiles) */
  1463. #define JET_errMissingFileToBackup -569 /* Some log or patch files are missing during backup */
  1464. #define JET_errLogTornWriteDuringHardRestore -570 /* torn-write was detected in a backup set during hard restore */
  1465. #define JET_errLogTornWriteDuringHardRecovery -571 /* torn-write was detected during hard recovery (log was not part of a backup set) */
  1466. #define JET_errLogCorruptDuringHardRestore -573 /* corruption was detected in a backup set during hard restore */
  1467. #define JET_errLogCorruptDuringHardRecovery -574 /* corruption was detected during hard recovery (log was not part of a backup set) */
  1468. #define JET_errMustDisableLoggingForDbUpgrade -575 /* Cannot have logging enabled while attempting to upgrade db */
  1469. #define errLGRecordDataInaccessible -576 /* an incomplete log record was created because all the data to be logged was not accessible */
  1470. #define JET_errBadRestoreTargetInstance -577 /* TargetInstance specified for restore is not found or log files don't match */
  1471. #define JET_wrnTargetInstanceRunning 578 /* TargetInstance specified for restore is running */
  1472. #define JET_errDatabasesNotFromSameSnapshot -580 /* Databases to be restored are not from the same shadow copy backup */
  1473. #define JET_errSoftRecoveryOnSnapshot -581 /* Soft recovery on a database from a shadow copy backup set */
  1474. #define JET_wrnDatabaseRepaired 595 /* Database corruption has been repaired */
  1475. #define JET_errUnicodeTranslationBufferTooSmall -601 /* Unicode translation buffer too small */
  1476. #define JET_errUnicodeTranslationFail -602 /* Unicode normalization failed */
  1477. #define JET_errUnicodeNormalizationNotSupported -603 /* OS does not provide support for Unicode normalisation (and no normalisation callback was specified) */
  1478. #define JET_errExistingLogFileHasBadSignature -610 /* Existing log file has bad signature */
  1479. #define JET_errExistingLogFileIsNotContiguous -611 /* Existing log file is not contiguous */
  1480. #define JET_errLogReadVerifyFailure -612 /* Checksum error in log file during backup */
  1481. #define JET_errSLVReadVerifyFailure -613 /* Checksum error in SLV file during backup */
  1482. #define JET_errCheckpointDepthTooDeep -614 // too many outstanding generations between checkpoint and current generation
  1483. #define JET_errRestoreOfNonBackupDatabase -615 // hard recovery attempted on a database that wasn't a backup database
  1484. #define errBackupAbortByCaller -800 /* INTERNAL ERROR: Backup was aborted by client or RPC connection with client failed */
  1485. #define JET_errBackupAbortByServer -801 /* Backup was aborted by server by calling JetTerm with JET_bitTermStopBackup or by calling JetStopBackup */
  1486. #define JET_errInvalidGrbit -900 /* Invalid parameter */
  1487. #define JET_errTermInProgress -1000 /* Termination in progress */
  1488. #define JET_errFeatureNotAvailable -1001 /* API not supported */
  1489. #define JET_errInvalidName -1002 /* Invalid name */
  1490. #define JET_errInvalidParameter -1003 /* Invalid API parameter */
  1491. #define JET_wrnColumnNull 1004 /* Column is NULL-valued */
  1492. #define JET_wrnBufferTruncated 1006 /* Buffer too small for data */
  1493. #define JET_wrnDatabaseAttached 1007 /* Database is already attached */
  1494. #define JET_errDatabaseFileReadOnly -1008 /* Tried to attach a read-only database file for read/write operations */
  1495. #define JET_wrnSortOverflow 1009 /* Sort does not fit in memory */
  1496. #define JET_errInvalidDatabaseId -1010 /* Invalid database id */
  1497. #define JET_errOutOfMemory -1011 /* Out of Memory */
  1498. #define JET_errOutOfDatabaseSpace -1012 /* Maximum database size reached */
  1499. #define JET_errOutOfCursors -1013 /* Out of table cursors */
  1500. #define JET_errOutOfBuffers -1014 /* Out of database page buffers */
  1501. #define JET_errTooManyIndexes -1015 /* Too many indexes */
  1502. #define JET_errTooManyKeys -1016 /* Too many columns in an index */
  1503. #define JET_errRecordDeleted -1017 /* Record has been deleted */
  1504. #define JET_errReadVerifyFailure -1018 /* Checksum error on a database page */
  1505. #define JET_errPageNotInitialized -1019 /* Blank database page */
  1506. #define JET_errOutOfFileHandles -1020 /* Out of file handles */
  1507. #define JET_errDiskIO -1022 /* Disk IO error */
  1508. #define JET_errInvalidPath -1023 /* Invalid file path */
  1509. #define JET_errInvalidSystemPath -1024 /* Invalid system path */
  1510. #define JET_errInvalidLogDirectory -1025 /* Invalid log directory */
  1511. #define JET_errRecordTooBig -1026 /* Record larger than maximum size */
  1512. #define JET_errTooManyOpenDatabases -1027 /* Too many open databases */
  1513. #define JET_errInvalidDatabase -1028 /* Not a database file */
  1514. #define JET_errNotInitialized -1029 /* Database engine not initialized */
  1515. #define JET_errAlreadyInitialized -1030 /* Database engine already initialized */
  1516. #define JET_errInitInProgress -1031 /* Database engine is being initialized */
  1517. #define JET_errFileAccessDenied -1032 /* Cannot access file, the file is locked or in use */
  1518. #define JET_errQueryNotSupported -1034 /* Query support unavailable */ // XXX -- to be deleted
  1519. #define JET_errSQLLinkNotSupported -1035 /* SQL Link support unavailable */ // XXX -- to be deleted
  1520. #define JET_errBufferTooSmall -1038 /* Buffer is too small */
  1521. #define JET_wrnSeekNotEqual 1039 /* Exact match not found during seek */
  1522. #define JET_errTooManyColumns -1040 /* Too many columns defined */
  1523. #define JET_errContainerNotEmpty -1043 /* Container is not empty */
  1524. #define JET_errInvalidFilename -1044 /* Filename is invalid */
  1525. #define JET_errInvalidBookmark -1045 /* Invalid bookmark */
  1526. #define JET_errColumnInUse -1046 /* Column used in an index */
  1527. #define JET_errInvalidBufferSize -1047 /* Data buffer doesn't match column size */
  1528. #define JET_errColumnNotUpdatable -1048 /* Cannot set column value */
  1529. #define JET_errIndexInUse -1051 /* Index is in use */
  1530. #define JET_errLinkNotSupported -1052 /* Link support unavailable */
  1531. #define JET_errNullKeyDisallowed -1053 /* Null keys are disallowed on index */
  1532. #define JET_errNotInTransaction -1054 /* Operation must be within a transaction */
  1533. #define JET_wrnNoErrorInfo 1055 /* No extended error information */
  1534. #define JET_wrnNoIdleActivity 1058 /* No idle activity occured */
  1535. #define JET_errTooManyActiveUsers -1059 /* Too many active database users */
  1536. #define JET_errInvalidCountry -1061 /* Invalid or unknown country code */
  1537. #define JET_errInvalidLanguageId -1062 /* Invalid or unknown language id */
  1538. #define JET_errInvalidCodePage -1063 /* Invalid or unknown code page */
  1539. #define JET_errInvalidLCMapStringFlags -1064 /* Invalid flags for LCMapString() */
  1540. #define JET_errVersionStoreEntryTooBig -1065 /* Attempted to create a version store entry (RCE) larger than a version bucket */
  1541. #define JET_errVersionStoreOutOfMemoryAndCleanupTimedOut -1066 /* Version store out of memory (and cleanup attempt failed to complete) */
  1542. #define JET_wrnNoWriteLock 1067 /* No write lock at transaction level 0 */
  1543. #define JET_wrnColumnSetNull 1068 /* Column set to NULL-value */
  1544. #define JET_errVersionStoreOutOfMemory -1069 /* Version store out of memory (cleanup already attempted) */
  1545. #define JET_errCurrencyStackOutOfMemory -1070 /* UNUSED: lCSRPerfFUCB * g_lCursorsMax exceeded (XJET only) */
  1546. #define JET_errCannotIndex -1071 /* Cannot index escrow column or SLV column */
  1547. #define JET_errRecordNotDeleted -1072 /* Record has not been deleted */
  1548. #define JET_errTooManyMempoolEntries -1073 /* Too many mempool entries requested */
  1549. #define JET_errOutOfObjectIDs -1074 /* Out of btree ObjectIDs (perform offline defrag to reclaim freed/unused ObjectIds) */
  1550. #define JET_errOutOfLongValueIDs -1075 /* Long-value ID counter has reached maximum value. (perform offline defrag to reclaim free/unused LongValueIDs) */
  1551. #define JET_errOutOfAutoincrementValues -1076 /* Auto-increment counter has reached maximum value (offline defrag WILL NOT be able to reclaim free/unused Auto-increment values). */
  1552. #define JET_errOutOfDbtimeValues -1077 /* Dbtime counter has reached maximum value (perform offline defrag to reclaim free/unused Dbtime values) */
  1553. #define JET_errOutOfSequentialIndexValues -1078 /* Sequential index counter has reached maximum value (perform offline defrag to reclaim free/unused SequentialIndex values) */
  1554. #define JET_errRunningInOneInstanceMode -1080 /* Multi-instance call with single-instance mode enabled */
  1555. #define JET_errRunningInMultiInstanceMode -1081 /* Single-instance call with multi-instance mode enabled */
  1556. #define JET_errSystemParamsAlreadySet -1082 /* Global system parameters have already been set */
  1557. #define JET_errSystemPathInUse -1083 /* System path already used by another database instance */
  1558. #define JET_errLogFilePathInUse -1084 /* Logfile path already used by another database instance */
  1559. #define JET_errTempPathInUse -1085 /* Temp path already used by another database instance */
  1560. #define JET_errInstanceNameInUse -1086 /* Instance Name already in use */
  1561. #define JET_errInstanceUnavailable -1090 /* This instance cannot be used because it encountered a fatal error */
  1562. #define JET_errDatabaseUnavailable -1091 /* This database cannot be used because it encountered a fatal error */
  1563. #define JET_errInstanceUnavailableDueToFatalLogDiskFull -1092 /* This instance cannot be used because it encountered a log-disk-full error performing an operation (likely transaction rollback) that could not tolerate failure */
  1564. #define JET_errOutOfSessions -1101 /* Out of sessions */
  1565. #define JET_errWriteConflict -1102 /* Write lock failed due to outstanding write lock */
  1566. #define JET_errTransTooDeep -1103 /* Transactions nested too deeply */
  1567. #define JET_errInvalidSesid -1104 /* Invalid session handle */
  1568. #define JET_errWriteConflictPrimaryIndex -1105 /* Update attempted on uncommitted primary index */
  1569. #define JET_errInTransaction -1108 /* Operation not allowed within a transaction */
  1570. #define JET_errRollbackRequired -1109 /* Must rollback current transaction -- cannot commit or begin a new one */
  1571. #define JET_errTransReadOnly -1110 /* Read-only transaction tried to modify the database */
  1572. #define JET_errSessionWriteConflict -1111 /* Attempt to replace the same record by two diffrerent cursors in the same session */
  1573. #define JET_errRecordTooBigForBackwardCompatibility -1112 /* record would be too big if represented in a database format from a previous version of Jet */
  1574. #define JET_errCannotMaterializeForwardOnlySort -1113 /* The temp table could not be created due to parameters that conflict with JET_bitTTForwardOnly */
  1575. #define JET_errMustCommitDistributedTransactionToLevel0 -1150 /* Attempted to PrepareToCommit a distributed transaction to non-zero level */
  1576. #define JET_errDistributedTransactionAlreadyPreparedToCommit -1151 /* Attempted a write-operation after a distributed transaction has called PrepareToCommit */
  1577. #define JET_errNotInDistributedTransaction -1152 /* Attempted to PrepareToCommit a non-distributed transaction */
  1578. #define JET_errDistributedTransactionNotYetPreparedToCommit -1153 /* Attempted to commit a distributed transaction, but PrepareToCommit has not yet been called */
  1579. #define JET_errCannotNestDistributedTransactions -1154 /* Attempted to begin a distributed transaction when not at level 0 */
  1580. #define JET_errDTCMissingCallback -1160 /* Attempted to begin a distributed transaction but no callback for DTC coordination was specified on initialisation */
  1581. #define JET_errDTCMissingCallbackOnRecovery -1161 /* Attempted to recover a distributed transaction but no callback for DTC coordination was specified on initialisation */
  1582. #define JET_errDTCCallbackUnexpectedError -1162 /* Unexpected error code returned from DTC callback */
  1583. #define JET_wrnDTCCommitTransaction 1163 /* Warning code DTC callback should return if the specified transaction is to be committed */
  1584. #define JET_wrnDTCRollbackTransaction 1164 /* Warning code DTC callback should return if the specified transaction is to be rolled back */
  1585. #define JET_errDatabaseDuplicate -1201 /* Database already exists */
  1586. #define JET_errDatabaseInUse -1202 /* Database in use */
  1587. #define JET_errDatabaseNotFound -1203 /* No such database */
  1588. #define JET_errDatabaseInvalidName -1204 /* Invalid database name */
  1589. #define JET_errDatabaseInvalidPages -1205 /* Invalid number of pages */
  1590. #define JET_errDatabaseCorrupted -1206 /* Non database file or corrupted db */
  1591. #define JET_errDatabaseLocked -1207 /* Database exclusively locked */
  1592. #define JET_errCannotDisableVersioning -1208 /* Cannot disable versioning for this database */
  1593. #define JET_errInvalidDatabaseVersion -1209 /* Database engine is incompatible with database */
  1594. /* The following error code are for NT clients only. It will return such error during
  1595. * JetInit if JET_paramCheckFormatWhenOpenFail is set.
  1596. */
  1597. #define JET_errDatabase200Format -1210 /* The database is in an older (200) format */
  1598. #define JET_errDatabase400Format -1211 /* The database is in an older (400) format */
  1599. #define JET_errDatabase500Format -1212 /* The database is in an older (500) format */
  1600. #define JET_errPageSizeMismatch -1213 /* The database page size does not match the engine */
  1601. #define JET_errTooManyInstances -1214 /* Cannot start any more database instances */
  1602. #define JET_errDatabaseSharingViolation -1215 /* A different database instance is using this database */
  1603. #define JET_errAttachedDatabaseMismatch -1216 /* An outstanding database attachment has been detected at the start or end of recovery, but database is missing or does not match attachment info */
  1604. #define JET_errDatabaseInvalidPath -1217 /* Specified path to database file is illegal */
  1605. #define JET_errDatabaseIdInUse -1218 /* A database is being assigned an id already in use */
  1606. #define JET_errForceDetachNotAllowed -1219 /* Force Detach allowed only after normal detach errored out */
  1607. #define JET_errCatalogCorrupted -1220 /* Corruption detected in catalog */
  1608. #define JET_errPartiallyAttachedDB -1221 /* Database is partially attached. Cannot complete attach operation */
  1609. #define JET_errDatabaseSignInUse -1222 /* Database with same signature in use */
  1610. #define errSkippedDbHeaderUpdate -1223 /* some db header weren't update becase there were during detach */
  1611. #define JET_wrnTableEmpty 1301 /* Opened an empty table */
  1612. #define JET_errTableLocked -1302 /* Table is exclusively locked */
  1613. #define JET_errTableDuplicate -1303 /* Table already exists */
  1614. #define JET_errTableInUse -1304 /* Table is in use, cannot lock */
  1615. #define JET_errObjectNotFound -1305 /* No such table or object */
  1616. #define JET_errDensityInvalid -1307 /* Bad file/index density */
  1617. #define JET_errTableNotEmpty -1308 /* Table is not empty */
  1618. #define JET_errInvalidTableId -1310 /* Invalid table id */
  1619. #define JET_errTooManyOpenTables -1311 /* Cannot open any more tables (cleanup already attempted) */
  1620. #define JET_errIllegalOperation -1312 /* Oper. not supported on table */
  1621. #define JET_errTooManyOpenTablesAndCleanupTimedOut -1313 /* Cannot open any more tables (cleanup attempt failed to complete) */
  1622. #define JET_errObjectDuplicate -1314 /* Table or object name in use */
  1623. #define JET_errInvalidObject -1316 /* Object is invalid for operation */
  1624. #define JET_errCannotDeleteTempTable -1317 /* Use CloseTable instead of DeleteTable to delete temp table */
  1625. #define JET_errCannotDeleteSystemTable -1318 /* Illegal attempt to delete a system table */
  1626. #define JET_errCannotDeleteTemplateTable -1319 /* Illegal attempt to delete a template table */
  1627. #define errFCBTooManyOpen -1320 /* Cannot open any more FCB's (cleanup not yet attempted) */
  1628. #define errFCBAboveThreshold -1321 /* Can only allocate FCB above preferred threshold (cleanup not yet attempted) */
  1629. #define JET_errExclusiveTableLockRequired -1322 /* Must have exclusive lock on table. */
  1630. #define JET_errFixedDDL -1323 /* DDL operations prohibited on this table */
  1631. #define JET_errFixedInheritedDDL -1324 /* On a derived table, DDL operations are prohibited on inherited portion of DDL */
  1632. #define JET_errCannotNestDDL -1325 /* Nesting of hierarchical DDL is not currently supported. */
  1633. #define JET_errDDLNotInheritable -1326 /* Tried to inherit DDL from a table not marked as a template table. */
  1634. #define JET_wrnTableInUseBySystem 1327 /* System cleanup has a cursor open on the table */
  1635. #define JET_errInvalidSettings -1328 /* System parameters were set improperly */
  1636. #define JET_errClientRequestToStopJetService -1329 /* Client has requested stop service */
  1637. #define JET_errCannotAddFixedVarColumnToDerivedTable -1330 /* Template table was created with NoFixedVarColumnsInDerivedTables */
  1638. #define errFCBExists -1331 /* Tried to create an FCB that already exists */
  1639. #define errFCBUnusable -1332 /* Placeholder to mark an FCB that must be purged as unusable */
  1640. #define wrnCATNoMoreRecords 1333 /* Attempted to navigate past the end of the catalog */
  1641. #define JET_errIndexCantBuild -1401 /* Index build failed */
  1642. #define JET_errIndexHasPrimary -1402 /* Primary index already defined */
  1643. #define JET_errIndexDuplicate -1403 /* Index is already defined */
  1644. #define JET_errIndexNotFound -1404 /* No such index */
  1645. #define JET_errIndexMustStay -1405 /* Cannot delete clustered index */
  1646. #define JET_errIndexInvalidDef -1406 /* Illegal index definition */
  1647. #define JET_errInvalidCreateIndex -1409 /* Invalid create index description */
  1648. #define JET_errTooManyOpenIndexes -1410 /* Out of index description blocks */
  1649. #define JET_errMultiValuedIndexViolation -1411 /* Non-unique inter-record index keys generated for a multivalued index */
  1650. #define JET_errIndexBuildCorrupted -1412 /* Failed to build a secondary index that properly reflects primary index */
  1651. #define JET_errPrimaryIndexCorrupted -1413 /* Primary index is corrupt. The database must be defragmented */
  1652. #define JET_errSecondaryIndexCorrupted -1414 /* Secondary index is corrupt. The database must be defragmented */
  1653. #define JET_wrnCorruptIndexDeleted 1415 /* Out of date index removed */
  1654. #define JET_errInvalidIndexId -1416 /* Illegal index id */
  1655. #define JET_errIndexTuplesSecondaryIndexOnly -1430 // tuple index can only be on a secondary index
  1656. #define JET_errIndexTuplesOneColumnOnly -1431 // tuple index may only have one column in the index
  1657. #define JET_errIndexTuplesNonUniqueOnly -1432 // tuple index must be a non-unique index
  1658. #define JET_errIndexTuplesTextColumnsOnly -1433 // tuple index must be on a text column
  1659. #define JET_errIndexTuplesVarSegMacNotAllowed -1434 // tuple index does not allow setting cbVarSegMac
  1660. #define JET_errIndexTuplesInvalidLimits -1435 // invalid min/max tuple length or max characters to index specified
  1661. #define JET_errIndexTuplesCannotRetrieveFromIndex -1436 // cannot call RetrieveColumn() with RetrieveFromIndex on a tuple index
  1662. #define JET_errIndexTuplesKeyTooSmall -1437 // specified key does not meet minimum tuple length
  1663. #define JET_errColumnLong -1501 /* Column value is long */
  1664. #define JET_errColumnNoChunk -1502 /* No such chunk in long value */
  1665. #define JET_errColumnDoesNotFit -1503 /* Field will not fit in record */
  1666. #define JET_errNullInvalid -1504 /* Null not valid */
  1667. #define JET_errColumnIndexed -1505 /* Column indexed, cannot delete */
  1668. #define JET_errColumnTooBig -1506 /* Field length is greater than maximum */
  1669. #define JET_errColumnNotFound -1507 /* No such column */
  1670. #define JET_errColumnDuplicate -1508 /* Field is already defined */
  1671. #define JET_errMultiValuedColumnMustBeTagged -1509 /* Attempted to create a multi-valued column, but column was not Tagged */
  1672. #define JET_errColumnRedundant -1510 /* Second autoincrement or version column */
  1673. #define JET_errInvalidColumnType -1511 /* Invalid column data type */
  1674. #define JET_wrnColumnMaxTruncated 1512 /* Max length too big, truncated */
  1675. #define JET_errTaggedNotNULL -1514 /* No non-NULL tagged columns */
  1676. #define JET_errNoCurrentIndex -1515 /* Invalid w/o a current index */
  1677. #define JET_errKeyIsMade -1516 /* The key is completely made */
  1678. #define JET_errBadColumnId -1517 /* Column Id Incorrect */
  1679. #define JET_errBadItagSequence -1518 /* Bad itagSequence for tagged column */
  1680. #define JET_errColumnInRelationship -1519 /* Cannot delete, column participates in relationship */
  1681. #define JET_wrnCopyLongValue 1520 /* Single instance column bursted */
  1682. #define JET_errCannotBeTagged -1521 /* AutoIncrement and Version cannot be tagged */
  1683. #define wrnLVNoLongValues 1522 /* Table does not have a long value tree */
  1684. #define JET_wrnTaggedColumnsRemaining 1523 /* RetrieveTaggedColumnList ran out of copy buffer before retrieving all tagged columns */
  1685. #define JET_errDefaultValueTooBig -1524 /* Default value exceeds maximum size */
  1686. #define JET_errMultiValuedDuplicate -1525 /* Duplicate detected on a unique multi-valued column */
  1687. #define JET_errLVCorrupted -1526 /* Corruption encountered in long-value tree */
  1688. #define wrnLVNoMoreData 1527 /* Reached end of LV data */
  1689. #define JET_errMultiValuedDuplicateAfterTruncation -1528 /* Duplicate detected on a unique multi-valued column after data was normalized, and normalizing truncated the data before comparison */
  1690. #define JET_errDerivedColumnCorruption -1529 /* Invalid column in derived table */
  1691. #define JET_errInvalidPlaceholderColumn -1530 /* Tried to convert column to a primary index placeholder, but column doesn't meet necessary criteria */
  1692. #define JET_wrnColumnSkipped 1531 /* Column value(s) not returned because the corresponding column id or itagSequence requested for enumeration was null */
  1693. #define JET_wrnColumnNotLocal 1532 /* Column value(s) not returned because they could not be reconstructed from the data at hand */
  1694. #define JET_wrnColumnMoreTags 1533 /* Column values exist that were not requested for enumeration */
  1695. #define JET_wrnColumnTruncated 1534 /* Column value truncated at the requested size limit during enumeration */
  1696. #define JET_wrnColumnPresent 1535 /* Column values exist but were not returned by request */
  1697. #define JET_wrnColumnSingleValue 1536 /* Column value returned in JET_COLUMNENUM as a result of JET_bitEnumerateCompressOutput */
  1698. #define JET_errRecordNotFound -1601 /* The key was not found */
  1699. #define JET_errRecordNoCopy -1602 /* No working buffer */
  1700. #define JET_errNoCurrentRecord -1603 /* Currency not on a record */
  1701. #define JET_errRecordPrimaryChanged -1604 /* Primary key may not change */
  1702. #define JET_errKeyDuplicate -1605 /* Illegal duplicate key */
  1703. #define JET_errAlreadyPrepared -1607 /* Attempted to update record when record update was already in progress */
  1704. #define JET_errKeyNotMade -1608 /* No call to JetMakeKey */
  1705. #define JET_errUpdateNotPrepared -1609 /* No call to JetPrepareUpdate */
  1706. #define JET_wrnDataHasChanged 1610 /* Data has changed */
  1707. #define JET_errDataHasChanged -1611 /* Data has changed, operation aborted */
  1708. #define JET_wrnKeyChanged 1618 /* Moved to new key */
  1709. #define JET_errLanguageNotSupported -1619 /* WindowsNT installation does not support language */
  1710. #define JET_errTooManySorts -1701 /* Too many sort processes */
  1711. #define JET_errInvalidOnSort -1702 /* Invalid operation on Sort */
  1712. #define JET_errTempFileOpenError -1803 /* Temp file could not be opened */
  1713. #define JET_errTooManyAttachedDatabases -1805 /* Too many open databases */
  1714. #define JET_errDiskFull -1808 /* No space left on disk */
  1715. #define JET_errPermissionDenied -1809 /* Permission denied */
  1716. #define JET_errFileNotFound -1811 /* File not found */
  1717. #define JET_errFileInvalidType -1812 /* Invalid file type */
  1718. #define JET_wrnFileOpenReadOnly 1813 /* Database file is read only */
  1719. #define JET_errAfterInitialization -1850 /* Cannot Restore after init. */
  1720. #define JET_errLogCorrupted -1852 /* Logs could not be interpreted */
  1721. #define JET_errInvalidOperation -1906 /* Invalid operation */
  1722. #define JET_errAccessDenied -1907 /* Access denied */
  1723. #define JET_wrnIdleFull 1908 /* Idle registry full */
  1724. #define JET_errTooManySplits -1909 /* Infinite split */
  1725. #define JET_errSessionSharingViolation -1910 /* Multiple threads are using the same session */
  1726. #define JET_errEntryPointNotFound -1911 /* An entry point in a DLL we require could not be found */
  1727. #define JET_errSessionContextAlreadySet -1912 /* Specified session already has a session context set */
  1728. #define JET_errSessionContextNotSetByThisThread -1913 /* Tried to reset session context, but current thread did not orignally set the session context */
  1729. #define JET_errSessionInUse -1914 /* Tried to terminate session in use */
  1730. #define JET_errRecordFormatConversionFailed -1915 /* Internal error during dynamic record format conversion */
  1731. #define JET_errOneDatabasePerSession -1916 /* Just one open user database per session is allowed (JET_paramOneDatabasePerSession) */
  1732. #define JET_errRollbackError -1917 /* error during rollback */
  1733. #define JET_wrnDefragAlreadyRunning 2000 /* Online defrag already running on specified database */
  1734. #define JET_wrnDefragNotRunning 2001 /* Online defrag not running on specified database */
  1735. #define JET_wrnCallbackNotRegistered 2100 /* Unregistered a non-existant callback function */
  1736. #define JET_errCallbackFailed -2101 /* A callback failed */
  1737. #define JET_errCallbackNotResolved -2102 /* A callback function could not be found */
  1738. #define wrnSLVNoStreamingData 2200 /* Database does not have a streaming file */
  1739. #define JET_errSLVSpaceCorrupted -2201 /* Corruption encountered in space manager of streaming file */
  1740. #define JET_errSLVCorrupted -2202 /* Corruption encountered in streaming file */
  1741. #define JET_errSLVColumnDefaultValueNotAllowed -2203 /* SLV columns cannot have a default value */
  1742. #define JET_errSLVStreamingFileMissing -2204 /* Cannot find streaming file associated with this database */
  1743. #define JET_errSLVDatabaseMissing -2205 /* Streaming file exists, but database to which it belongs is missing */
  1744. #define JET_errSLVStreamingFileAlreadyExists -2206 /* Tried to create a streaming file when one already exists or is already recorded in the catalog */
  1745. #define JET_errSLVInvalidPath -2207 /* Specified path to a streaming file is invalid */
  1746. #define JET_errSLVStreamingFileNotCreated -2208 /* Tried to perform an SLV operation but streaming file was never created */
  1747. #define JET_errSLVStreamingFileReadOnly -2209 /* Attach a readonly streaming file for read/write operations */
  1748. #define JET_errSLVHeaderBadChecksum -2210 /* SLV file header failed checksum verification */
  1749. #define JET_errSLVHeaderCorrupted -2211 /* SLV file header contains invalid information */
  1750. #define wrnSLVNoFreePages 2212 /* No free pages in SLV space tree */
  1751. #define JET_errSLVPagesNotFree -2213 /* Tried to move pages from the Free state when they were not in that state */
  1752. #define JET_errSLVPagesNotReserved -2214 /* Tried to move pages from the Reserved state when they were not in that state */
  1753. #define JET_errSLVPagesNotCommitted -2215 /* Tried to move pages from the Committed state when they were not in that state */
  1754. #define JET_errSLVPagesNotDeleted -2216 /* Tried to move pages from the Deleted state when they were not in that state */
  1755. #define JET_errSLVSpaceWriteConflict -2217 /* Unexpected conflict detected trying to write-latch SLV space pages */
  1756. #define JET_errSLVRootStillOpen -2218 /* The database can not be created/attached because its corresponding SLV Root is still open by another process. */
  1757. #define JET_errSLVProviderNotLoaded -2219 /* The database can not be created/attached because the SLV Provider has not been loaded. */
  1758. #define JET_errSLVEAListCorrupt -2220 /* The specified SLV EA List is corrupted. */
  1759. #define JET_errSLVRootNotSpecified -2221 /* The database cannot be created/attached because the SLV Root Name was omitted */
  1760. #define JET_errSLVRootPathInvalid -2222 /* The specified SLV Root path was invalid. */
  1761. #define JET_errSLVEAListZeroAllocation -2223 /* The specified SLV EA List has no allocated space. */
  1762. #define JET_errSLVColumnCannotDelete -2224 /* Deletion of SLV columns is not currently supported. */
  1763. #define JET_errSLVOwnerMapAlreadyExists -2225 /* Tried to create a new catalog entry for SLV Ownership Map when one already exists */
  1764. #define JET_errSLVSpaceMapAlreadyExists -2225 /* OBSOLETE: Renamed to JET_errSLVOwnerMapCorrupted */
  1765. #define JET_errSLVOwnerMapCorrupted -2226 /* Corruption encountered in SLV Ownership Map */
  1766. #define JET_errSLVSpaceMapCorrupted -2226 /* OBSOLETE: Renamed to JET_errSLVOwnerMapCorrupted */
  1767. #define JET_errSLVOwnerMapPageNotFound -2227 /* Corruption encountered in SLV Ownership Map */
  1768. #define JET_errSLVSpaceMapPageNotFound -2227 /* OBSOLETE: Renamed to JET_errSLVOwnerMapPageNotFound */
  1769. #define wrnOLDSLVNothingToMove 2228 /* Nothing in the streaming file can be moved */
  1770. #define errOLDSLVUnableToMove -2228 /* Unable to move a SLV File in the streaming file */
  1771. #define JET_errSLVFileStale -2229 /* The specified SLV File handle belongs to a SLV Root that no longer exists. */
  1772. #define JET_errSLVFileInUse -2230 /* The specified SLV File is currently in use */
  1773. #define JET_errSLVStreamingFileInUse -2231 /* The specified streaming file is currently in use */
  1774. #define JET_errSLVFileIO -2232 /* An I/O error occurred while accessing an SLV File (general read / write failure) */
  1775. #define JET_errSLVStreamingFileFull -2233 /* No space left in the streaming file */
  1776. #define JET_errSLVFileInvalidPath -2234 /* Specified path to a SLV File was invalid */
  1777. #define JET_errSLVFileAccessDenied -2235 /* Cannot access SLV File, the SLV File is locked or is in use */
  1778. #define JET_errSLVFileNotFound -2236 /* The specified SLV File was not found */
  1779. #define JET_errSLVFileUnknown -2237 /* An unknown error occurred while accessing an SLV File */
  1780. #define JET_errSLVEAListTooBig -2238 /* The specified SLV EA List could not be returned because it is too large to fit in the standard EA format. Retrieve the SLV File as a file handle instead. */
  1781. #define JET_errSLVProviderVersionMismatch -2239 /* The loaded SLV Provider's version does not match the database engine's version. */
  1782. #define errSLVInvalidOwnerMapChecksum -2240 /* checksum in OwnerMap is invalid */
  1783. #define wrnSLVDatabaseHeader 2241 /* Checking the header of a streaming file */
  1784. #define errOLDSLVMoveStopped -2242 /* OLDSLV was stopped in the middle of a move */
  1785. #define JET_errSLVBufferTooSmall -2243 /* Buffer allocated for SLV data or meta-data was too small */
  1786. #define JET_errOSSnapshotInvalidSequence -2401 /* OS Shadow copy API used in an invalid sequence */
  1787. #define JET_errOSSnapshotTimeOut -2402 /* OS Shadow copy ended with time-out */
  1788. #define JET_errOSSnapshotNotAllowed -2403 /* OS Shadow copy not allowed (backup or recovery in progress) */
  1789. #define JET_errLSCallbackNotSpecified -3000 /* Attempted to use Local Storage without a callback function being specified */
  1790. #define JET_errLSAlreadySet -3001 /* Attempted to set Local Storage for an object which already had it set */
  1791. #define JET_errLSNotSet -3002 /* Attempted to retrieve Local Storage from an object which didn't have it set */
  1792. /** FILE ERRORS
  1793. **/
  1794. //JET_errFileAccessDenied -1032
  1795. //JET_errFileNotFound -1811
  1796. //JET_errInvalidFilename -1044
  1797. #define JET_errFileIOBeyondEOF -4001 /* a read was issued to a location beyond EOF (writes will expand the file) */
  1798. #define JET_errFileIOAbort -4002 /* instructs the JET_ABORTRETRYFAILCALLBACK caller to abort the specified I/O */
  1799. #define JET_errFileIORetry -4003 /* instructs the JET_ABORTRETRYFAILCALLBACK caller to retry the specified I/O */
  1800. #define JET_errFileIOFail -4004 /* instructs the JET_ABORTRETRYFAILCALLBACK caller to fail the specified I/O */
  1801. #define JET_errFileCompressed -4005 /* read/write access is not supported on compressed files */
  1802. /**********************************************************************/
  1803. /*********************** PROTOTYPES **************************/
  1804. /**********************************************************************/
  1805. #if !defined(_JET_NOPROTOTYPES)
  1806. #ifdef __cplusplus
  1807. extern "C" {
  1808. #endif
  1809. JET_ERR JET_API JetInit( JET_INSTANCE *pinstance);
  1810. JET_ERR JET_API JetInit2( JET_INSTANCE *pinstance, JET_GRBIT grbit );
  1811. JET_ERR JET_API JetInit3(
  1812. JET_INSTANCE *pinstance,
  1813. JET_RSTMAP *rgstmap,
  1814. long crstfilemap,
  1815. JET_GRBIT grbit );
  1816. JET_ERR JET_API JetCreateInstance( JET_INSTANCE *pinstance, const char * szInstanceName );
  1817. JET_ERR JET_API JetCreateInstance2(
  1818. JET_INSTANCE *pinstance,
  1819. const char * szInstanceName,
  1820. const char * szDisplayName,
  1821. JET_GRBIT grbit );
  1822. JET_ERR JET_API JetTerm( JET_INSTANCE instance );
  1823. JET_ERR JET_API JetTerm2( JET_INSTANCE instance, JET_GRBIT grbit );
  1824. JET_ERR JET_API JetStopService();
  1825. JET_ERR JET_API JetStopServiceInstance( JET_INSTANCE instance );
  1826. JET_ERR JET_API JetStopBackup();
  1827. JET_ERR JET_API JetStopBackupInstance( JET_INSTANCE instance );
  1828. JET_ERR JET_API JetSetSystemParameter(
  1829. JET_INSTANCE *pinstance,
  1830. JET_SESID sesid,
  1831. unsigned long paramid,
  1832. JET_API_PTR lParam,
  1833. const char *sz );
  1834. JET_ERR JET_API JetGetSystemParameter(
  1835. JET_INSTANCE instance,
  1836. JET_SESID sesid,
  1837. unsigned long paramid,
  1838. JET_API_PTR *plParam,
  1839. char *sz,
  1840. unsigned long cbMax );
  1841. JET_ERR JET_API JetEnableMultiInstance( JET_SETSYSPARAM * psetsysparam,
  1842. unsigned long csetsysparam,
  1843. unsigned long * pcsetsucceed);
  1844. JET_ERR JET_API JetResetCounter( JET_SESID sesid, long CounterType );
  1845. JET_ERR JET_API JetGetCounter( JET_SESID sesid, long CounterType, long *plValue );
  1846. JET_ERR JET_API JetBeginSession(
  1847. JET_INSTANCE instance,
  1848. JET_SESID *psesid,
  1849. const char *szUserName,
  1850. const char *szPassword );
  1851. JET_ERR JET_API JetDupSession( JET_SESID sesid, JET_SESID *psesid );
  1852. JET_ERR JET_API JetEndSession( JET_SESID sesid, JET_GRBIT grbit );
  1853. JET_ERR JET_API JetGetVersion( JET_SESID sesid, unsigned long *pwVersion );
  1854. JET_ERR JET_API JetIdle( JET_SESID sesid, JET_GRBIT grbit );
  1855. JET_ERR JET_API JetCreateDatabase(
  1856. JET_SESID sesid,
  1857. const char *szFilename,
  1858. const char *szConnect,
  1859. JET_DBID *pdbid,
  1860. JET_GRBIT grbit );
  1861. JET_ERR JET_API JetCreateDatabase2(
  1862. JET_SESID sesid,
  1863. const char *szFilename,
  1864. const unsigned long cpgDatabaseSizeMax,
  1865. JET_DBID *pdbid,
  1866. JET_GRBIT grbit );
  1867. JET_ERR JET_API JetCreateDatabaseWithStreaming(
  1868. JET_SESID sesid,
  1869. const char *szDbFileName,
  1870. const char *szSLVFileName,
  1871. const char *szSLVRootName,
  1872. const unsigned long cpgDatabaseSizeMax,
  1873. JET_DBID *pdbid,
  1874. JET_GRBIT grbit );
  1875. JET_ERR JET_API JetAttachDatabase(
  1876. JET_SESID sesid,
  1877. const char *szFilename,
  1878. JET_GRBIT grbit );
  1879. JET_ERR JET_API JetAttachDatabase2(
  1880. JET_SESID sesid,
  1881. const char *szFilename,
  1882. const unsigned long cpgDatabaseSizeMax,
  1883. JET_GRBIT grbit );
  1884. JET_ERR JET_API JetAttachDatabaseWithStreaming(
  1885. JET_SESID sesid,
  1886. const char *szDbFileName,
  1887. const char *szSLVFileName,
  1888. const char *szSLVRootName,
  1889. const unsigned long cpgDatabaseSizeMax,
  1890. JET_GRBIT grbit );
  1891. JET_ERR JET_API JetDetachDatabase(
  1892. JET_SESID sesid,
  1893. const char *szFilename );
  1894. JET_ERR JET_API JetDetachDatabase2(
  1895. JET_SESID sesid,
  1896. const char *szFilename,
  1897. JET_GRBIT grbit);
  1898. JET_ERR JET_API JetGetObjectInfo(
  1899. JET_SESID sesid,
  1900. JET_DBID dbid,
  1901. JET_OBJTYP objtyp,
  1902. const char *szContainerName,
  1903. const char *szObjectName,
  1904. void *pvResult,
  1905. unsigned long cbMax,
  1906. unsigned long InfoLevel );
  1907. JET_ERR JET_API JetGetTableInfo(
  1908. JET_SESID sesid,
  1909. JET_TABLEID tableid,
  1910. void *pvResult,
  1911. unsigned long cbMax,
  1912. unsigned long InfoLevel );
  1913. JET_ERR JET_API JetCreateTable(
  1914. JET_SESID sesid,
  1915. JET_DBID dbid,
  1916. const char *szTableName,
  1917. unsigned long lPages,
  1918. unsigned long lDensity,
  1919. JET_TABLEID *ptableid );
  1920. JET_ERR JET_API JetCreateTableColumnIndex(
  1921. JET_SESID sesid,
  1922. JET_DBID dbid,
  1923. JET_TABLECREATE *ptablecreate );
  1924. JET_ERR JET_API JetCreateTableColumnIndex2(
  1925. JET_SESID sesid,
  1926. JET_DBID dbid,
  1927. JET_TABLECREATE2 *ptablecreate );
  1928. JET_ERR JET_API JetDeleteTable(
  1929. JET_SESID sesid,
  1930. JET_DBID dbid,
  1931. const char *szTableName );
  1932. JET_ERR JET_API JetRenameTable(
  1933. JET_SESID sesid,
  1934. JET_DBID dbid,
  1935. const char *szName,
  1936. const char *szNameNew );
  1937. JET_ERR JET_API JetGetTableColumnInfo(
  1938. JET_SESID sesid,
  1939. JET_TABLEID tableid,
  1940. const char *szColumnName,
  1941. void *pvResult,
  1942. unsigned long cbMax,
  1943. unsigned long InfoLevel );
  1944. JET_ERR JET_API JetGetColumnInfo(
  1945. JET_SESID sesid,
  1946. JET_DBID dbid,
  1947. const char *szTableName,
  1948. const char *szColumnName,
  1949. void *pvResult,
  1950. unsigned long cbMax,
  1951. unsigned long InfoLevel );
  1952. JET_ERR JET_API JetAddColumn(
  1953. JET_SESID sesid,
  1954. JET_TABLEID tableid,
  1955. const char *szColumnName,
  1956. const JET_COLUMNDEF *pcolumndef,
  1957. const void *pvDefault,
  1958. unsigned long cbDefault,
  1959. JET_COLUMNID *pcolumnid );
  1960. JET_ERR JET_API JetDeleteColumn(
  1961. JET_SESID sesid,
  1962. JET_TABLEID tableid,
  1963. const char *szColumnName );
  1964. JET_ERR JET_API JetDeleteColumn2(
  1965. JET_SESID sesid,
  1966. JET_TABLEID tableid,
  1967. const char *szColumnName,
  1968. const JET_GRBIT grbit );
  1969. JET_ERR JET_API JetRenameColumn(
  1970. JET_SESID sesid,
  1971. JET_TABLEID tableid,
  1972. const char *szName,
  1973. const char *szNameNew,
  1974. JET_GRBIT grbit );
  1975. JET_ERR JET_API JetSetColumnDefaultValue(
  1976. JET_SESID sesid,
  1977. JET_DBID dbid,
  1978. const char *szTableName,
  1979. const char *szColumnName,
  1980. const void *pvData,
  1981. const unsigned long cbData,
  1982. const JET_GRBIT grbit );
  1983. JET_ERR JET_API JetGetTableIndexInfo(
  1984. JET_SESID sesid,
  1985. JET_TABLEID tableid,
  1986. const char *szIndexName,
  1987. void *pvResult,
  1988. unsigned long cbResult,
  1989. unsigned long InfoLevel );
  1990. JET_ERR JET_API JetGetIndexInfo(
  1991. JET_SESID sesid,
  1992. JET_DBID dbid,
  1993. const char *szTableName,
  1994. const char *szIndexName,
  1995. void *pvResult,
  1996. unsigned long cbResult,
  1997. unsigned long InfoLevel );
  1998. JET_ERR JET_API JetCreateIndex(
  1999. JET_SESID sesid,
  2000. JET_TABLEID tableid,
  2001. const char *szIndexName,
  2002. JET_GRBIT grbit,
  2003. const char *szKey,
  2004. unsigned long cbKey,
  2005. unsigned long lDensity );
  2006. JET_ERR JET_API JetCreateIndex2(
  2007. JET_SESID sesid,
  2008. JET_TABLEID tableid,
  2009. JET_INDEXCREATE *pindexcreate,
  2010. unsigned long cIndexCreate );
  2011. JET_ERR JET_API JetDeleteIndex(
  2012. JET_SESID sesid,
  2013. JET_TABLEID tableid,
  2014. const char *szIndexName );
  2015. JET_ERR JET_API JetBeginTransaction( JET_SESID sesid );
  2016. JET_ERR JET_API JetBeginTransaction2( JET_SESID sesid, JET_GRBIT grbit );
  2017. JET_ERR JET_API JetPrepareToCommitTransaction(
  2018. JET_SESID sesid,
  2019. const void * pvData,
  2020. unsigned long cbData,
  2021. JET_GRBIT grbit );
  2022. JET_ERR JET_API JetCommitTransaction( JET_SESID sesid, JET_GRBIT grbit );
  2023. JET_ERR JET_API JetRollback( JET_SESID sesid, JET_GRBIT grbit );
  2024. JET_ERR JET_API JetGetDatabaseInfo(
  2025. JET_SESID sesid,
  2026. JET_DBID dbid,
  2027. void *pvResult,
  2028. unsigned long cbMax,
  2029. unsigned long InfoLevel );
  2030. JET_ERR JET_API JetGetDatabaseFileInfo(
  2031. const char *szDatabaseName,
  2032. void *pvResult,
  2033. unsigned long cbMax,
  2034. unsigned long InfoLevel );
  2035. JET_ERR JET_API JetOpenDatabase(
  2036. JET_SESID sesid,
  2037. const char *szFilename,
  2038. const char *szConnect,
  2039. JET_DBID *pdbid,
  2040. JET_GRBIT grbit );
  2041. JET_ERR JET_API JetCloseDatabase(
  2042. JET_SESID sesid,
  2043. JET_DBID dbid,
  2044. JET_GRBIT grbit );
  2045. JET_ERR JET_API JetOpenTable(
  2046. JET_SESID sesid,
  2047. JET_DBID dbid,
  2048. const char *szTableName,
  2049. const void *pvParameters,
  2050. unsigned long cbParameters,
  2051. JET_GRBIT grbit,
  2052. JET_TABLEID *ptableid );
  2053. JET_ERR JET_API JetSetTableSequential(
  2054. JET_SESID sesid,
  2055. JET_TABLEID tableid,
  2056. JET_GRBIT grbit );
  2057. JET_ERR JET_API JetResetTableSequential(
  2058. JET_SESID sesid,
  2059. JET_TABLEID tableid,
  2060. JET_GRBIT grbit );
  2061. JET_ERR JET_API JetCloseTable( JET_SESID sesid, JET_TABLEID tableid );
  2062. JET_ERR JET_API JetDelete( JET_SESID sesid, JET_TABLEID tableid );
  2063. JET_ERR JET_API JetUpdate(
  2064. JET_SESID sesid,
  2065. JET_TABLEID tableid,
  2066. void *pvBookmark,
  2067. unsigned long cbBookmark,
  2068. unsigned long *pcbActual);
  2069. JET_ERR JET_API JetUpdate2(
  2070. JET_SESID sesid,
  2071. JET_TABLEID tableid,
  2072. void *pvBookmark,
  2073. unsigned long cbBookmark,
  2074. unsigned long *pcbActual,
  2075. const JET_GRBIT grbit );
  2076. JET_ERR JET_API JetEscrowUpdate(
  2077. JET_SESID sesid,
  2078. JET_TABLEID tableid,
  2079. JET_COLUMNID columnid,
  2080. void *pv,
  2081. unsigned long cbMax,
  2082. void *pvOld,
  2083. unsigned long cbOldMax,
  2084. unsigned long *pcbOldActual,
  2085. JET_GRBIT grbit );
  2086. JET_ERR JET_API JetRetrieveColumn(
  2087. JET_SESID sesid,
  2088. JET_TABLEID tableid,
  2089. JET_COLUMNID columnid,
  2090. void *pvData,
  2091. unsigned long cbData,
  2092. unsigned long *pcbActual,
  2093. JET_GRBIT grbit,
  2094. JET_RETINFO *pretinfo );
  2095. JET_ERR JET_API JetRetrieveColumns(
  2096. JET_SESID sesid,
  2097. JET_TABLEID tableid,
  2098. JET_RETRIEVECOLUMN *pretrievecolumn,
  2099. unsigned long cretrievecolumn );
  2100. JET_ERR JET_API JetEnumerateColumns(
  2101. JET_SESID sesid,
  2102. JET_TABLEID tableid,
  2103. unsigned long cEnumColumnId,
  2104. JET_ENUMCOLUMNID* rgEnumColumnId,
  2105. unsigned long* pcEnumColumn,
  2106. JET_ENUMCOLUMN** prgEnumColumn,
  2107. JET_PFNREALLOC pfnRealloc,
  2108. void* pvReallocContext,
  2109. unsigned long cbDataMost,
  2110. JET_GRBIT grbit );
  2111. JET_ERR JET_API JetRetrieveTaggedColumnList(
  2112. JET_SESID sesid,
  2113. JET_TABLEID tableid,
  2114. unsigned long *pcColumns,
  2115. void *pvData,
  2116. unsigned long cbData,
  2117. JET_COLUMNID columnidStart,
  2118. JET_GRBIT grbit );
  2119. JET_ERR JET_API JetSetColumn(
  2120. JET_SESID sesid,
  2121. JET_TABLEID tableid,
  2122. JET_COLUMNID columnid,
  2123. const void *pvData,
  2124. unsigned long cbData,
  2125. JET_GRBIT grbit,
  2126. JET_SETINFO *psetinfo );
  2127. JET_ERR JET_API JetSetColumns(
  2128. JET_SESID sesid,
  2129. JET_TABLEID tableid,
  2130. JET_SETCOLUMN *psetcolumn,
  2131. unsigned long csetcolumn );
  2132. JET_ERR JET_API JetPrepareUpdate(
  2133. JET_SESID sesid,
  2134. JET_TABLEID tableid,
  2135. unsigned long prep );
  2136. JET_ERR JET_API JetGetRecordPosition(
  2137. JET_SESID sesid,
  2138. JET_TABLEID tableid,
  2139. JET_RECPOS *precpos,
  2140. unsigned long cbRecpos );
  2141. JET_ERR JET_API JetGotoPosition(
  2142. JET_SESID sesid,
  2143. JET_TABLEID tableid,
  2144. JET_RECPOS *precpos );
  2145. JET_ERR JET_API JetGetCursorInfo(
  2146. JET_SESID sesid,
  2147. JET_TABLEID tableid,
  2148. void *pvResult,
  2149. unsigned long cbMax,
  2150. unsigned long InfoLevel );
  2151. JET_ERR JET_API JetDupCursor(
  2152. JET_SESID sesid,
  2153. JET_TABLEID tableid,
  2154. JET_TABLEID *ptableid,
  2155. JET_GRBIT grbit );
  2156. JET_ERR JET_API JetGetCurrentIndex(
  2157. JET_SESID sesid,
  2158. JET_TABLEID tableid,
  2159. char *szIndexName,
  2160. unsigned long cchIndexName );
  2161. JET_ERR JET_API JetSetCurrentIndex(
  2162. JET_SESID sesid,
  2163. JET_TABLEID tableid,
  2164. const char *szIndexName );
  2165. JET_ERR JET_API JetSetCurrentIndex2(
  2166. JET_SESID sesid,
  2167. JET_TABLEID tableid,
  2168. const char *szIndexName,
  2169. JET_GRBIT grbit );
  2170. JET_ERR JET_API JetSetCurrentIndex3(
  2171. JET_SESID sesid,
  2172. JET_TABLEID tableid,
  2173. const char *szIndexName,
  2174. JET_GRBIT grbit,
  2175. unsigned long itagSequence );
  2176. JET_ERR JET_API JetSetCurrentIndex4(
  2177. JET_SESID sesid,
  2178. JET_TABLEID tableid,
  2179. const char *szIndexName,
  2180. JET_INDEXID *pindexid,
  2181. JET_GRBIT grbit,
  2182. unsigned long itagSequence );
  2183. JET_ERR JET_API JetMove(
  2184. JET_SESID sesid,
  2185. JET_TABLEID tableid,
  2186. long cRow,
  2187. JET_GRBIT grbit );
  2188. JET_ERR JET_API JetGetLock(
  2189. JET_SESID sesid,
  2190. JET_TABLEID tableid,
  2191. JET_GRBIT grbit );
  2192. JET_ERR JET_API JetMakeKey(
  2193. JET_SESID sesid,
  2194. JET_TABLEID tableid,
  2195. const void *pvData,
  2196. unsigned long cbData,
  2197. JET_GRBIT grbit );
  2198. JET_ERR JET_API JetSeek(
  2199. JET_SESID sesid,
  2200. JET_TABLEID tableid,
  2201. JET_GRBIT grbit );
  2202. JET_ERR JET_API JetGetBookmark(
  2203. JET_SESID sesid,
  2204. JET_TABLEID tableid,
  2205. void * pvBookmark,
  2206. unsigned long cbMax,
  2207. unsigned long * pcbActual );
  2208. JET_ERR JET_API JetGetSecondaryIndexBookmark(
  2209. JET_SESID sesid,
  2210. JET_TABLEID tableid,
  2211. void * pvSecondaryKey,
  2212. unsigned long cbSecondaryKeyMax,
  2213. unsigned long * pcbSecondaryKeyActual,
  2214. void * pvPrimaryBookmark,
  2215. unsigned long cbPrimaryBookmarkMax,
  2216. unsigned long * pcbPrimaryKeyActual,
  2217. const JET_GRBIT grbit );
  2218. JET_ERR JET_API JetCompact(
  2219. JET_SESID sesid,
  2220. const char *szDatabaseSrc,
  2221. const char *szDatabaseDest,
  2222. JET_PFNSTATUS pfnStatus,
  2223. JET_CONVERT *pconvert,
  2224. JET_GRBIT grbit );
  2225. JET_ERR JET_API JetDefragment(
  2226. JET_SESID sesid,
  2227. JET_DBID dbid,
  2228. const char *szTableName,
  2229. unsigned long *pcPasses,
  2230. unsigned long *pcSeconds,
  2231. JET_GRBIT grbit );
  2232. JET_ERR JET_API JetDefragment2(
  2233. JET_SESID sesid,
  2234. JET_DBID dbid,
  2235. const char *szTableName,
  2236. unsigned long *pcPasses,
  2237. unsigned long *pcSeconds,
  2238. JET_CALLBACK callback,
  2239. JET_GRBIT grbit );
  2240. JET_ERR JET_API JetDefragment3(
  2241. JET_SESID vsesid,
  2242. const char *szDatabaseName,
  2243. const char *szTableName,
  2244. unsigned long *pcPasses,
  2245. unsigned long *pcSeconds,
  2246. JET_CALLBACK callback,
  2247. void *pvContext,
  2248. JET_GRBIT grbit );
  2249. JET_ERR JET_API JetConvertDDL(
  2250. JET_SESID sesid,
  2251. JET_DBID dbid,
  2252. JET_OPDDLCONV convtyp,
  2253. void *pvData,
  2254. unsigned long cbData );
  2255. JET_ERR JET_API JetUpgradeDatabase(
  2256. JET_SESID sesid,
  2257. const char *szDbFileName,
  2258. const char *szSLVFileName,
  2259. const JET_GRBIT grbit );
  2260. JET_ERR JET_API JetSetDatabaseSize(
  2261. JET_SESID sesid,
  2262. const char *szDatabaseName,
  2263. unsigned long cpg,
  2264. unsigned long *pcpgReal );
  2265. JET_ERR JET_API JetGrowDatabase(
  2266. JET_SESID sesid,
  2267. JET_DBID dbid,
  2268. unsigned long cpg,
  2269. unsigned long *pcpgReal );
  2270. JET_ERR JET_API JetSetSessionContext(
  2271. JET_SESID sesid,
  2272. JET_API_PTR ulContext );
  2273. JET_ERR JET_API JetResetSessionContext(
  2274. JET_SESID sesid );
  2275. JET_ERR JET_API JetDBUtilities( JET_DBUTIL *pdbutil );
  2276. JET_ERR JET_API JetGotoBookmark(
  2277. JET_SESID sesid,
  2278. JET_TABLEID tableid,
  2279. void * pvBookmark,
  2280. unsigned long cbBookmark );
  2281. JET_ERR JET_API JetGotoSecondaryIndexBookmark(
  2282. JET_SESID sesid,
  2283. JET_TABLEID tableid,
  2284. void * pvSecondaryKey,
  2285. unsigned long cbSecondaryKey,
  2286. void * pvPrimaryBookmark,
  2287. unsigned long cbPrimaryBookmark,
  2288. const JET_GRBIT grbit );
  2289. JET_ERR JET_API JetIntersectIndexes(
  2290. JET_SESID sesid,
  2291. JET_INDEXRANGE * rgindexrange,
  2292. unsigned long cindexrange,
  2293. JET_RECORDLIST * precordlist,
  2294. JET_GRBIT grbit );
  2295. JET_ERR JET_API JetComputeStats( JET_SESID sesid, JET_TABLEID tableid );
  2296. JET_ERR JET_API JetOpenTempTable(JET_SESID sesid,
  2297. const JET_COLUMNDEF *prgcolumndef, unsigned long ccolumn,
  2298. JET_GRBIT grbit, JET_TABLEID *ptableid,
  2299. JET_COLUMNID *prgcolumnid);
  2300. JET_ERR JET_API JetOpenTempTable2(
  2301. JET_SESID sesid,
  2302. const JET_COLUMNDEF *prgcolumndef,
  2303. unsigned long ccolumn,
  2304. unsigned long lcid,
  2305. JET_GRBIT grbit,
  2306. JET_TABLEID *ptableid,
  2307. JET_COLUMNID *prgcolumnid );
  2308. JET_ERR JET_API JetOpenTempTable3(
  2309. JET_SESID sesid,
  2310. const JET_COLUMNDEF *prgcolumndef,
  2311. unsigned long ccolumn,
  2312. JET_UNICODEINDEX *pidxunicode,
  2313. JET_GRBIT grbit,
  2314. JET_TABLEID *ptableid,
  2315. JET_COLUMNID *prgcolumnid );
  2316. JET_ERR JET_API JetBackup( const char *szBackupPath, JET_GRBIT grbit, JET_PFNSTATUS pfnStatus );
  2317. JET_ERR JET_API JetBackupInstance( JET_INSTANCE instance,
  2318. const char *szBackupPath,
  2319. JET_GRBIT grbit,
  2320. JET_PFNSTATUS pfnStatus );
  2321. JET_ERR JET_API JetRestore(const char *sz, JET_PFNSTATUS pfn );
  2322. JET_ERR JET_API JetRestore2(const char *sz, const char *szDest, JET_PFNSTATUS pfn );
  2323. JET_ERR JET_API JetRestoreInstance( JET_INSTANCE instance,
  2324. const char *sz,
  2325. const char *szDest,
  2326. JET_PFNSTATUS pfn );
  2327. JET_ERR JET_API JetSetIndexRange(JET_SESID sesid,
  2328. JET_TABLEID tableidSrc, JET_GRBIT grbit);
  2329. JET_ERR JET_API JetIndexRecordCount(JET_SESID sesid,
  2330. JET_TABLEID tableid, unsigned long *pcrec, unsigned long crecMax );
  2331. JET_ERR JET_API JetRetrieveKey(JET_SESID sesid,
  2332. JET_TABLEID tableid, void *pvData, unsigned long cbMax,
  2333. unsigned long *pcbActual, JET_GRBIT grbit );
  2334. JET_ERR JET_API JetBeginExternalBackup( JET_GRBIT grbit );
  2335. JET_ERR JET_API JetBeginExternalBackupInstance( JET_INSTANCE instance, JET_GRBIT grbit );
  2336. JET_ERR JET_API JetGetAttachInfo( void *pv,
  2337. unsigned long cbMax,
  2338. unsigned long *pcbActual );
  2339. JET_ERR JET_API JetGetAttachInfoInstance( JET_INSTANCE instance,
  2340. void *pv,
  2341. unsigned long cbMax,
  2342. unsigned long *pcbActual );
  2343. JET_ERR JET_API JetOpenFile( const char *szFileName,
  2344. JET_HANDLE *phfFile,
  2345. unsigned long *pulFileSizeLow,
  2346. unsigned long *pulFileSizeHigh );
  2347. JET_ERR JET_API JetOpenFileInstance( JET_INSTANCE instance,
  2348. const char *szFileName,
  2349. JET_HANDLE *phfFile,
  2350. unsigned long *pulFileSizeLow,
  2351. unsigned long *pulFileSizeHigh );
  2352. JET_ERR JET_API JetOpenFileSectionInstance(
  2353. JET_INSTANCE instance,
  2354. char *szFile,
  2355. JET_HANDLE *phFile,
  2356. long iSection,
  2357. long cSections,
  2358. unsigned long *pulSectionSizeLow,
  2359. long *plSectionSizeHigh);
  2360. JET_ERR JET_API JetReadFile( JET_HANDLE hfFile,
  2361. void *pv,
  2362. unsigned long cb,
  2363. unsigned long *pcb );
  2364. JET_ERR JET_API JetReadFileInstance( JET_INSTANCE instance,
  2365. JET_HANDLE hfFile,
  2366. void *pv,
  2367. unsigned long cb,
  2368. unsigned long *pcb );
  2369. JET_ERR JET_API JetAsyncReadFileInstance( JET_INSTANCE instance,
  2370. JET_HANDLE hfFile,
  2371. void* pv,
  2372. unsigned long cb,
  2373. JET_OLP *pjolp );
  2374. JET_ERR JET_API JetCheckAsyncReadFileInstance( JET_INSTANCE instance,
  2375. void *pv,
  2376. int cb,
  2377. unsigned long pgnoFirst );
  2378. JET_ERR JET_API JetCloseFile( JET_HANDLE hfFile );
  2379. JET_ERR JET_API JetCloseFileInstance( JET_INSTANCE instance, JET_HANDLE hfFile );
  2380. JET_ERR JET_API JetGetLogInfo( void *pv,
  2381. unsigned long cbMax,
  2382. unsigned long *pcbActual );
  2383. JET_ERR JET_API JetGetLogInfoInstance( JET_INSTANCE instance,
  2384. void *pv,
  2385. unsigned long cbMax,
  2386. unsigned long *pcbActual );
  2387. #define JET_BASE_NAME_LENGTH 3
  2388. typedef struct
  2389. {
  2390. unsigned long cbSize;
  2391. unsigned long ulGenLow;
  2392. unsigned long ulGenHigh;
  2393. char szBaseName[ JET_BASE_NAME_LENGTH + 1 ];
  2394. } JET_LOGINFO;
  2395. JET_ERR JET_API JetGetLogInfoInstance2( JET_INSTANCE instance,
  2396. void *pv,
  2397. unsigned long cbMax,
  2398. unsigned long *pcbActual,
  2399. JET_LOGINFO * pLogInfo);
  2400. JET_ERR JET_API JetGetTruncateLogInfoInstance( JET_INSTANCE instance,
  2401. void *pv,
  2402. unsigned long cbMax,
  2403. unsigned long *pcbActual );
  2404. JET_ERR JET_API JetTruncateLog( void );
  2405. JET_ERR JET_API JetTruncateLogInstance( JET_INSTANCE instance );
  2406. JET_ERR JET_API JetEndExternalBackup( void );
  2407. JET_ERR JET_API JetEndExternalBackupInstance( JET_INSTANCE instance );
  2408. /* Flags for JetEndExternalBackupInstance2 */
  2409. #define JET_bitBackupEndNormal 0x0001
  2410. #define JET_bitBackupEndAbort 0x0002
  2411. JET_ERR JET_API JetEndExternalBackupInstance2( JET_INSTANCE instance, JET_GRBIT grbit );
  2412. JET_ERR JET_API JetExternalRestore( char *szCheckpointFilePath,
  2413. char *szLogPath,
  2414. JET_RSTMAP *rgstmap,
  2415. long crstfilemap,
  2416. char *szBackupLogPath,
  2417. long genLow,
  2418. long genHigh,
  2419. JET_PFNSTATUS pfn );
  2420. JET_ERR JET_API JetExternalRestore2( char *szCheckpointFilePath,
  2421. char *szLogPath,
  2422. JET_RSTMAP *rgstmap,
  2423. long crstfilemap,
  2424. char *szBackupLogPath,
  2425. JET_LOGINFO * pLogInfo,
  2426. char *szTargetInstanceName,
  2427. char *szTargetInstanceLogPath,
  2428. char *szTargetInstanceCheckpointPath,
  2429. JET_PFNSTATUS pfn );
  2430. JET_ERR JET_API JetSnapshotStart( JET_INSTANCE instance,
  2431. char * szDatabases,
  2432. JET_GRBIT grbit);
  2433. JET_ERR JET_API JetSnapshotStop( JET_INSTANCE instance,
  2434. JET_GRBIT grbit);
  2435. JET_ERR JET_API JetRegisterCallback(
  2436. JET_SESID sesid,
  2437. JET_TABLEID tableid,
  2438. JET_CBTYP cbtyp,
  2439. JET_CALLBACK pCallback,
  2440. void * pvContext,
  2441. JET_HANDLE *phCallbackId );
  2442. JET_ERR JET_API JetUnregisterCallback(
  2443. JET_SESID sesid,
  2444. JET_TABLEID tableid,
  2445. JET_CBTYP cbtyp,
  2446. JET_HANDLE hCallbackId );
  2447. typedef struct _JET_INSTANCE_INFO
  2448. {
  2449. JET_INSTANCE hInstanceId;
  2450. char * szInstanceName;
  2451. JET_API_PTR cDatabases;
  2452. char ** szDatabaseFileName;
  2453. char ** szDatabaseDisplayName;
  2454. char ** szDatabaseSLVFileName;
  2455. } JET_INSTANCE_INFO;
  2456. JET_ERR JET_API JetGetInstanceInfo( unsigned long *pcInstanceInfo, JET_INSTANCE_INFO ** paInstanceInfo );
  2457. JET_ERR JET_API JetFreeBuffer( char *pbBuf );
  2458. JET_ERR JET_API JetSetLS(
  2459. JET_SESID sesid,
  2460. JET_TABLEID tableid,
  2461. JET_LS ls,
  2462. JET_GRBIT grbit );
  2463. JET_ERR JET_API JetGetLS(
  2464. JET_SESID sesid,
  2465. JET_TABLEID tableid,
  2466. JET_LS *pls,
  2467. JET_GRBIT grbit );
  2468. typedef JET_API_PTR JET_OSSNAPID; /* Snapshot Session Identifier */
  2469. JET_ERR JET_API JetOSSnapshotPrepare( JET_OSSNAPID * psnapId, const JET_GRBIT grbit );
  2470. JET_ERR JET_API JetOSSnapshotFreeze( const JET_OSSNAPID snapId, unsigned long *pcInstanceInfo, JET_INSTANCE_INFO ** paInstanceInfo, const JET_GRBIT grbit );
  2471. JET_ERR JET_API JetOSSnapshotThaw( const JET_OSSNAPID snapId, const JET_GRBIT grbit );
  2472. JET_ERR JET_API JetOSSnapshotAbort( const JET_OSSNAPID snapId, const JET_GRBIT grbit );
  2473. #ifdef __cplusplus
  2474. }
  2475. #endif
  2476. #endif /* _JET_NOPROTOTYPES */
  2477. #include <poppack.h>
  2478. #ifdef __cplusplus
  2479. }
  2480. #endif
  2481. #endif /* _JET_INCLUDED */