Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

CertSrvBackupClose function

The CertSrvBackupClose function closes the file opened by the CertSrvBackupOpenFile function.

Syntax


HRESULT CertSrvBackupClose(
  _In_ HCSBC hbc
);

Parameters

hbc [in]

A handle to a Certificate Services backup context.

Return value

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

Remarks

For every successful call to CertSrvBackupOpenFile, there should be a subsequent call to CertSrvBackupClose. Upon completion of backing up a file, the file needs to be closed.

Examples


FNCERTSRVBACKUPCLOSE* pfnClose;
char * szBackupCloseFunc = "CertSrvBackupClose";
HRESULT    hr=0;

// Get the address for the desired function.    
// hInst was set by calling LoadLibrary for Certadm.dll.
pfnClose = (FNCERTSRVBACKUPCLOSE*)GetProcAddress(hInst,
                                   szBackupCloseFunc);
if ( NULL == pfnClose )
{
    printf("Failed GetProcAddress - %s, error=%d\n",
            szBackupCloseFunc,
            GetLastError() );
    exit(1);  // Or other appropriate error action.
}
// Close the file.
// hCSBC represents an HCSBC used in
// an earlier call to CertSrvBackupOpenFile.
hr = pfnClose(hCSBC);
if (FAILED(hr))
{
    printf("Failed pfnClose 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

CertSrvBackupOpenFile
CertSrvBackupRead
Using the Certificate Services Backup and Restore Functions

 

 

Community Additions

ADD
Show:
© 2015 Microsoft