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