home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / edbbcli.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  8.0 KB  |  413 lines

  1. /*
  2.  *    EDBBCLI.H
  3.  *
  4.  *    Microsoft Exchange Information Store
  5.  *    Copyright (C) 1986-1996, Microsoft Corporation
  6.  *
  7.  *    Contains declarations of additional definitions and interfaces
  8.  *    for the Exchange Online Backup Client APIs.
  9.  */
  10.  
  11. #ifndef    _EDBBCLI_
  12. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  13. #define    _EDBBCLI_
  14. #ifdef    __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. #ifdef    MIDL_PASS
  19. #define    RPC_STRING [string]
  20. #else
  21. #define    RPC_STRING
  22. #ifdef __BORLANDC__
  23. typedef wchar_t             WCHAR;
  24. #else
  25. typedef unsigned short WCHAR;
  26. #endif
  27. #endif
  28.  
  29. #define    EDBBACK_MDB_SERVER    "Exchange MDB Database"
  30. #define    EDBBACK_DS_SERVER    "Exchange DS Database"
  31.  
  32. #ifndef    EDBBACK_BUILD
  33. #define    EDBBACK_API    __declspec(dllimport) _stdcall
  34. #else
  35. #define    EDBBACK_API
  36. #endif
  37.  
  38. typedef    DWORD ERR;
  39.  
  40. typedef    LONG HRESULT;
  41. typedef    LONG C;
  42. typedef TCHAR BFT;
  43.  
  44. //
  45. //    Type of backup passed into HrBackupPrepare()
  46. //
  47.  
  48. #define    BACKUP_TYPE_FULL            0x01
  49. #define    BACKUP_TYPE_LOGS_ONLY        0x02
  50.  
  51. //
  52. //    Set the current log number to this value to disable incremental or
  53. //    differential backup.
  54. //
  55. #define    BACKUP_DISABLE_INCREMENTAL    0xffffffff
  56.  
  57. //
  58. //    Backup/Restore file types
  59. //
  60. //
  61. //    Please note that these file types are binary values, even though they are text (or wchar) typed.
  62. //
  63. //    The code in the backup API's rely on the fact that values 0-256 in 8 bit ascii map to the values 0-256 in unicode.
  64. //
  65.  
  66. //
  67. //    If the BFT_DIRECTORY bit is set on the backup file type, it indicates that the path specified is a directory,
  68. //    otherwise it is a file name.
  69. //
  70.  
  71. #define    BFT_DIRECTORY            0x80
  72.  
  73. //
  74. //    If the BFT_DATABASE bit is set on the backup file type, it indicates that the file goes into the database directory.
  75. //
  76.  
  77. #define BFT_DATABASE_DIRECTORY    0x40
  78.  
  79. //
  80. //    If the BFT_LOG bit is set on the backup file type, it indicates that the file goes into the log    directory.
  81. //
  82.  
  83. #define    BFT_LOG_DIRECTORY        0x20
  84.  
  85. //
  86. //    Database logs.
  87. //
  88.  
  89. #define    BFT_LOG                        (BFT)(TEXT('\x01') | BFT_LOG_DIRECTORY)
  90. #define    BFT_LOG_DIR                    (BFT)(TEXT('\x02') | BFT_DIRECTORY)
  91.  
  92. //
  93. //    Checkpoint file.
  94. //
  95.  
  96. #define    BFT_CHECKPOINT_DIR            (BFT)(TEXT('\x03') | BFT_DIRECTORY)
  97.  
  98. //
  99. //    Database types.
  100. //
  101. #define    BFT_MDB_PRIVATE_DATABASE    (BFT)(TEXT('\x05') | BFT_DATABASE_DIRECTORY)
  102. #define    BFT_MDB_PUBLIC_DATABASE        (BFT)(TEXT('\x06') | BFT_DATABASE_DIRECTORY)
  103. #define    BFT_DSA_DATABASE            (BFT)(TEXT('\x07') | BFT_DATABASE_DIRECTORY)
  104.  
  105. //
  106. //    JET patch files
  107. //
  108. //
  109. //    
  110.  
  111. #define    BFT_PATCH_FILE                (BFT)(TEXT('\x08') | BFT_LOG_DIRECTORY)
  112.  
  113. //
  114. //    Catch all for unknown file types.
  115. //
  116.  
  117. #define    BFT_UNKNOWN                    (BFT)(TEXT('\x0f'))
  118.  
  119. #include <edbmsg.h>
  120.  
  121. typedef void *HBC;
  122.  
  123. typedef struct tagEDB_RSTMAPA
  124. {
  125.     RPC_STRING char        *szDatabaseName;
  126.     RPC_STRING char        *szNewDatabaseName;
  127. } EDB_RSTMAPA, *PEDB_RSTMAPA;            /* restore map */
  128.  
  129. //    required for Exchange unicode support.
  130. //    UNDONE: NYI
  131. #define    UNICODE_RSTMAP
  132.  
  133. typedef struct tagEDB_RSTMAPW {
  134.     RPC_STRING WCHAR *wszDatabaseName;
  135.     RPC_STRING WCHAR *wszNewDatabaseName;
  136. } EDB_RSTMAPW, *PEDB_RSTMAPW;
  137.  
  138. #ifdef UNICODE
  139. #define EDB_RSTMAP EDB_RSTMAPW
  140. #define PEDB_RSTMAP PEDB_RSTMAPW
  141. #else
  142. #define EDB_RSTMAP EDB_RSTMAPA
  143. #define PEDB_RSTMAP PEDB_RSTMAPA
  144. #endif
  145.  
  146.  
  147. HRESULT
  148. EDBBACK_API
  149. HrBackupPrepareA(
  150.     IN char * szBackupServer,
  151.     IN char * szBackupAnnotation,
  152.     IN unsigned long grbit,
  153.     IN unsigned long btBackupType,
  154.     OUT HBC *hbcBackupContext
  155.     );
  156.  
  157. HRESULT
  158. EDBBACK_API
  159. HrBackupPrepareW(
  160.     IN WCHAR * wszBackupServer,
  161.     IN WCHAR * wszBackupAnnotation,
  162.     IN unsigned long grbit,
  163.     IN unsigned long btBackupType,
  164.     OUT HBC *hbcBackupContext
  165.     );
  166.  
  167. #ifdef    UNICODE
  168. #define    HrBackupPrepare HrBackupPrepareW
  169. #else
  170. #define    HrBackupPrepare HrBackupPrepareA
  171. #endif
  172.  
  173.  
  174. HRESULT
  175. EDBBACK_API
  176. HrBackupGetDatabaseNamesA(
  177.     IN HBC pvBackupContext,
  178.     OUT LPSTR *ppszAttachmentInformation,
  179.     OUT LPDWORD pcbSize
  180.     );
  181.  
  182. HRESULT
  183. EDBBACK_API
  184. HrBackupGetDatabaseNamesW(
  185.     IN HBC pvBackupContext,
  186.     OUT LPWSTR *ppszAttachmentInformation,
  187.     OUT LPDWORD pcbSize
  188.     );
  189.  
  190. #ifdef    UNICODE
  191. #define    HrBackupGetDatabaseNames HrBackupGetDatabaseNamesW
  192. #else
  193. #define    HrBackupGetDatabaseNames HrBackupGetDatabaseNamesA
  194. #endif
  195.  
  196. HRESULT
  197. EDBBACK_API
  198. HrBackupOpenFileW(
  199.     IN HBC pvBackupContext,
  200.     IN WCHAR * wszAttachmentName,
  201.     IN DWORD cbReadHintSize,
  202.     OUT LARGE_INTEGER *pliFileSize
  203.     );
  204.  
  205. HRESULT
  206. EDBBACK_API
  207. HrBackupOpenFileA(
  208.     IN HBC pvBackupContext,
  209.     IN char * szAttachmentName,
  210.     IN DWORD cbReadHintSize,
  211.     OUT LARGE_INTEGER *pliFileSize
  212.     );
  213.  
  214. #ifdef    UNICODE
  215. #define    HrBackupOpenFile HrBackupOpenFileW
  216. #else
  217. #define HrBackupOpenFile HrBackupOpenFileA
  218. #endif
  219.  
  220.  
  221. HRESULT
  222. EDBBACK_API
  223. HrBackupRead(
  224.     IN HBC pvBackupContext,
  225.     IN PVOID pvBuffer,
  226.     IN DWORD cbBuffer,
  227.     OUT PDWORD pcbRead
  228.     );
  229.  
  230. HRESULT
  231. EDBBACK_API
  232. HrBackupClose(
  233.     IN HBC pvBackupContext
  234.     );
  235.  
  236. HRESULT
  237. EDBBACK_API
  238. HrBackupGetBackupLogsA(
  239.     IN HBC pvBackupContext,
  240.     IN LPSTR *szBackupLogFile,
  241.     IN PDWORD pcbSize
  242.     );
  243.  
  244. HRESULT
  245. EDBBACK_API
  246. HrBackupGetBackupLogsW(
  247.     IN HBC pvBackupContext,
  248.     IN LPWSTR *szBackupLogFile,
  249.     IN PDWORD pcbSize
  250.     );
  251.  
  252. #ifdef    UNICODE
  253. #define    HrBackupGetBackupLogs HrBackupGetBackupLogsW
  254. #else
  255. #define    HrBackupGetBackupLogs HrBackupGetBackupLogsA
  256. #endif
  257.  
  258. HRESULT
  259. EDBBACK_API
  260. HrBackupTruncateLogs(
  261.     IN HBC pvBackupContext
  262.     );
  263.  
  264.  
  265. HRESULT
  266. EDBBACK_API
  267. HrBackupEnd(
  268.     IN HBC pvBackupContext
  269.     );
  270.  
  271.  
  272. VOID
  273. EDBBACK_API
  274. BackupFree(
  275.     IN PVOID pvBuffer
  276.     );
  277.  
  278.  
  279. HRESULT
  280. EDBBACK_API
  281. HrRestoreGetDatabaseLocationsA(
  282.     IN HBC hbcBackupContext,
  283.     OUT LPSTR *ppszDatabaseLocationList,
  284.     OUT LPDWORD pcbSize
  285.     );
  286.  
  287. HRESULT
  288. EDBBACK_API
  289. HrRestoreGetDatabaseLocationsW(
  290.     IN HBC pvBackupContext,
  291.     OUT LPWSTR *ppszDatabaseLocationList,
  292.     OUT LPDWORD pcbSize
  293.     );
  294.  
  295. #ifdef    UNICODE
  296. #define    HrRestoreGetDatabaseLocations HrRestoreGetDatabaseLocationsW
  297. #else
  298. #define    HrRestoreGetDatabaseLocations HrRestoreGetDatabaseLocationsA
  299. #endif
  300.  
  301. HRESULT
  302. EDBBACK_API
  303. HrRestorePrepareA(
  304.     char * szServerName,
  305.     char * szServiceAnnotation,
  306.     HBC *phbcBackupContext
  307.     );
  308.  
  309. HRESULT
  310. EDBBACK_API
  311. HrRestorePrepareW(
  312.     WCHAR * szServerName,
  313.     WCHAR * szServiceAnnotation,
  314.     HBC *phbcBackupContext
  315.     );
  316.  
  317. #ifdef    UNICODE
  318. #define    HrRestorePrepare HrRestorePrepareW
  319. #else
  320. #define    HrRestorePrepare HrRestorePrepareA
  321. #endif
  322.  
  323. //
  324. //    HrRestoreRegister will register a restore
  325. //    operation.  It will interlock all subsequent
  326. //    restore operations, and will prevent the restore target
  327. //    from starting until the call to HrRestoreRegisterComplete.
  328. //
  329.  
  330. HRESULT
  331. EDBBACK_API
  332. HrRestoreRegisterA(
  333.     IN HBC hbcRestoreContext,
  334.     IN char * szCheckpointFilePath,
  335.     IN char * szLogPath,
  336.     IN EDB_RSTMAPA rgrstmap[],
  337.     IN C crstmap,
  338.     IN char * szBackupLogPath,
  339.     IN ULONG genLow,
  340.     IN ULONG genHigh
  341.     );
  342.  
  343. HRESULT
  344. EDBBACK_API
  345. HrRestoreRegisterW(
  346.     IN HBC hbcRestoreContext,
  347.     IN WCHAR * wszCheckpointFilePath,
  348.     IN WCHAR * wszLogPath,
  349.     IN EDB_RSTMAPW rgrstmap[],
  350.     IN C crstmap,
  351.     IN WCHAR * wszBackupLogPath,
  352.     IN ULONG genLow,
  353.     IN ULONG genHigh
  354.     );
  355.  
  356. #ifdef    UNICODE
  357. #define    HrRestoreRegister HrRestoreRegisterW
  358. #else
  359. #define    HrRestoreRegister HrRestoreRegisterA
  360. #endif
  361.  
  362. //
  363. //    HrRestoreRegisterComplete will complete a restore
  364. //    operation.  It will allow further subsequent
  365. //    restore operations, and will allow the restore target
  366. //    to start if hrRestoreState is success.
  367. //
  368. //    If hrRestoreState is NOT hrNone, this will
  369. //    prevent the restore target from restarting.
  370. //
  371.  
  372. HRESULT
  373. EDBBACK_API
  374. HrRestoreRegisterComplete(
  375.     HBC hbcRestoreContext,
  376.     HRESULT hrRestoreState
  377.     );
  378.  
  379. HRESULT
  380. EDBBACK_API
  381. HrRestoreEnd(
  382.     HBC hbcRestoreContext
  383.     );
  384.  
  385. HRESULT
  386. EDBBACK_API
  387. HrSetCurrentBackupLogW(
  388.     WCHAR *wszServerName,
  389.     WCHAR * wszBackupAnnotation,
  390.     DWORD dwCurrentLog
  391.     );
  392.  
  393. HRESULT
  394. EDBBACK_API
  395. HrSetCurrentBackupLogA(
  396.     CHAR * szServerName,
  397.     CHAR * szBackupAnnotation,
  398.     DWORD dwCurrentLog
  399.     );
  400.  
  401. #ifdef    UNICODE
  402. #define    HrSetCurrentBackupLog HrSetCurrentBackupLogW
  403. #else
  404. #define    HrSetCurrentBackupLog HrSetCurrentBackupLogA
  405. #endif
  406.  
  407. #ifdef    __cplusplus
  408. }
  409. #endif
  410.  
  411. #pragma option pop /*P_O_Pop*/
  412. #endif    // _EDBBCLI_
  413.