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.

696 lines
23 KiB

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