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.

229 lines
8.9 KiB

  1. #ifndef ISAMAPI_H
  2. #define ISAMAPI_H
  3. #define ISAMAPI
  4. typedef struct
  5. {
  6. JET_COLUMNID columnidSrc;
  7. JET_COLUMNID columnidDest;
  8. } CPCOL;
  9. #define columnidBookmark 0xFFFFFFFF
  10. typedef struct tagSTATUSINFO
  11. {
  12. JET_SESID sesid;
  13. JET_PFNSTATUS pfnStatus; // address of status notification function
  14. JET_SNP snp; // status notification process
  15. JET_SNT snt; // status notification type
  16. ULONG cunitTotal; // total units of work
  17. ULONG cunitDone; // units of work completed
  18. ULONG cunitPerProgression; // units of work per unit of progression
  19. // Detailed statistics:
  20. BOOL fDumpStats; // dump compaction statistics (DEBUG only)
  21. struct _iobuf *hfCompactStats; // handle to compaction statistics file
  22. ULONG timerInitDB;
  23. ULONG timerCopyDB;
  24. ULONG timerInitTable;
  25. ULONG timerCopyRecords;
  26. ULONG timerRebuildIndexes;
  27. ULONG timerCopyTable;
  28. ULONG cDBPagesOwned; // OwnExt of source DB
  29. ULONG cDBPagesAvail; // AvailExt of source DB
  30. char *szTableName; // Name of current table
  31. ULONG cTableFixedVarColumns; // Number of fixed and variable columns in current dest. table
  32. ULONG cTableTaggedColumns; // Number of tagged columns in current dest. table
  33. ULONG cTableInitialPages; // Pages initially allocated to current dest. table
  34. ULONG cTablePagesOwned; // OwnExt of current source table
  35. ULONG cTablePagesAvail; // AvailExt of current source table
  36. ULONG cbRawData; // Bytes of non-LV raw data copied
  37. ULONG cbRawDataLV; // Bytes of LV raw data copied
  38. ULONG cLeafPagesTraversed; // Number of leaf pages traversed in current source table
  39. ULONG cLVPagesTraversed; // Number of long value pages traversed in current source table
  40. ULONG cNCIndexes; // Number of non-clustered indexes in current source table
  41. } STATUSINFO;
  42. /* Typedefs for dispatched APIs. */
  43. /* Please keep in alphabetical order */
  44. typedef ERR ISAMAPI ISAMFNAttachDatabase(JET_VSESID sesid, const char *szFileName, JET_GRBIT grbit );
  45. typedef ERR ISAMAPI ISAMFNBeginExternalBackup( JET_GRBIT grbit );
  46. typedef ERR ISAMAPI ISAMFNBackup( const char *szBackupPath,
  47. JET_GRBIT grbit, JET_PFNSTATUS pfnStatus );
  48. typedef ERR ISAMAPI ISAMFNBeginSession(JET_VSESID *pvsesid);
  49. typedef ERR ISAMAPI ISAMFNInvalidateCursors( JET_VSESID sesid );
  50. typedef ERR ISAMAPI ISAMFNCloseFile( JET_HANDLE hfFile );
  51. typedef ERR ISAMAPI ISAMFNGetSessionInfo( JET_VSESID sesid, JET_GRBIT *pgrbit );
  52. typedef ERR ISAMAPI ISAMFNSetSessionInfo( JET_VSESID sesid, JET_GRBIT grbit );
  53. typedef ERR ISAMAPI ISAMFNBeginTransaction(JET_VSESID sesid);
  54. typedef ERR ISAMAPI ISAMFNCommitTransaction(JET_VSESID sesid, JET_GRBIT grbit);
  55. typedef ERR ISAMAPI ISAMFNCopyRecords(JET_VSESID sesid, JET_TABLEID tableidSrc,
  56. JET_TABLEID tableidDest, CPCOL *rgcpcol, unsigned long ccpcolMax,
  57. long crecMax, unsigned long *pcrowCopy, unsigned long *precidLast,
  58. JET_COLUMNID *mpcolumnidcolumnidTagged, STATUSINFO *pstatus );
  59. typedef ERR ISAMAPI ISAMFNCreateDatabase(JET_VSESID sesid,
  60. const char *szDatabase, const char *szConnect,
  61. JET_DBID *pdbid, JET_GRBIT grbit);
  62. typedef ERR ISAMAPI ISAMFNDetachDatabase(JET_VSESID sesid, const char *szFileName);
  63. typedef ERR ISAMAPI ISAMFNEndExternalBackup( void );
  64. typedef ERR ISAMAPI ISAMFNEndSession(JET_VSESID sesid, JET_GRBIT grbit);
  65. typedef ERR ISAMAPI ISAMFNExternalRestore( char *szCheckpointFilePath, char *szLogPath, JET_RSTMAP *rgstmap, int crstfilemap, char *szBackupLogPath, long genLow, long genHigh, JET_PFNSTATUS pfn );
  66. typedef ERR ISAMAPI ISAMFNGetAttachInfo( void *pv, unsigned long cbMax, unsigned long *pcbActual );
  67. typedef ERR ISAMAPI ISAMFNGetLogInfo( void *pv, unsigned long cbMax, unsigned long *pcbActual );
  68. typedef ERR ISAMAPI ISAMFNIdle(JET_VSESID sesid, JET_GRBIT grbit);
  69. typedef ERR ISAMAPI ISAMFNIndexRecordCount(JET_SESID sesid,
  70. JET_TABLEID tableid, unsigned long *pcrec, unsigned long crecMax);
  71. typedef ERR ISAMAPI ISAMFNInit( unsigned long itib );
  72. typedef ERR ISAMAPI ISAMFNLoggingOn(JET_VSESID sesid);
  73. typedef ERR ISAMAPI ISAMFNLoggingOff(JET_VSESID sesid);
  74. typedef ERR ISAMAPI ISAMFNOpenDatabase(JET_VSESID sesid,
  75. const char *szDatabase, const char *szConnect,
  76. JET_DBID *pdbid, JET_GRBIT grbit);
  77. typedef ERR ISAMAPI ISAMFNOpenFile( const char *szFileName,
  78. JET_HANDLE *phfFile,
  79. unsigned long *pulFileSizeLow,
  80. unsigned long *pulFileSizeHigh );
  81. typedef ERR ISAMAPI ISAMFNOpenTempTable( JET_VSESID sesid,
  82. const JET_COLUMNDEF *prgcolumndef,
  83. unsigned long ccolumn,
  84. unsigned long langid,
  85. JET_GRBIT grbit,
  86. JET_TABLEID *ptableid,
  87. JET_COLUMNID *prgcolumnid );
  88. typedef ERR ISAMAPI ISAMFNReadFile( JET_HANDLE hfFile, void *pv, unsigned long cbMax, unsigned long *pcbActual );
  89. typedef ERR ISAMAPI ISAMFNRepairDatabase(JET_VSESID sesid, const char *szFilename,
  90. JET_PFNSTATUS pfnStatus);
  91. typedef ERR ISAMAPI ISAMFNRestore( char *szRestoreFromPath, JET_PFNSTATUS pfn );
  92. typedef ERR ISAMAPI ISAMFNRestore2( char *szRestoreFromPath, char *szDestPath, JET_PFNSTATUS pfn );
  93. typedef ERR ISAMAPI ISAMFNRollback(JET_VSESID sesid, JET_GRBIT grbit);
  94. typedef ERR ISAMAPI ISAMFNSetSystemParameter(JET_VSESID sesid,
  95. unsigned long paramid, unsigned long l, const void *sz);
  96. typedef ERR ISAMAPI ISAMFNSetWaitLogFlush( JET_VSESID sesid, long lmsec );
  97. typedef ERR ISAMAPI ISAMFNResetCounter( JET_SESID sesid, int CounterType );
  98. typedef ERR ISAMAPI ISAMFNGetCounter( JET_SESID sesid, int CounterType, long *plValue );
  99. typedef ERR ISAMAPI ISAMFNSetCommitDefault( JET_VSESID sesid, long lmsec );
  100. typedef ERR ISAMAPI ISAMFNTerm( JET_GRBIT grbit );
  101. typedef ERR ISAMAPI ISAMFNTruncateLog( void );
  102. typedef ERR ISAMAPI FNDeleteFile(const char *szFilename);
  103. typedef ERR ISAMAPI ISAMFNCompact( JET_SESID sesid, const char *szDatabaseSrc,
  104. const char *szDatabaseDest, JET_PFNSTATUS pfnStatus,
  105. JET_CONVERT *pconvert, JET_GRBIT grbit );
  106. typedef ERR ISAMAPI ISAMFNDBUtilities( JET_SESID sesid, JET_DBUTIL *pdbutil );
  107. typedef struct ISAMDEF {
  108. ISAMFNAttachDatabase *pfnAttachDatabase;
  109. ISAMFNBackup *pfnBackup;
  110. ISAMFNBeginSession *pfnBeginSession;
  111. ISAMFNBeginTransaction *pfnBeginTransaction;
  112. ISAMFNCommitTransaction *pfnCommitTransaction;
  113. ISAMFNCreateDatabase *pfnCreateDatabase;
  114. ISAMFNDetachDatabase *pfnDetachDatabase;
  115. ISAMFNEndSession *pfnEndSession;
  116. ISAMFNIdle *pfnIdle;
  117. ISAMFNInit *pfnInit;
  118. ISAMFNLoggingOn *pfnLoggingOn;
  119. ISAMFNLoggingOff *pfnLoggingOff;
  120. ISAMFNOpenDatabase *pfnOpenDatabase;
  121. ISAMFNOpenTempTable *pfnOpenTempTable;
  122. ISAMFNRepairDatabase *pfnRepairDatabase;
  123. ISAMFNRestore *pfnRestore;
  124. ISAMFNRollback *pfnRollback;
  125. ISAMFNSetSystemParameter *pfnSetSystemParameter;
  126. ISAMFNTerm *pfnTerm;
  127. } ISAMDEF;
  128. /* The following ISAM APIs are not dispatched */
  129. typedef ERR ISAMAPI ISAMFNLoad(ISAMDEF * *ppisamdef);
  130. /* Declarations for the built-in ISAM which is called directly. */
  131. extern ISAMFNAttachDatabase ErrIsamAttachDatabase;
  132. extern ISAMFNBackup ErrIsamBackup;
  133. extern ISAMFNBeginSession ErrIsamBeginSession;
  134. extern ISAMFNBeginExternalBackup ErrIsamBeginExternalBackup;
  135. extern ISAMFNBeginTransaction ErrIsamBeginTransaction;
  136. extern ISAMFNCloseFile ErrIsamCloseFile;
  137. extern ISAMFNCommitTransaction ErrIsamCommitTransaction;
  138. extern ISAMFNCopyRecords ErrIsamCopyRecords;
  139. extern ISAMFNCreateDatabase ErrIsamCreateDatabase;
  140. extern ISAMFNDetachDatabase ErrIsamDetachDatabase;
  141. extern ISAMFNEndExternalBackup ErrIsamEndExternalBackup;
  142. extern ISAMFNEndSession ErrIsamEndSession;
  143. extern ISAMFNExternalRestore ErrIsamExternalRestore;
  144. extern ISAMFNGetAttachInfo ErrIsamGetAttachInfo;
  145. extern ISAMFNGetLogInfo ErrIsamGetLogInfo;
  146. extern ISAMFNIdle ErrIsamIdle;
  147. extern ISAMFNIndexRecordCount ErrIsamIndexRecordCount;
  148. extern ISAMFNInit ErrIsamInit;
  149. extern ISAMFNLoggingOn ErrIsamLoggingOn;
  150. extern ISAMFNLoggingOff ErrIsamLoggingOff;
  151. extern ISAMFNOpenDatabase ErrIsamOpenDatabase;
  152. extern ISAMFNOpenFile ErrIsamOpenFile;
  153. extern ISAMFNOpenTempTable ErrIsamOpenTempTable;
  154. extern ISAMFNReadFile ErrIsamReadFile;
  155. extern ISAMFNRepairDatabase ErrIsamRepairDatabase;
  156. extern ISAMFNRestore ErrIsamRestore;
  157. extern ISAMFNRestore2 ErrIsamRestore2;
  158. extern ISAMFNRollback ErrIsamRollback;
  159. extern ISAMFNSetSessionInfo ErrIsamSetSessionInfo;
  160. extern ISAMFNGetSessionInfo ErrIsamGetSessionInfo;
  161. extern ISAMFNSetSystemParameter ErrIsamSetSystemParameter;
  162. extern ISAMFNSetWaitLogFlush ErrIsamSetWaitLogFlush;
  163. extern ISAMFNResetCounter ErrIsamResetCounter;
  164. extern ISAMFNGetCounter ErrIsamGetCounter;
  165. extern ISAMFNSetCommitDefault ErrIsamSetCommitDefault;
  166. extern ISAMFNTerm ErrIsamTerm;
  167. extern ISAMFNTruncateLog ErrIsamTruncateLog;
  168. extern ISAMFNCompact ErrIsamCompact;
  169. extern ISAMFNInvalidateCursors ErrIsamInvalidateCursors;
  170. extern ISAMFNDBUtilities ErrIsamDBUtilities;
  171. extern FNDeleteFile ErrDeleteFile;
  172. #endif /* !ISAMAPI_H */