CertSrvRestoreRegisterComplete function (certbcli.h)

The CertSrvRestoreRegisterComplete function completes a registered Certificate Services restore operation.

Syntax

HRESULT CERTBCLI_API CertSrvRestoreRegisterComplete(
  [in] HCSBC   hbc,
  [in] HRESULT hrRestoreState
);

Parameters

[in] hbc

A handle to a Certificate Services restore context. You must set this handle by calling CertSrvRestoreRegister before using it in CertSrvRestoreRegisterComplete.

[in] hrRestoreState

HRESULT value indicating the success code for the restore operation. Set this value to S_OK if the restore operation was successful.

Return value

The return value is an HRESULT. A value of S_OK indicates success.

Remarks

If a registered restore operation is not completed, Certificate Services will not start.

Examples

FNCERTSRVRESTOREREGISTERCOMPLETE* pfnRestRegComplete;
char * szResRegCompleteFunc = "CertSrvRestoreRegisterComplete";
HRESULT    hr=0;

// Get the address for the desired function.
// hInst was set by calling LoadLibrary for Certadm.dll.
pfnRestRegComplete = (FNCERTSRVRESTOREREGISTERCOMPLETE*)
                     GetProcAddress( hInst, szResRegCompleteFunc );
if ( NULL == pfnRestRegComplete )
{
    printf("Failed GetProcAddress - %s, error=%d\n",
           szResRegCompleteFunc,
           GetLastError() );
    exit(1); // Or other appropriate error action.
}

// Complete a registered restoration operation.
// hCSBC is an HCSBC variable used in a previous
// call to CertSrvRestoreRegister.
hr = pfnRestRegComplete(hCSBC, S_OK);
if (FAILED(hr))
{
    printf("Failed pfnRestRegComplete call [%x]\n", hr);
    exit(1); // Or other appropriate error action.
}

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows ServerĀ 2003 [desktop apps only]
Target Platform Windows
Header certbcli.h (include Certsrv.h)
Library Certadm.lib
DLL Certadm.dll

See also

CertSrvRestoreRegister

Using the Certificate Services Backup and Restore Functions