Source code of Windows XP (NT5)
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.

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