📄 certbcli.h
字号:
// Parameters:
// [in] hbc - backup context handle
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPCLOSE)(
IN HCSBC hbc);
HRESULT
CERTBCLI_API
CertSrvBackupClose(
IN HCSBC hbc);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVBACKUPCLOSE *pfnCertSrvBackupClose = CertSrvBackupClose;
#endif
//+--------------------------------------------------------------------------
// CertSrvBackupGetBackupLogs -- return the list of log files that need to be
// backed up for the given backup context
//
// Parameters:
// [in] hbc - backup context handle
// [out] pwszzBackupLogFiles - pointer that will receive the pointer to
// the list of log files; allocated memory should be freed using
// CertSrvBackupFree() API by the caller when it is no
// longer needed; Log files are returned in an array of
// null-terminated filenames and the list is terminated by two
// L'\0's
// [out] pcbSize - will receive the number of bytes returned
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPGETBACKUPLOGSW)(
IN HCSBC hbc,
OUT WCHAR **ppwszzBackupLogFiles,
OUT DWORD *pcbSize);
HRESULT
CERTBCLI_API
CertSrvBackupGetBackupLogsW(
IN HCSBC hbc,
OUT WCHAR **ppwszzBackupLogFiles,
OUT DWORD *pcbSize);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVBACKUPGETBACKUPLOGSW *pfnCertSrvBackupGetBackupLogs = CertSrvBackupGetBackupLogs;
#endif
//+--------------------------------------------------------------------------
// CertSrvBackupTruncateLogs -- called to truncate the already read backup logs.
//
// Parameters:
// [in] hbc - backup context handle
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPTRUNCATELOGS)(
IN HCSBC hbc);
HRESULT
CERTBCLI_API
CertSrvBackupTruncateLogs(
IN HCSBC hbc);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVBACKUPTRUNCATELOGS *pfnCertSrvBackupTruncateLogs = CertSrvBackupTruncateLogs;
#endif
//+--------------------------------------------------------------------------
// CertSrvBackupEnd -- called to end the current backup session.
//
// Parameters:
// [in] hbc - backup context handle of the backup session
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVBACKUPEND)(
IN HCSBC hbc);
HRESULT
CERTBCLI_API
CertSrvBackupEnd(
IN HCSBC hbc);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVBACKUPEND *pfnCertSrvBackupEnd = CertSrvBackupEnd;
#endif
//+--------------------------------------------------------------------------
// CertSrvBackupFree -- free any buffer allocated by certbcli.dll APIs.
//
// Parameters:
// [in] pv - pointer to the buffer that is to be freed.
//
// Returns:
// None.
//---------------------------------------------------------------------------
typedef VOID (CERTBCLI_CALL FNCERTSRVBACKUPFREE)(
IN VOID *pv);
VOID
CERTBCLI_API
CertSrvBackupFree(
IN VOID *pv);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVBACKUPFREE *pfnCertSrvBackupFree = CertSrvBackupFree;
#endif
//+--------------------------------------------------------------------------
// CertSrvRestoreGetDatabaseLocations -- called both at backup time as well as
// at restorate time to get data base locations for different types of
// files.
//
// Parameters:
// [in] hbc - backup context handle which would have been obtained
// through CertSrvBackupPrepare in the backup case and through
// CertSrvRestorePrepare in the restore case.
// [out] ppwszzDatabaseLocationList - pointer that will receive the
// pointer to the list of database locations; allocated memory
// should be freed using CertSrvBackupFree() API by the caller
// when it is no longer needed; locations are returned in an array
// of null-terminated names and and the list is terminated by
// two L'\0's. The first character of each name is the BFT
// character that indicates the type of the file and the rest of
// the name tells gives the path into which that particular type
// of file should be restored.
// [out] pcbSize - will receive the number of bytes returned
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREGETDATABASELOCATIONSW)(
IN HCSBC hbc,
OUT WCHAR **ppwszzDatabaseLocationList,
OUT DWORD *pcbSize);
HRESULT
CERTBCLI_API
CertSrvRestoreGetDatabaseLocationsW(
IN HCSBC hbc,
OUT WCHAR **ppwszzDatabaseLocationList,
OUT DWORD *pcbSize);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVRESTOREGETDATABASELOCATIONSW *pfnCertSrvRestoreGetDatabaseLocations = CertSrvRestoreGetDatabaseLocations;
#endif
//+--------------------------------------------------------------------------
// CertSrvRestorePrepare -- indicate beginning of a restore session.
//
// Parameters:
// [in] pwszServerName - name or config string of the server into which
// the restore operation is going to be performed.
// [in] dwRestoreFlags - Or'ed combination of CSRESTORE_TYPE_* flags;
// 0 if no special flags are to be specified
// [out] phbc - pointer to receive the backup context handle which is to
// be passed to the subsequent restore APIs
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREPREPAREW)(
IN WCHAR const *pwszServerName,
IN ULONG dwRestoreFlags,
OUT HCSBC *phbc);
HRESULT
CERTBCLI_API
CertSrvRestorePrepareW(
IN WCHAR const *pwszServerName,
IN ULONG dwRestoreFlags, // CSRESTORE_TYPE_*
OUT HCSBC *phbc);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVRESTOREPREPAREW *pfnCertSrvRestorePrepare = CertSrvRestorePrepare;
#endif
//+--------------------------------------------------------------------------
// CertSrvRestoreRegister -- register a restore operation. It will interlock
// all subsequent restore operations, and will prevent the restore target
// from starting until the call to CertSrvRestoreRegisterComplete is made.
//
// Parameters:
// [in] hbc - backup context handle for the restore session.
// [in] pwszCheckPointFilePath - path to restore the check point files
// [in] pwszLogPath - path where the log files are restored
// [in] rgrstmap - restore map
// [in] crstmap - tells if there is a new restore map
// [in] pwszBackupLogPath - path where the backup logs are located
// [in] genLow - Lowest log# that was restored in this restore session
// [in] genHigh - Highest log# that was restored in this restore session
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREREGISTERW)(
OPTIONAL IN HCSBC hbc,
OPTIONAL IN WCHAR const *pwszCheckPointFilePath,
OPTIONAL IN WCHAR const *pwszLogPath,
OPTIONAL IN CSEDB_RSTMAPW rgrstmap[],
IN LONG crstmap,
OPTIONAL IN WCHAR const *pwszBackupLogPath,
IN ULONG genLow,
IN ULONG genHigh);
HRESULT
CERTBCLI_API
CertSrvRestoreRegisterW(
OPTIONAL IN HCSBC hbc,
OPTIONAL IN WCHAR const *pwszCheckPointFilePath,
OPTIONAL IN WCHAR const *pwszLogPath,
OPTIONAL IN CSEDB_RSTMAPW rgrstmap[],
IN LONG crstmap,
OPTIONAL IN WCHAR const *pwszBackupLogPath,
IN ULONG genLow,
IN ULONG genHigh);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVRESTOREREGISTERW *pfnCertSrvRestoreRegister = CertSrvRestoreRegister;
#endif
//+--------------------------------------------------------------------------
// CertSrvRestoreRegisterComplete -- indicate that a previously registered
// restore is complete.
//
// Parameters:
// [in] hbc - backup context handle
// [in] hrRestoreState - success code if the restore was successful
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREREGISTERCOMPLETE)(
OPTIONAL IN HCSBC hbc,
IN HRESULT hrRestoreState);
HRESULT
CERTBCLI_API
CertSrvRestoreRegisterComplete(
OPTIONAL IN HCSBC hbc,
IN HRESULT hrRestoreState);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVRESTOREREGISTERCOMPLETE *pfnCertSrvRestoreRegisterComplete = CertSrvRestoreRegisterComplete;
#endif
//+--------------------------------------------------------------------------
// CertSrvRestoreEnd -- end a restore session
//
// Parameters:
// [in] hbc - backup context handle
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
typedef HRESULT (CERTBCLI_CALL FNCERTSRVRESTOREEND)(
IN HCSBC hbc);
HRESULT
CERTBCLI_API
CertSrvRestoreEnd(
IN HCSBC hbc);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVRESTOREEND *pfnCertSrvRestoreEnd = CertSrvRestoreEnd;
#endif
//+--------------------------------------------------------------------------
// CertSrvServerControl -- send a control command to the cert server.
//
// Parameters:
// [in] pwszServerName - name or config string of the server to control
// [in] dwControlFlags - control command and flags
// [out] pcbOut - pointer to receive the size of command output data
// [out] ppbOut - pointer to receive command output data. Use the
// CertSrvBackupFree() API to free the buffer.
//
// Returns:
// S_OK if the call executed successfully;
// Failure code otherwise.
//---------------------------------------------------------------------------
#define CSCONTROL_SHUTDOWN 0x000000001
#define CSCONTROL_SUSPEND 0x000000002
#define CSCONTROL_RESTART 0x000000003
typedef HRESULT (CERTBCLI_CALL FNCERTSRVSERVERCONTROLW)(
IN WCHAR const *pwszServerName,
IN DWORD dwControlFlags,
OPTIONAL OUT DWORD *pcbOut,
OPTIONAL OUT BYTE **ppbOut);
HRESULT
CERTBCLI_API
CertSrvServerControlW(
IN WCHAR const *pwszServerName,
IN DWORD dwControlFlags,
OPTIONAL OUT DWORD *pcbOut,
OPTIONAL OUT BYTE **ppbOut);
#ifdef _CERTBCLI_TYPECHECK
FNCERTSRVSERVERCONTROLW *pfnCertSrvServerControl = CertSrvServerControl;
#endif
#ifdef __cplusplus
}
#endif
#endif // __CERTBCLI_H__
#pragma option pop /*P_O_Pop*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -