Expand Minimize

CertSrvRestoreRegisterComplete function

The CertSrvRestoreRegisterComplete function completes a registered Certificate Services restore operation.

Syntax


HRESULT CertSrvRestoreRegisterComplete(
  _In_  HCSBC hbc,
  _In_  HRESULT hrRestoreState
);

Parameters

hbc [in]

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

hrRestoreState [in]

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

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Certbcli.h (include Certsrv.h)

Library

Certadm.lib

DLL

Certadm.dll

See also

CertSrvRestoreRegister
Using the Certificate Services Backup and Restore Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft