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

722 lines
20 KiB

  1. #include <stdlib.h> /* for _MAX_PATH */
  2. #include <dirapi.h>
  3. //------------------------ system parameters ---------------------------
  4. extern long lMaxSessions;
  5. extern long lMaxOpenTables;
  6. extern long lMaxVerPages;
  7. extern long lMaxCursors;
  8. extern long lMaxBuffers;
  9. extern long lLogBuffers;
  10. extern long lLogFileSectors;
  11. extern long lLogFlushThreshold;
  12. extern long lLGCheckPointPeriod;
  13. extern long lWaitLogFlush;
  14. extern long lLogFlushPeriod;
  15. extern long lLGWaitingUserMax;
  16. //------ log.c --------------------------------------------------------------
  17. /* flags controlling logging behavior
  18. /**/
  19. extern BOOL fLogDisabled; /* to turn off logging by environment variable */
  20. extern BOOL fFreezeCheckpoint; /* freeze checkpoint when backup occurs. */
  21. extern BOOL fFreezeNewGeneration; /* freeze log gen when backup occurs. */
  22. extern BOOL fNewLogRecordAdded;
  23. extern BOOL fBackupActive;
  24. extern BOOL fLGNoMoreLogWrite;
  25. extern INT cLGUsers;
  26. extern PIB *ppibLGFlushQHead;
  27. extern PIB *ppibLGFlushQTail;
  28. extern INT csecLGThreshold;
  29. extern INT csecLGCheckpointCount;
  30. extern INT csecLGCheckpointPeriod;
  31. extern INT cmsLGFlushPeriod;
  32. extern INT cmsLGFlushStep;
  33. extern BYTE szComputerName[];
  34. /* flags controlling recovery behavior
  35. /**/
  36. extern BOOL fHardRestore;
  37. #ifdef DEBUG
  38. extern BOOL fDBGTraceLog;
  39. extern BOOL fDBGTraceLogWrite;
  40. extern BOOL fDBGFreezeCheckpoint;
  41. extern BOOL fDBGTraceRedo;
  42. #endif
  43. extern LONG cXactPerFlush;
  44. #ifdef PERFCNT
  45. extern BOOL fPERFEnabled;
  46. extern ULONG rgcCommitByUser[10];
  47. extern ULONG rgcCommitByLG[10];
  48. #endif
  49. #pragma pack(1)
  50. typedef struct
  51. {
  52. BYTE szSysDbPath[_MAX_PATH + 1];
  53. BYTE szLogFilePath[_MAX_PATH + 1];
  54. ULONG ulMaxSessions;
  55. ULONG ulMaxOpenTables;
  56. ULONG ulMaxVerPages;
  57. ULONG ulMaxCursors;
  58. ULONG ulLogBuffers;
  59. ULONG ulMaxBuffers; /* not used, for ref only */
  60. } DBENV;
  61. VOID LGStoreDBEnv( DBENV *pdbenv );
  62. VOID LGSetDBEnv( DBENV *pdbenv );
  63. VOID LGLogFailEvent( BYTE *szLine );
  64. /*
  65. * NOTE: Whenever a new log record type is added or changed, the following
  66. * NOTE: should be udpated too: mplrtypsz in logapi.c, new print function for
  67. * NOTE: the new lrtyp in logapi.c, and mplrtypcb and CbLGSizeOfRec in
  68. * NOTE: redut.c.
  69. */
  70. typedef BYTE LRTYP;
  71. #define lrtypNOP ((LRTYP) 0 ) /* NOP null operation */
  72. #define lrtypStart ((LRTYP) 1 )
  73. #define lrtypQuit ((LRTYP) 2 )
  74. #define lrtypMS ((LRTYP) 3 ) /* mutilsec flush */
  75. #define lrtypFill ((LRTYP) 4 ) /* no op */
  76. #define lrtypBegin ((LRTYP) 5 )
  77. #define lrtypCommit ((LRTYP) 6 )
  78. #define lrtypAbort ((LRTYP) 7 )
  79. #define lrtypCreateDB ((LRTYP) 8 )
  80. #define lrtypAttachDB ((LRTYP) 9 )
  81. #define lrtypDetachDB ((LRTYP) 10 )
  82. #define lrtypInitFDPPage ((LRTYP) 11 )
  83. #define lrtypSplit ((LRTYP) 12 )
  84. #define lrtypEmptyPage ((LRTYP) 13 )
  85. #define lrtypMerge ((LRTYP) 14 )
  86. #define lrtypInsertNode ((LRTYP) 15 )
  87. #define lrtypInsertItemList ((LRTYP) 16 )
  88. #define lrtypReplace ((LRTYP) 17 )
  89. #define lrtypReplaceC ((LRTYP) 18 )
  90. #define lrtypFlagDelete ((LRTYP) 19 )
  91. #define lrtypLockRec ((LRTYP) 20 )
  92. #define lrtypUpdateHeader ((LRTYP) 21 )
  93. #define lrtypInsertItem ((LRTYP) 22 )
  94. #define lrtypInsertItems ((LRTYP) 23 )
  95. #define lrtypFlagDeleteItem ((LRTYP) 24 )
  96. #define lrtypFlagInsertItem ((LRTYP) 25 )
  97. #define lrtypDeleteItem ((LRTYP) 26 )
  98. #define lrtypSplitItemListNode ((LRTYP) 27 )
  99. #define lrtypDelta ((LRTYP) 28 )
  100. #define lrtypDelete ((LRTYP) 29 )
  101. #define lrtypELC ((LRTYP) 30 )
  102. #define lrtypFreeSpace ((LRTYP) 31 )
  103. #define lrtypUndo ((LRTYP) 32 )
  104. #define lrtypRecoveryUndo1 ((LRTYP) 33 )
  105. #define lrtypRecoveryQuit1 ((LRTYP) 34 )
  106. #define lrtypRecoveryUndo2 ((LRTYP) 35 )
  107. #define lrtypRecoveryQuit2 ((LRTYP) 36 )
  108. #define lrtypFullBackup ((LRTYP) 37 )
  109. #define lrtypIncBackup ((LRTYP) 38 )
  110. /* debug only
  111. /**/
  112. #define lrtypCheckPage ((LRTYP) 39 )
  113. #define lrtypMax ((LRTYP) 40 )
  114. /* log record structure ( fixed size portion of log entry )
  115. /**/
  116. typedef struct
  117. {
  118. LRTYP lrtyp;
  119. } LR;
  120. typedef struct
  121. {
  122. LRTYP lrtyp;
  123. ULONG ulDBTime; /* current flush counter of DB operations */
  124. PROCID procid; /* user id of this log record */
  125. PN pn; /* dbid + pgno */
  126. BYTE itagSon; /* itag of node, used only for verification */
  127. // UNDONE: review with Cheen Liao
  128. // SHORT itagFather; /* itag of father node */
  129. BYTE itagFather; /* itag of father node */
  130. BYTE ibSon; /* position to insert in father son table */
  131. BYTE bHeader; /* node header */
  132. ULONG fDIRFlags; /* fDIRVersion for insert item list */
  133. // UNDONE: review with Cheen Liao
  134. // USHORT cbKey; /* key size */
  135. BYTE cbKey; /* key size */
  136. USHORT cbData; /* data size */
  137. CHAR szKey[0]; /* key and data follow */
  138. } LRINSERTNODE;
  139. typedef struct
  140. {
  141. LRTYP lrtyp;
  142. ULONG ulDBTime; /* current flush counter of page */
  143. PROCID procid; /* user id of this log record */
  144. PN pn;
  145. BYTE itag; /* wherereplace occurs */
  146. SRID bm; /* bookmark of this replace node */
  147. ULONG fDIRFlags; /* flags used in original DIR call */
  148. USHORT cb; /* data size/diff info */
  149. BYTE fOld:1; /* fTrue if before image is in szData */
  150. USHORT cbOldData:15; /* before image data size, may be 0 */
  151. USHORT cbNewData; /* after image data size, == cb if not replaceC */
  152. CHAR szData[0]; /* made line data for new (and old) record follow */
  153. } LRREPLACE;
  154. typedef struct
  155. {
  156. LRTYP lrtyp;
  157. ULONG ulDBTime; /* current flush counter of page */
  158. PROCID procid; /* user id of this log record */
  159. PN pn;
  160. BYTE itag;
  161. SRID bm;
  162. USHORT cbOldData;
  163. CHAR szData[0]; /* for before image */
  164. } LRLOCKREC;
  165. typedef struct
  166. {
  167. LRTYP lrtyp;
  168. ULONG ulDBTime; /* current flush counter of page */
  169. PROCID procid; /* user id of this log record */
  170. PN pn;
  171. BYTE itag;
  172. SRID bm; /* bookmark of this delete node */
  173. ULONG fDIRFlags; /* flags used in original DIR call */
  174. } LRFLAGDELETE;
  175. typedef struct
  176. {
  177. LRTYP lrtyp;
  178. ULONG ulDBTime; /* current flush counter of page */
  179. PROCID procid; /* user id of this log record */
  180. PN pn;
  181. BYTE itag;
  182. } LRDELETE;
  183. typedef struct
  184. {
  185. LRTYP lrtyp;
  186. ULONG ulDBTime; /* current flush counter of page */
  187. PROCID procid; /* user id of this log record */
  188. DBID dbid;
  189. SRID bm;
  190. BYTE level;
  191. SHORT cbDelta;
  192. SRID bmTarget; /* page being updated during undo operation */
  193. } LRFREESPACE;
  194. typedef struct
  195. {
  196. LRTYP lrtyp;
  197. ULONG ulDBTime; /* current flush counter of page */
  198. PROCID procid; /* user id of this log record */
  199. DBID dbid;
  200. SRID bm;
  201. BYTE level;
  202. UINT oper;
  203. SRID item;
  204. SRID bmTarget; /* the page being updated during undo operation */
  205. } LRUNDO;
  206. /* expunge link commit log record
  207. /**/
  208. typedef struct
  209. {
  210. LRTYP lrtyp;
  211. ULONG ulDBTime; /* current flush counter of page */
  212. PROCID procid; /* user id of this log record */
  213. PN pn;
  214. BYTE itag;
  215. SRID sridSrc;
  216. } LRELC;
  217. typedef struct
  218. {
  219. LRTYP lrtyp;
  220. ULONG ulDBTime; /* current flush counter of page */
  221. PROCID procid; /* user id of this log record */
  222. PN pn;
  223. BYTE itag;
  224. SRID bm; /* bookmark of this udpated node */
  225. BYTE bHeader;
  226. } LRUPDATEHEADER;
  227. typedef struct
  228. {
  229. LRTYP lrtyp;
  230. ULONG ulDBTime; /* current flush counter of DB operations */
  231. PROCID procid; /* user id of this log record */
  232. PN pn; /* dbid + pgno */
  233. #if ISRID
  234. WORD isrid; /* in case do version only */
  235. #endif
  236. BYTE itag; /* of item list node */
  237. SRID srid; /* item to insert */
  238. SRID sridItemList; /* bookmark of first item list node */
  239. ULONG fDIRFlags; /* so far only one bit is used - fDIRVersion */
  240. } LRINSERTITEM;
  241. typedef struct
  242. {
  243. LRTYP lrtyp;
  244. ULONG ulDBTime; /* current flush counter of DB operations */
  245. PROCID procid; /* user id of this log record */
  246. PN pn; /* dbid + pgno */
  247. BYTE itag; /* item list */
  248. WORD citem; /* number of items to append */
  249. SRID rgitem[0];
  250. } LRINSERTITEMS;
  251. typedef struct
  252. {
  253. LRTYP lrtyp;
  254. ULONG ulDBTime; /* current flush counter of page */
  255. PROCID procid; /* user id of this log record */
  256. PN pn;
  257. BYTE itag; /* of item list node */
  258. #if ISRID
  259. SHORT isrid;
  260. #else
  261. SRID srid; /* item to insert */
  262. #endif
  263. SRID sridItemList; /* bookmark of first item list node */
  264. } LRFLAGITEM;
  265. typedef struct
  266. {
  267. LRTYP lrtyp;
  268. ULONG ulDBTime; /* current flush counter of DB operations */
  269. PROCID procid; /* user id of this log record */
  270. PN pn; /* dbid + pgno */
  271. WORD cItem;
  272. BYTE itagToSplit; /* used only for verification! */
  273. // UNDONE: review with Cheen Liao
  274. // SHORT itagFather; /* father's identity */
  275. BYTE itagFather; /* itag of father */
  276. BYTE ibSon; /* Position to insert in father's son table */
  277. ULONG fFlags; /* flag to indicate if it is append item */
  278. } LRSPLITITEMLISTNODE;
  279. typedef struct
  280. {
  281. LRTYP lrtyp;
  282. ULONG ulDBTime; /* current flush counter of DB operations */
  283. PROCID procid; /* user id of this log record */
  284. PN pn; /* dbid + pgno */
  285. #if ISRID
  286. SHORT isrid;
  287. #else
  288. SRID srid; /* item to insert */
  289. #endif
  290. BYTE itag; /* item list */
  291. SRID sridItemList; /* bookmark of first item list node */
  292. } LRDELETEITEM;
  293. typedef struct
  294. {
  295. LRTYP lrtyp;
  296. ULONG ulDBTime; /* current flush counter of page */
  297. PROCID procid; /* user id of this log record */
  298. PN pn;
  299. BYTE itag; /* wherereplace occurs */
  300. SRID bm; /* bookmark of this replace node */
  301. LONG lDelta;
  302. ULONG fDIRFlags; /* flags used in original DIR call */
  303. } LRDELTA;
  304. typedef struct
  305. {
  306. LRTYP lrtyp;
  307. ULONG ulDBTime; /* current flush counter of page */
  308. PROCID procid; /* user id of this log record */
  309. PN pn;
  310. SHORT cbFreeTotal;
  311. SHORT itagNext;
  312. } LRCHECKPAGE;
  313. typedef struct
  314. {
  315. LRTYP lrtyp;
  316. PROCID procid; /* user id of this log record */
  317. LEVEL levelStart; /* starting transaction levels */
  318. LEVEL level; /* transaction levels */
  319. } LRBEGIN;
  320. typedef struct
  321. {
  322. LRTYP lrtyp;
  323. PROCID procid; /* user id of this log record */
  324. LEVEL level; /* transaction levels */
  325. } LRCOMMIT;
  326. typedef struct
  327. {
  328. LRTYP lrtyp;
  329. PROCID procid; /* user id of this log record */
  330. LEVEL levelAborted; /* transaction level */
  331. } LRABORT;
  332. typedef struct
  333. {
  334. LRTYP lrtyp;
  335. PROCID procid; /* user id of this log record, unused in V15 */
  336. DBID dbid;
  337. BOOL fLogOn;
  338. JET_GRBIT grbit;
  339. USHORT cb; /* data size */
  340. CHAR szPath[0]; /* path name follows */
  341. } LRCREATEDB;
  342. typedef struct
  343. {
  344. LRTYP lrtyp;
  345. PROCID procid; /* user id of this log record, unused in V15 */
  346. DBID dbid;
  347. BYTE fLogOn;
  348. USHORT cb; /* data size */
  349. CHAR szPath[0]; /* path name follows */
  350. } LRATTACHDB;
  351. typedef struct
  352. {
  353. LRTYP lrtyp;
  354. PROCID procid; /* user id of this log record, unused in V15 */
  355. DBID dbid;
  356. BOOL fLogOn;
  357. USHORT cb;
  358. CHAR szPath[0]; /* path name follows */
  359. } LRDETACHDB;
  360. typedef struct
  361. {
  362. LRTYP lrtyp;
  363. ULONG ulDBTime; /* flush counter of page being split */
  364. PROCID procid; /* user id of this log record */
  365. BYTE splitt; /* split type */
  366. BYTE fLeaf; /* split on leaf node */
  367. PN pn; /* page (focus) being split, includes dbid */
  368. PGNO pgnoNew; /* newly-allocated page no */
  369. PGNO pgnoNew2; /* newly-allocated page no */
  370. PGNO pgnoNew3; /* newly-allocated page no */
  371. PGNO pgnoSibling; /* newly-allocated page no */
  372. BYTE itagSplit; /* node at which page is being split */
  373. SHORT ibSonSplit; /* ibSon at which node is being split */
  374. BYTE pgtyp; /* page type of new page */
  375. PGNO pgnoFather; /* pgno of father node */
  376. SHORT itagFather; /* itag of father node, could be itagNil (3 bytes) */
  377. SHORT itagGrandFather;/* itag of Grand father node, could be itagNil (3 bytes) */
  378. BYTE ibSonFather;
  379. BYTE cbklnk; /* number of back links */
  380. // UNDONE: review with Cheen Liao
  381. // SHORT cbKey;
  382. // SHORT cbKeyMac;
  383. BYTE cbKey;
  384. BYTE cbKeyMac;
  385. BYTE rgb[0];
  386. } LRSPLIT;
  387. typedef struct
  388. {
  389. LRTYP lrtyp;
  390. ULONG ulDBTime; /* flush counter of page being split */
  391. PROCID procid; /* user id of this log record */
  392. PN pn; /* page pointer of empty page */
  393. PGNO pgnoFather;
  394. SHORT itag; /* itag of page pointer */
  395. // UNDONE: review with Cheen Liao
  396. // SHORT itagFather; /* father of page pointer */
  397. BYTE itagFather; /* itag of father of page pointer */
  398. SHORT ibSon;
  399. PGNO pgnoLeft;
  400. PGNO pgnoRight;
  401. } LREMPTYPAGE;
  402. typedef struct
  403. {
  404. LRTYP lrtyp;
  405. PROCID procid;
  406. PN pn; /* page pointer of merged page */
  407. PGNO pgnoRight; /* page appended to */
  408. ULONG ulDBTime;
  409. BYTE cbklnk;
  410. BYTE rgb[0];
  411. } LRMERGE;
  412. typedef struct
  413. {
  414. LRTYP lrtyp;
  415. ULONG ulDBTime; /* flush counter of father FDP page */
  416. PROCID procid; /* user id of this log record */
  417. PN pn; /* FDP page */
  418. PGNO pgnoFDPParent; /* parent FDP */
  419. USHORT cpgGot; /* returned number of pages */
  420. USHORT cpgWish; /* request pages */
  421. } LRINITFDPPAGE;
  422. typedef struct
  423. {
  424. LRTYP lrtyp;
  425. USHORT ibForwardLink;
  426. USHORT isecForwardLink;
  427. USHORT ibBackLink;
  428. USHORT isecBackLink;
  429. ULONG ulCheckSum;
  430. } LRMS;
  431. typedef struct
  432. {
  433. LRTYP lrtyp;
  434. DBENV dbenv;
  435. } LRSTART;
  436. typedef struct
  437. {
  438. LRTYP lrtyp;
  439. LGPOS lgpos; /* point back to last beginning of undo */
  440. LGPOS lgposRedoFrom;
  441. BYTE fHard;
  442. } LRQUITREC;
  443. typedef struct
  444. {
  445. LRTYP lrtyp;
  446. USHORT cbPath; /* backup path/restore path */
  447. BYTE szData[0];
  448. } LRLOGRESTORE;
  449. #ifdef HILEVEL_LOGGING
  450. typedef struct
  451. {
  452. PROCID procid; /* user id of this log record */
  453. PGNO pn; /* Parent FDP, includes dbid */
  454. ULONG flags; /* flags for index */
  455. ULONG density; /* initial load density for index */
  456. ULONG timepage; /* flush counter of father FDP page */
  457. USHORT cbname; /* index name length */
  458. USHORT cbkey; /* index info length */
  459. /* Index name and index info follow */
  460. } LRCREATEIDX;
  461. //typedef struct
  462. // {
  463. // PROCID procid; /* user id of this log record */
  464. // PGNO pgno; /* first page of new extent */
  465. // ULONG cpages; /* number of pages in the extent */
  466. // PGNO pgnoFDP; /* FDP being extended */
  467. // PN pnparent; /* Parent FDP controlling the space, includes dbid */
  468. // ULONG timepage; /* flush counter of FDP page */
  469. // } EXTENDFDP;
  470. //typedef struct
  471. // {
  472. // PROCID procid; /* user id of this log record */
  473. // PGNO pgno; /* first page of freed extent */
  474. // ULONG cpages; /* number of pages in the extent */
  475. // PGNO pgnoFDP; /* FDP being shrunk */
  476. // ULONG timepage; /* flush counter of parent FDP page */
  477. // PN pnparent; /* Parent FDP regaining the space, includes dbid*/
  478. // } LRSHRINKFDP;
  479. #endif
  480. #pragma pack()
  481. #ifdef NOLOG
  482. #define LGDepend( pbf, lgpos )
  483. #define ErrLGInsert( pfucb, fHeader, pkey, plineData ) 0
  484. #define ErrLGInsertItemList( pfucb, fHeader, pkey, plineData ) 0
  485. #define ErrLGReplace( pfucb, pline, fFlags, cbData ) 0
  486. #define ErrLGFlagDelete( pfucb, fFlags ) 0
  487. #deinfe ErrLGUpdateHeader( pfucb, bHeader ) 0
  488. #define ErrLGInsertItem( pfucb, fDIRFlags ) 0
  489. #define ErrLGInsertItems( pfucb, rgitem, citem ) 0
  490. #define ErrLGFlagDeleteItem( pfucb ) 0
  491. #define ErrLGSplitItemListNode( pfucb, cItem, itagFather, ibSon, itagToSplit, fFlags) 0
  492. #define ErrLGDeleteItem( pfucb ) 0
  493. #define ErrLGDelta( pfucb, lDelta, fDIRFlags ) 0
  494. #define ErrLGLockRecord( pfucb, cbData ) 0
  495. #define ErrLGBeginTransaction( ppib, levelBeginFrom ) 0
  496. #define ErrLGCommitTransaction( ppib, levelCommitTo ) 0
  497. #define ErrLGAbort( ppib,levelsAborted ) 0
  498. #define ErrLGUndo( prce ) 0
  499. #define ErrLGFreeSpace( prce, cbDelta ) 0
  500. #define ErrLGCreateDB( ppib, dbid, fLogOn, grbit, sz, cch ) 0
  501. #define ErrLGAttachDB( ppib, dbid, fLogOn, sz, cch ) 0
  502. #define ErrLGDetachDB( ppib, dbid, fLogOn, sz, cch ) 0
  503. #define ErrLGMerge( pfucb, psplit ) 0
  504. #define ErrLGSplit( splitt, pfucb, pcsrPagePointer, psplit, pgtypNew ) 0
  505. #define ErrLGEmptyPage( pfucbFather, prmpage ) 0
  506. #define ErrLGInitFDPPage( pfucb, pgnoFDPParent, pnFDP, cpgGot, cpgWish) 0
  507. #define ErrLGFlagInsertItem(pfucb) 0
  508. #define ErrLGStart() 0
  509. #define ErrLGQuit( plgposRecoveryUndo ) 0
  510. #define ErrLGRecoveryQuit1( plgposRecoveryUndo ) 0
  511. #define ErrLGRecoveryUndo1( szRestorePath ) 0
  512. #define ErrLGRecoveryQuit2( plgposRecoveryUndo ) 0
  513. #define ErrLGRecoveryUndo2( szRestorePath ) 0
  514. #define ErrLGFullBackup(szRestorePath ) 0
  515. #define ErrLGIncBackup(szRestorePath ) 0
  516. #define ErrLGCheckPage( pfucb, cbFreeTotal, itagNext ) 0
  517. #else /* !NOLOG */
  518. #define ErrLGInsert( pfucb, fHeader, pkey, plineData) \
  519. ErrLGInsertNode( lrtypInsertNode, pfucb, fHeader, pkey, plineData, 0)
  520. #define ErrLGInsertItemList( pfucb, fHeader, pkey, plineData, fFlags) \
  521. ErrLGInsertNode( lrtypInsertItemList, pfucb, fHeader, pkey, plineData, fFlags)
  522. ERR ErrLGInsertNode( LRTYP lrtyp,
  523. FUCB *pfucb, INT fHeader, KEY *pkey, LINE *plineData, INT fFlags);
  524. ERR ErrLGReplace( FUCB *pfucb, LINE *pline, int fl, int cbData );
  525. ERR ErrLGFlagDelete( FUCB *pfucb, INT fFlags);
  526. ERR ErrLGUpdateHeader( FUCB *pfucb, INT bHeader );
  527. ERR ErrLGInsertItem( FUCB *pfucb, INT fDIRFlags );
  528. ERR ErrLGInsertItems( FUCB *pfucb, SRID *rgitem, INT citem );
  529. ERR ErrLGFlagDeleteItem( FUCB *pfucb );
  530. ERR ErrLGSplitItemListNode( FUCB *pfucb, INT cItem, INT itagFather,
  531. INT ibSon, INT itagToSplit, INT fFlags );
  532. ERR ErrLGDelta( FUCB *pfucb, LONG lDelta, INT fDIRFlags );
  533. ERR ErrLGLockRecord( FUCB *pfucb, INT cbData );
  534. ERR ErrLGBeginTransaction( PIB *ppib, INT levelBeginFrom );
  535. ERR ErrLGCommitTransaction( PIB *ppib, INT levelCommitTo );
  536. ERR ErrLGAbort( PIB *ppib, INT levelsAborted );
  537. ERR ErrLGUndo( RCE *prce );
  538. ERR ErrLGFreeSpace( RCE *prce, INT cbDelta );
  539. ERR ErrLGCreateDB( PIB *ppib, DBID dbid, BOOL fLogOn, JET_GRBIT grbit, CHAR *sz, INT cch );
  540. ERR ErrLGAttachDB( PIB *ppib, DBID dbid, BOOL fLogOn, CHAR *sz, INT cch );
  541. ERR ErrLGDetachDB( PIB *ppib, DBID dbid, BOOL fLogOn, CHAR *sz, INT cch );
  542. ERR ErrLGMerge( FUCB *pfucb, struct _split *psplit );
  543. ERR ErrLGSplit( SPLITT splitt, FUCB *pfucb, CSR *pcsrPagePointer,
  544. struct _split *psplit, PGTYP pgtypNew );
  545. ERR ErrLGEmptyPage( FUCB *pfucbFather, RMPAGE *prmpage );
  546. ERR ErrLGInitFDPPage( FUCB *pfucb, PGNO pgnoFDPParent,
  547. PN pnFDP, INT cpgGot, INT cpgWish);
  548. #define ErrLGFlagDeleteItem(pfucb) ErrLGFlagItem(pfucb, lrtypFlagDeleteItem)
  549. #define ErrLGFlagInsertItem(pfucb) ErrLGFlagItem(pfucb, lrtypFlagInsertItem)
  550. ERR ErrLGFlagItem(FUCB *pfucb, LRTYP lrtyp);
  551. ERR ErrLGDeleteItem( FUCB *pfucb );
  552. ERR ErrLGDelete( FUCB *pfucb );
  553. ERR ErrLGExpungeLinkCommit( FUCB *pfucb, SSIB *pssibSrc, SRID sridSrc );
  554. ERR ErrLGStart();
  555. #define ErrLGRecoveryQuit1( plgposRecoveryUndo, plgposRedoFrom, fHard ) \
  556. ErrLGQuitRec( lrtypRecoveryQuit1, plgposRecoveryUndo, \
  557. plgposRedoFrom, fHard )
  558. #define ErrLGRecoveryQuit2( plgposRecoveryUndo, plgposRedoFrom, fHard ) \
  559. ErrLGQuitRec( lrtypRecoveryQuit2, plgposRecoveryUndo, \
  560. plgposRedoFrom, fHard )
  561. #define ErrLGQuit( plgposStart ) \
  562. ErrLGQuitRec( lrtypQuit, plgposStart, pNil, 0 )
  563. ERR ErrLGQuitRec( LRTYP lrtyp, LGPOS *plgposQuit, LGPOS *plgposRedoFrom, BOOL fHard);
  564. #define ErrLGRecoveryUndo1(szRestorePath) \
  565. ErrLGLogRestore(lrtypRecoveryUndo1, szRestorePath )
  566. #define ErrLGRecoveryUndo2(szRestorePath) \
  567. ErrLGLogRestore(lrtypRecoveryUndo2, szRestorePath )
  568. #define ErrLGFullBackup(szRestorePath) \
  569. ErrLGLogRestore(lrtypFullBackup, szRestorePath )
  570. #define ErrLGIncBackup(szRestorePath) \
  571. ErrLGLogRestore(lrtypIncBackup, szRestorePath )
  572. ERR ErrLGLogRestore( LRTYP lrtyp, CHAR * szLogRestorePath );
  573. ERR ErrLGCheckPage( FUCB *pfucb, SHORT cbFreeTotal, SHORT itagNext );
  574. #endif /* logging enabled */
  575. ERR ISAMAPI ErrIsamRestore( CHAR *szRestoreFromPath,
  576. INT crstmap, JET_RSTMAP *rgrstmap, JET_PFNSTATUS pfn );
  577. ERR ErrLGSoftStart( BOOL fAllowNoJetLog );
  578. ERR ErrLGInit( VOID );
  579. ERR ErrLGTerm( VOID );
  580. ERR ErrLGLogRec( LINE *rgline, INT cline, PIB *ppib );
  581. ERR ErrLGEndAllSessions( BOOL fSysDbOnly, BOOL fEndOfLog, LGPOS *plgposRedoFrom );
  582. ERR ErrLGInitLogBuffers( LONG lIntendLogBuffers );
  583. INT CmpLgpos(LGPOS *plgpos1, LGPOS *plgpos2);
  584. ULONG UlLGMSCheckSum( CHAR *pbLrmsNew );
  585. #define FLGOn() (!fLogDisabled)
  586. #define FLGOff() (fLogDisabled)
  587. BOOL FIsNullLgpos( LGPOS *plgpos );
  588. VOID LGMakeLogName( CHAR *szLogName, CHAR *szFName );
  589.