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

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  2. //+--------------------------------------------------------------------------
  3. //
  4. // Microsoft Windows
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File:        certbcli.h
  8. //
  9. // Contents:    Cert Server backup client APIs
  10. //
  11. //---------------------------------------------------------------------------
  12.  
  13. #ifdef _CERTBCLI_TYPECHECK
  14. #undef __CERTBCLI_H__    // allow redundant include
  15. #endif
  16.  
  17. #ifndef __CERTBCLI_H__
  18. #define __CERTBCLI_H__
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #ifdef    MIDL_PASS
  25. #define    RPC_STRING [string]
  26. #else
  27. #define    RPC_STRING
  28. #endif
  29.  
  30. #define IN
  31. #define OUT
  32. #define OPTIONAL
  33. #define VOID        void
  34.  
  35. #define CERTBCLI_CALL    __stdcall
  36.  
  37. #ifndef _CERTBCLI_DEFINED
  38. #define CERTBCLI_API __declspec(dllimport) CERTBCLI_CALL
  39. #else
  40. #define CERTBCLI_API
  41. #endif
  42.  
  43. #define szBACKUPANNOTATION   "Cert Server Backup Interface"
  44. #define wszBACKUPANNOTATION  TEXT(szBACKUPANNOTATION)
  45.  
  46. #define szRESTOREANNOTATION  "Cert Server Restore Interface"
  47. #define wszRESTOREANNOTATION TEXT(szRESTOREANNOTATION)
  48.  
  49.  
  50. // Type of Backup passed to CertSrvBackupPrepare:
  51. // CSBACKUP_TYPE_FULL: Requesting backup of the complete DB (DB & Log files)
  52. // CSBACKUP_TYPE_LOGS_ONLY: Requesting backup of only the log files
  53. // CSBACKUP_TYPE_INCREMENTAL: Requesting incremental backup
  54.  
  55. // CertSrvBackupPrepare flags:
  56. #define CSBACKUP_TYPE_FULL        0x00000001
  57. #define CSBACKUP_TYPE_LOGS_ONLY        0x00000002
  58. //#define CSBACKUP_TYPE_INCREMENTAL    0x00000004    // not yet supported
  59. #define CSBACKUP_TYPE_MASK        0x00000003    // valid flags
  60.  
  61. // Type of Restore passed to CertSrvRestorePrepare:
  62. // CSRESTORE_TYPE_FULL: Requesting restore of the complete DB (DB & Log files)
  63. // CSRESTORE_TYPE_ONLINE: Restoration is done when Cert Server is online.
  64.  
  65. #define CSRESTORE_TYPE_FULL        0x00000001    // else incremental
  66. #define CSRESTORE_TYPE_ONLINE        0x00000002    // not yet supported
  67. #define CSRESTORE_TYPE_CATCHUP        0x00000004    // not yet supported
  68. #define CSRESTORE_TYPE_MASK        0x00000005    // valid flags
  69.  
  70.  
  71. // Setting the current log # to this value would disable incremental backup
  72. #define CSBACKUP_DISABLE_INCREMENTAL  0xffffffff
  73.  
  74.  
  75. // BFT is the bit flag used to represent file types (directory/dit/logfile/etc.)
  76. // We keep them as a character so that we can append/prepend them to the actual
  77. // file path. The code in the Backup API's rely on the fact that values 0-256
  78. // in 8 bit ascii map to the values 0-256 in unicode.
  79.  
  80. #ifdef UNICODE
  81.     typedef WCHAR CSBFT;
  82. #endif
  83.  
  84.  
  85. // Bit flags:
  86. //  CSBFT_DIRECTORY               - path specified is a directory
  87. //  CSBFT_DATABASE_DIRECTORY      - that file goes into database directory
  88. //  CSBFT_LOG_DIRECTORY           - that the file goes into log directory
  89.  
  90. #define    CSBFT_DIRECTORY            0x80
  91. #define CSBFT_DATABASE_DIRECTORY    0x40
  92. #define    CSBFT_LOG_DIRECTORY        0x20
  93.  
  94. // Following combinations are defined for easy use of the filetype and the
  95. // directory into into which it goes
  96.  
  97. #define    CSBFT_LOG          ((CSBFT) (TEXT('\x01') | CSBFT_LOG_DIRECTORY))
  98. #define    CSBFT_LOG_DIR          ((CSBFT) (TEXT('\x02') | CSBFT_DIRECTORY))
  99. #define    CSBFT_CHECKPOINT_DIR      ((CSBFT) (TEXT('\x03') | CSBFT_DIRECTORY))
  100. #define    CSBFT_CERTSERVER_DATABASE ((CSBFT) (TEXT('\x04') | CSBFT_DATABASE_DIRECTORY))
  101. #define    CSBFT_PATCH_FILE      ((CSBFT) (TEXT('\x05') | CSBFT_LOG_DIRECTORY))
  102. #define    CSBFT_UNKNOWN          ((CSBFT) (TEXT('\x0f')))
  103.  
  104.  
  105. // Backup Context Handle
  106. typedef void *HCSBC;
  107.  
  108. #ifndef CSEDB_RSTMAP
  109. typedef struct tagCSEDB_RSTMAPW {
  110.     RPC_STRING WCHAR *pwszDatabaseName;
  111.     RPC_STRING WCHAR *pwszNewDatabaseName;
  112. } CSEDB_RSTMAPW;
  113.  
  114. #ifdef UNICODE
  115. # define CSEDB_RSTMAP CSEDB_RSTMAPW
  116. #endif
  117. #endif // CSEDB_RSTMAP
  118.  
  119.  
  120. // For all the functions in this interface that have at least one string
  121. // parameter, provide macros to invoke the appropriate version of the
  122. // corresponding function.
  123.  
  124. #ifdef UNICODE
  125.  
  126. #define CertSrvIsServerOnline        CertSrvIsServerOnlineW
  127. #define CertSrvBackupGetDynamicFileList    CertSrvBackupGetDynamicFileListW
  128. #define CertSrvBackupPrepare        CertSrvBackupPrepareW
  129. #define CertSrvBackupGetDatabaseNames    CertSrvBackupGetDatabaseNamesW
  130. #define CertSrvBackupOpenFile        CertSrvBackupOpenFileW
  131. #define CertSrvBackupGetBackupLogs    CertSrvBackupGetBackupLogsW
  132.  
  133. #define CertSrvRestoreGetDatabaseLocations CertSrvRestoreGetDatabaseLocationsW
  134. #define CertSrvRestorePrepare        CertSrvRestorePrepareW
  135. #define CertSrvRestoreRegister        CertSrvRestoreRegisterW
  136.  
  137. #define CertSrvServerControl        CertSrvServerControlW
  138.  
  139. #endif // #ifdef UNICODE
  140.  
  141.  
  142. //+--------------------------------------------------------------------------
  143. // CertSrvIsServerOnline -- check to see if the Cert Server is Online on the
  144. //    given server. This call is guaranteed to return quickly.
  145. //
  146. // Parameters:
  147. //    [in]  pwszServerName - name or config string of the server to check
  148. //    [out] pfServerOnline - pointer to receive the bool result
  149. //        (TRUE if Cert Server is online; FALSE, otherwise)
  150. // Returns:
  151. //    S_OK if the call executed successfully;
  152. //    Failure code otherwise.
  153. //+--------------------------------------------------------------------------
  154.  
  155. typedef HRESULT (CERTBCLI_CALL FNCERTSRVISSERVERONLINEW)(
  156.     IN  WCHAR const *pwszServerName,
  157.     OUT BOOL *pfServerOnline);
  158.  
  159. HRESULT
  160. CERTBCLI_API
  161. CertSrvIsServerOnlineW(
  162.     IN  WCHAR const *pwszServerName,
  163.     OUT BOOL *pfServerOnline);
  164.  
  165. #ifdef _CERTBCLI_TYPECHECK
  166. FNCERTSRVISSERVERONLINEW *pfnCertSrvIsServerOnline = CertSrvIsServerOnline;
  167. #endif
  168.  
  169.  
  170. //+--------------------------------------------------------------------------
  171. // CertSrvBackupGetDynamicFileList -- return the list of dynamic files that
  172. //    need to be backed up in addition to database files.
  173. //
  174. // Parameters:
  175. //    [in]  hbc - backup context handle
  176. //    [out] ppwszzFileList - pointer to receive the pointer to the file list;
  177. //        allocated memory should be freed using CertSrvBackupFree() API
  178. //        by the caller when it is no longer needed; The file list info
  179. //        is an array of null-terminated filenames and the list is
  180. //        terminated by two L'\0's.
  181. //    [out] pcbSize - will receive the number of bytes returned
  182. //
  183. // Returns:
  184. //    S_OK if the call executed successfully;
  185. //    Failure code otherwise.
  186. //---------------------------------------------------------------------------
  187.  
  188. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPGETDYNAMICFILELISTW)(
  189.     IN  HCSBC hbc,
  190.     OUT WCHAR **ppwszzFileList,
  191.     OUT DWORD *pcbSize);
  192.  
  193. HRESULT
  194. CERTBCLI_API
  195. CertSrvBackupGetDynamicFileListW(
  196.     IN  HCSBC hbc,
  197.     OUT WCHAR **ppwszzFileList,
  198.     OUT DWORD *pcbSize);
  199.  
  200. #ifdef _CERTBCLI_TYPECHECK
  201. FNCERTSRVBACKUPGETDYNAMICFILELISTW *pfnCertSrvBackupGetDynamicFileList = CertSrvBackupGetDynamicFileList;
  202. #endif
  203.  
  204.  
  205. //+--------------------------------------------------------------------------
  206. // CertSrvBackupPrepare -- prepare the DB for the online backup and return a
  207. //    Backup Context Handle to be used for subsequent calls to backup
  208. //    functions.
  209. //
  210. // Parameters:
  211. //    [in]  pwszServerName - name or config string of the server to check
  212. //    [in]  grbitJet - flag to be passed to jet while backing up dbs
  213. //    [in]  dwBackupFlags - CSBACKUP_TYPE_FULL or CSBACKUP_TYPE_LOGS_ONLY
  214. //    [out] phbc - pointer that will receive the backup context handle
  215. //
  216. // Returns:
  217. //    S_OK if the call executed successfully;
  218. //    Failure code otherwise.
  219. //---------------------------------------------------------------------------
  220.  
  221. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPPREPAREW)(
  222.     IN  WCHAR const *pwszServerName,
  223.     IN  ULONG grbitJet,
  224.     IN  ULONG dwBackupFlags,    // CSBACKUP_TYPE_*
  225.     OUT HCSBC *phbc);
  226.  
  227. HRESULT
  228. CERTBCLI_API
  229. CertSrvBackupPrepareW(
  230.     IN  WCHAR const *pwszServerName,
  231.     IN  ULONG grbitJet,
  232.     IN  ULONG dwBackupFlags,    // CSBACKUP_TYPE_*
  233.     OUT HCSBC *phbc);
  234.  
  235. #ifdef _CERTBCLI_TYPECHECK
  236. FNCERTSRVBACKUPPREPAREW *pfnCertSrvBackupPrepare = CertSrvBackupPrepare;
  237. #endif
  238.  
  239.  
  240. //+--------------------------------------------------------------------------
  241. // CertSrvBackupGetDatabaseNames -- return the list of data bases that need to
  242. //    be backed up for the given backup context
  243. //
  244. // Parameters:
  245. //    [in]  hbc - backup context handle
  246. //    [out] ppwszzAttachmentInformation - pointer to receive the pointer to
  247. //        the attachment info; allocated memory should be freed using
  248. //        CertSrvBackupFree() API by the caller when it is no longer
  249. //        needed; Attachment info is an array of null-terminated
  250. //        filenames and the list is terminated by two L'\0's.
  251. //    [out] pcbSize - will receive the number of bytes returned
  252. //
  253. // Returns:
  254. //    S_OK if the call executed successfully;
  255. //    Failure code otherwise.
  256. //---------------------------------------------------------------------------
  257.  
  258. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPGETDATABASENAMESW)(
  259.     IN  HCSBC hbc,
  260.     OUT WCHAR **ppwszzAttachmentInformation,
  261.     OUT DWORD *pcbSize);
  262.  
  263. HRESULT
  264. CERTBCLI_API
  265. CertSrvBackupGetDatabaseNamesW(
  266.     IN  HCSBC hbc,
  267.     OUT WCHAR **ppwszzAttachmentInformation,
  268.     OUT DWORD *pcbSize);
  269.  
  270. #ifdef _CERTBCLI_TYPECHECK
  271. FNCERTSRVBACKUPGETDATABASENAMESW *pfnCertSrvBackupGetDatabaseNames = CertSrvBackupGetDatabaseNames;
  272. #endif
  273.  
  274.  
  275. //+--------------------------------------------------------------------------
  276. // CertSrvBackupOpenFile -- open the given attachment for read.
  277. //
  278. // Parameters:
  279. //    [in]  hbc - backup context handle
  280. //    [in]  pwszAttachmentName - name of the attachment to be opened for read
  281. //    [in]  cbReadHintSize - suggested size in bytes that might be used
  282. //        during the subsequent reads on this attachment
  283. //    [out] pliFileSize - pointer to a large integer that would receive the
  284. //        size in bytes of the given attachment
  285. // Returns:
  286. //    S_OK if the call executed successfully;
  287. //    Failure code otherwise.
  288. //---------------------------------------------------------------------------
  289.  
  290. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPOPENFILEW)(
  291.     IN  HCSBC hbc,
  292.     IN  WCHAR const *pwszAttachmentName,
  293.     IN  DWORD cbReadHintSize,
  294.     OUT LARGE_INTEGER *pliFileSize);
  295.  
  296. HRESULT
  297. CERTBCLI_API
  298. CertSrvBackupOpenFileW(
  299.     IN  HCSBC hbc,
  300.     IN  WCHAR const *pwszAttachmentName,
  301.     IN  DWORD cbReadHintSize,
  302.     OUT LARGE_INTEGER *pliFileSize);
  303.  
  304. #ifdef _CERTBCLI_TYPECHECK
  305. FNCERTSRVBACKUPOPENFILEW *pfnCertSrvBackupOpenFile = CertSrvBackupOpenFile;
  306. #endif
  307.  
  308.  
  309. //+--------------------------------------------------------------------------
  310. // CertSrvBackupRead -- read the currently open attachment bytes into the given
  311. //    buffer.  The client application is expected to call this function
  312. //    repeatedly until it gets the entire file (the application would have
  313. //    received the file size through the CertSrvBackupOpenFile call before.
  314. //
  315. // Parameters:
  316. //    [in]  hbc - backup context handle
  317. //    [out] pvBuffer - pointer to the buffer that would receive the read data.
  318. //    [in]  cbBuffer - specifies the size of the above buffer
  319. //    [out] pcbRead - pointer to receive the actual number of bytes read.
  320. //
  321. // Returns:
  322. //    S_OK if the call executed successfully;
  323. //    Failure code otherwise.
  324. //---------------------------------------------------------------------------
  325.  
  326. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPREAD)(
  327.     IN  HCSBC hbc,
  328.     OUT VOID *pvBuffer,
  329.     IN  DWORD cbBuffer,
  330.     OUT DWORD *pcbRead);
  331.  
  332. HRESULT
  333. CERTBCLI_API
  334. CertSrvBackupRead(
  335.     IN  HCSBC hbc,
  336.     OUT VOID *pvBuffer,
  337.     IN  DWORD cbBuffer,
  338.     OUT DWORD *pcbRead);
  339.  
  340. #ifdef _CERTBCLI_TYPECHECK
  341. FNCERTSRVBACKUPREAD *pfnCertSrvBackupRead = CertSrvBackupRead;
  342. #endif
  343.  
  344.  
  345. //+--------------------------------------------------------------------------
  346. // CertSrvBackupClose -- called by the application after it completes reading all
  347. //    the data in the currently opened attachement.
  348. //
  349. // Parameters:
  350. //    [in] hbc - backup context handle
  351. //
  352. // Returns:
  353. //    S_OK if the call executed successfully;
  354. //    Failure code otherwise.
  355. //---------------------------------------------------------------------------
  356.  
  357. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPCLOSE)(
  358.     IN HCSBC hbc);
  359.  
  360. HRESULT
  361. CERTBCLI_API
  362. CertSrvBackupClose(
  363.     IN HCSBC hbc);
  364.  
  365. #ifdef _CERTBCLI_TYPECHECK
  366. FNCERTSRVBACKUPCLOSE *pfnCertSrvBackupClose = CertSrvBackupClose;
  367. #endif
  368.  
  369.  
  370. //+--------------------------------------------------------------------------
  371. // CertSrvBackupGetBackupLogs -- return the list of log files that need to be
  372. //    backed up for the given backup context
  373. //
  374. // Parameters:
  375. //    [in]  hbc - backup context handle
  376. //    [out] pwszzBackupLogFiles - pointer that will receive the pointer to
  377. //        the list of log files; allocated memory should be freed using
  378. //        CertSrvBackupFree() API by the caller when it is no
  379. //        longer needed; Log files are returned in an array of
  380. //        null-terminated filenames and the list is terminated by two
  381. //        L'\0's
  382. //    [out] pcbSize - will receive the number of bytes returned
  383. //
  384. // Returns:
  385. //    S_OK if the call executed successfully;
  386. //    Failure code otherwise.
  387. //---------------------------------------------------------------------------
  388.  
  389. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPGETBACKUPLOGSW)(
  390.     IN  HCSBC hbc,
  391.     OUT WCHAR **ppwszzBackupLogFiles,
  392.     OUT DWORD *pcbSize);
  393.  
  394. HRESULT
  395. CERTBCLI_API
  396. CertSrvBackupGetBackupLogsW(
  397.     IN  HCSBC hbc,
  398.     OUT WCHAR **ppwszzBackupLogFiles,
  399.     OUT DWORD *pcbSize);
  400.  
  401. #ifdef _CERTBCLI_TYPECHECK
  402. FNCERTSRVBACKUPGETBACKUPLOGSW *pfnCertSrvBackupGetBackupLogs = CertSrvBackupGetBackupLogs;
  403. #endif
  404.  
  405.  
  406. //+--------------------------------------------------------------------------
  407. // CertSrvBackupTruncateLogs -- called to truncate the already read backup logs.
  408. //
  409. // Parameters:
  410. //    [in] hbc - backup context handle
  411. //
  412. // Returns:
  413. //    S_OK if the call executed successfully;
  414. //    Failure code otherwise.
  415. //---------------------------------------------------------------------------
  416.  
  417. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPTRUNCATELOGS)(
  418.     IN HCSBC hbc);
  419.  
  420. HRESULT
  421. CERTBCLI_API
  422. CertSrvBackupTruncateLogs(
  423.     IN HCSBC hbc);
  424.  
  425. #ifdef _CERTBCLI_TYPECHECK
  426. FNCERTSRVBACKUPTRUNCATELOGS *pfnCertSrvBackupTruncateLogs = CertSrvBackupTruncateLogs;
  427. #endif
  428.  
  429.  
  430. //+--------------------------------------------------------------------------
  431. // CertSrvBackupEnd -- called to end the current backup session.
  432. //
  433. // Parameters:
  434. //    [in] hbc - backup context handle of the backup session
  435. //
  436. // Returns:
  437. //    S_OK if the call executed successfully;
  438. //    Failure code otherwise.
  439. //---------------------------------------------------------------------------
  440.  
  441. typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPEND)(
  442.     IN HCSBC hbc);
  443.  
  444. HRESULT
  445. CERTBCLI_API
  446. CertSrvBackupEnd(
  447.     IN HCSBC hbc);
  448.  
  449. #ifdef _CERTBCLI_TYPECHECK
  450. FNCERTSRVBACKUPEND *pfnCertSrvBackupEnd = CertSrvBackupEnd;
  451. #endif
  452.  
  453.  
  454. //+--------------------------------------------------------------------------
  455. // CertSrvBackupFree -- free any buffer allocated by certbcli.dll APIs.
  456. //
  457. // Parameters:
  458. //    [in] pv - pointer to the buffer that is to be freed.
  459. //
  460. // Returns:
  461. //    None.
  462. //---------------------------------------------------------------------------
  463.  
  464. typedef VOID (CERTBCLI_CALL FNCERTSRVBACKUPFREE)(
  465.     IN VOID *pv);
  466.  
  467. VOID
  468. CERTBCLI_API
  469. CertSrvBackupFree(
  470.     IN VOID *pv);
  471.  
  472. #ifdef _CERTBCLI_TYPECHECK
  473. FNCERTSRVBACKUPFREE *pfnCertSrvBackupFree = CertSrvBackupFree;
  474. #endif
  475.  
  476.  
  477. //+--------------------------------------------------------------------------
  478. // CertSrvRestoreGetDatabaseLocations -- called both at backup time as well as
  479. //    at restorate time to get data base locations for different types of
  480. //    files.
  481. //
  482. // Parameters:
  483. //    [in]  hbc - backup context handle which would have been obtained
  484. //        through CertSrvBackupPrepare in the backup case and through
  485. //        CertSrvRestorePrepare in the restore case.
  486. //    [out] ppwszzDatabaseLocationList - pointer that will receive the
  487. //        pointer to the list of database locations; allocated memory
  488. //        should be freed using CertSrvBackupFree() API by the caller
  489. //        when it is no longer needed; locations are returned in an array
  490. //        of null-terminated names and and the list is terminated by
  491. //        two L'\0's.  The first character of each name is the BFT
  492. //        character that indicates the type of the file and the rest of
  493. //        the name tells gives the path into which that particular type
  494. //        of file should be restored.
  495. //    [out] pcbSize - will receive the number of bytes returned
  496. //
  497. // Returns:
  498. //    S_OK if the call executed successfully;
  499. //    Failure code otherwise.
  500. //---------------------------------------------------------------------------
  501.  
  502. typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREGETDATABASELOCATIONSW)(
  503.     IN  HCSBC hbc,
  504.     OUT WCHAR **ppwszzDatabaseLocationList,
  505.     OUT DWORD *pcbSize);
  506.  
  507. HRESULT
  508. CERTBCLI_API
  509. CertSrvRestoreGetDatabaseLocationsW(
  510.     IN  HCSBC hbc,
  511.     OUT WCHAR **ppwszzDatabaseLocationList,
  512.     OUT DWORD *pcbSize);
  513.  
  514. #ifdef _CERTBCLI_TYPECHECK
  515. FNCERTSRVRESTOREGETDATABASELOCATIONSW *pfnCertSrvRestoreGetDatabaseLocations = CertSrvRestoreGetDatabaseLocations;
  516. #endif
  517.  
  518.  
  519. //+--------------------------------------------------------------------------
  520. // CertSrvRestorePrepare -- indicate beginning of a restore session.
  521. //
  522. // Parameters:
  523. //    [in]  pwszServerName - name or config string of the server into which
  524. //        the restore operation is going to be performed.
  525. //    [in]  dwRestoreFlags -  Or'ed combination of CSRESTORE_TYPE_* flags;
  526. //        0 if no special flags are to be specified
  527. //    [out] phbc - pointer to receive the backup context handle which is to
  528. //        be passed to the subsequent restore APIs
  529. //
  530. // Returns:
  531. //    S_OK if the call executed successfully;
  532. //    Failure code otherwise.
  533. //---------------------------------------------------------------------------
  534.  
  535. typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREPREPAREW)(
  536.     IN  WCHAR const *pwszServerName,
  537.     IN  ULONG dwRestoreFlags,
  538.     OUT HCSBC *phbc);
  539.  
  540. HRESULT
  541. CERTBCLI_API
  542. CertSrvRestorePrepareW(
  543.     IN  WCHAR const *pwszServerName,
  544.     IN  ULONG dwRestoreFlags,        // CSRESTORE_TYPE_*
  545.     OUT HCSBC *phbc);
  546.  
  547. #ifdef _CERTBCLI_TYPECHECK
  548. FNCERTSRVRESTOREPREPAREW *pfnCertSrvRestorePrepare = CertSrvRestorePrepare;
  549. #endif
  550.  
  551.  
  552. //+--------------------------------------------------------------------------
  553. // CertSrvRestoreRegister -- register a restore operation. It will interlock
  554. //    all subsequent restore operations, and will prevent the restore target
  555. //    from starting until the call to CertSrvRestoreRegisterComplete is made.
  556. //
  557. // Parameters:
  558. //    [in] hbc - backup context handle for the restore session.
  559. //    [in] pwszCheckPointFilePath - path to restore the check point files
  560. //    [in] pwszLogPath - path where the log files are restored
  561. //    [in] rgrstmap - restore map
  562. //    [in] crstmap - tells if there is a new restore map
  563. //    [in] pwszBackupLogPath - path where the backup logs are located
  564. //    [in] genLow - Lowest log# that was restored in this restore session
  565. //    [in] genHigh - Highest log# that was restored in this restore session
  566. //
  567. // Returns:
  568. //    S_OK if the call executed successfully;
  569. //    Failure code otherwise.
  570. //---------------------------------------------------------------------------
  571.  
  572. typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREREGISTERW)(
  573.     OPTIONAL IN HCSBC hbc,
  574.     OPTIONAL IN WCHAR const *pwszCheckPointFilePath,
  575.     OPTIONAL IN WCHAR const *pwszLogPath,
  576.     OPTIONAL IN CSEDB_RSTMAPW rgrstmap[],
  577.     IN LONG crstmap,
  578.     OPTIONAL IN WCHAR const *pwszBackupLogPath,
  579.     IN ULONG genLow,
  580.     IN ULONG genHigh);
  581.  
  582. HRESULT
  583. CERTBCLI_API
  584. CertSrvRestoreRegisterW(
  585.     OPTIONAL IN HCSBC hbc,
  586.     OPTIONAL IN WCHAR const *pwszCheckPointFilePath,
  587.     OPTIONAL IN WCHAR const *pwszLogPath,
  588.     OPTIONAL IN CSEDB_RSTMAPW rgrstmap[],
  589.     IN LONG crstmap,
  590.     OPTIONAL IN WCHAR const *pwszBackupLogPath,
  591.     IN ULONG genLow,
  592.     IN ULONG genHigh);
  593.  
  594. #ifdef _CERTBCLI_TYPECHECK
  595. FNCERTSRVRESTOREREGISTERW *pfnCertSrvRestoreRegister = CertSrvRestoreRegister;
  596. #endif
  597.  
  598.  
  599. //+--------------------------------------------------------------------------
  600. // CertSrvRestoreRegisterComplete -- indicate that a previously registered
  601. //    restore is complete.
  602. //
  603. // Parameters:
  604. //    [in] hbc - backup context handle
  605. //    [in] hrRestoreState - success code if the restore was successful
  606. //
  607. // Returns:
  608. //    S_OK if the call executed successfully;
  609. //    Failure code otherwise.
  610. //---------------------------------------------------------------------------
  611.  
  612. typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREREGISTERCOMPLETE)(
  613.     OPTIONAL IN HCSBC hbc,
  614.     IN HRESULT hrRestoreState);
  615.  
  616. HRESULT
  617. CERTBCLI_API
  618. CertSrvRestoreRegisterComplete(
  619.     OPTIONAL IN HCSBC hbc,
  620.     IN HRESULT hrRestoreState);
  621.  
  622. #ifdef _CERTBCLI_TYPECHECK
  623. FNCERTSRVRESTOREREGISTERCOMPLETE *pfnCertSrvRestoreRegisterComplete = CertSrvRestoreRegisterComplete;
  624. #endif
  625.  
  626.  
  627. //+--------------------------------------------------------------------------
  628. // CertSrvRestoreEnd -- end a restore session
  629. //
  630. // Parameters:
  631. //    [in] hbc - backup context handle
  632. //
  633. // Returns:
  634. //    S_OK if the call executed successfully;
  635. //    Failure code otherwise.
  636. //---------------------------------------------------------------------------
  637.  
  638. typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREEND)(
  639.     IN HCSBC hbc);
  640.  
  641. HRESULT
  642. CERTBCLI_API
  643. CertSrvRestoreEnd(
  644.     IN HCSBC hbc);
  645.  
  646. #ifdef _CERTBCLI_TYPECHECK
  647. FNCERTSRVRESTOREEND *pfnCertSrvRestoreEnd = CertSrvRestoreEnd;
  648. #endif
  649.  
  650.  
  651. //+--------------------------------------------------------------------------
  652. // CertSrvServerControl -- send a control command to the cert server.
  653. //
  654. // Parameters:
  655. //    [in]  pwszServerName - name or config string of the server to control
  656. //    [in]  dwControlFlags - control command and flags
  657. //    [out] pcbOut - pointer to receive the size of command output data
  658. //    [out] ppbOut - pointer to receive command output data.  Use the
  659. //        CertSrvBackupFree() API to free the buffer.
  660. //
  661. // Returns:
  662. //    S_OK if the call executed successfully;
  663. //    Failure code otherwise.
  664. //---------------------------------------------------------------------------
  665.  
  666. #define CSCONTROL_SHUTDOWN        0x000000001
  667. #define CSCONTROL_SUSPEND        0x000000002
  668. #define CSCONTROL_RESTART        0x000000003
  669.  
  670. typedef HRESULT (CERTBCLI_CALL FNCERTSRVSERVERCONTROLW)(
  671.     IN WCHAR const *pwszServerName,
  672.     IN DWORD dwControlFlags,
  673.     OPTIONAL OUT DWORD *pcbOut,
  674.     OPTIONAL OUT BYTE **ppbOut);
  675.  
  676. HRESULT
  677. CERTBCLI_API
  678. CertSrvServerControlW(
  679.     IN WCHAR const *pwszServerName,
  680.     IN DWORD dwControlFlags,
  681.     OPTIONAL OUT DWORD *pcbOut,
  682.     OPTIONAL OUT BYTE **ppbOut);
  683.  
  684. #ifdef _CERTBCLI_TYPECHECK
  685. FNCERTSRVSERVERCONTROLW *pfnCertSrvServerControl = CertSrvServerControl;
  686. #endif
  687.  
  688.  
  689. #ifdef __cplusplus
  690. }
  691. #endif
  692.  
  693. #endif // __CERTBCLI_H__
  694. #pragma option pop /*P_O_Pop*/
  695.