Fonction CertSrvBackupClose (certbcli.h)

La fonction CertSrvBackupClose ferme le fichier ouvert par la fonction CertSrvBackupOpenFile .

Syntaxe

HRESULT CERTBCLI_API CertSrvBackupClose(
  [in] HCSBC hbc
);

Paramètres

[in] hbc

Handle dans un contexte de sauvegarde des services de certificats.

Valeur retournée

La valeur de retour est HRESULT. Une valeur de S_OK indique la réussite.

Remarques

Pour chaque appel réussi à CertSrvBackupOpenFile, il doit y avoir un appel suivant à CertSrvBackupClose. À la fin de la sauvegarde d’un fichier, le fichier doit être fermé.

Exemples

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.
}

Configuration requise

Condition requise Valeur
Client minimal pris en charge Aucun pris en charge
Serveur minimal pris en charge Windows Server 2003 [applications de bureau uniquement]
Plateforme cible Windows
En-tête certbcli.h (include Certsrv.h)
Bibliothèque Certadm.lib
DLL Certadm.dll

Voir aussi

CertSrvBackupOpenFile

CertSrvBackupRead

Utilisation des fonctions de sauvegarde et de restauration des services de certificat