CertSrvBackupGetDynamicFileListW 関数 (certbcli.h)

CertSrvBackupGetDynamicFileList 関数は、特定のバックアップ コンテキストに対してバックアップする必要がある証明書サービスの動的ファイル名の一覧を取得します。 動的ファイルは、Certificate Services データベースのバックアップに含まれていないファイルです。

構文

HRESULT CERTBCLI_API CertSrvBackupGetDynamicFileListW(
  [in]  HCSBC hbc,
  [out] PWSTR *ppwszzFileList,
  [out] DWORD *pcbSize
);

パラメーター

[in] hbc

Certificate Services バックアップ コンテキストへのハンドル。

[out] ppwszzFileList

証明書サービスによって使用される null で終わる動的ファイル名の一覧を受け取る WCHAR ポインターへのポインター。 すべてのファイル名の後に null 文字があり、リストの末尾に余分な null 文字があります。 ファイル名は UNC 形式の "\\Server\SharePoint\... になります。Path...\FileName.ext" この割り当てられたメモリの使用が完了したら、 CertSrvBackupFree 関数を呼び出して解放します。

この関数を呼び出す前に、*ppwszzFileListNULL に設定することは省略可能です。

[out] pcbSize

ppwszzFileList 内のバイト数を指定する DWORD 値へのポインター。

戻り値

戻り値は HRESULT です。 値 S_OK は成功を示します。

注釈

この関数を使用して、Certificate Services の動的ファイル名の一覧を取得します。 これらのファイルは、Certificate Services データベースおよびログ ファイルとは別であり、Certificate Services バックアップ API によってバックアップされません。 その結果、動的ファイルをバックアップするために他の手段を使用する必要があります。 Certificate Services 動的ファイルの例として、 証明書失効リスト (CRL) があります。

Certadm.dll 内のこの関数の名前は CertSrvBackupGetDynamicFileListW です。 GetProcAddress を呼び出すときは、この形式の名前を使用する必要があります。 また、この関数は Certbcli.h ヘッダー ファイルで FNCERTSRVBACKUPGETDYNAMICFILELISTW 型として定義されます。

FNCERTSRVBACKUPGETDYNAMICFILELISTW* pfnGetDynFiles;
char * szGetDynFilesFunc = "CertSrvBackupGetDynamicFileListW";
WCHAR *    pwszzDynFiles;
DWORD      nListBytes=0;
HRESULT    hr=0;

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

// Determine the names of the dynamic files.
// hCSBC was set by an earlier call to CertSrvBackupPrepare.
hr = pfnGetDynFiles(hCSBC, &pwszzDynFiles, &nListBytes);
if (FAILED(hr))
{
    printf("Failed pfnGetDynFiles call [%x]\n", hr);
    exit(1); // Or other appropriate error action.
}
else
{
    printf("%d bytes for dynamic file names\n", nListBytes);
    WCHAR * pwszFile = pwszzDynFiles;
    // Process the list.
    while ( L'\0' != *pwszFile )
    {
        // Use the file name referenced by pwszFile.
        // Here it is merely displayed.
        printf("%ws\n", pwszFile);
        // Move to the next dynamic file name.
        // + 1 moves past the null terminator.
        pwszFile+=(wcslen(pwszFile)) + 1; 
    }
    // Free the allocated memory.
    // pfnBackupFree is the address of the 
    // CertSrvBackupFree function.
    pfnBackupFree(pwszzDynFiles);
}

要件

要件
サポートされている最小のクライアント サポートなし
サポートされている最小のサーバー Windows Server 2003 (デスクトップ アプリのみ)
対象プラットフォーム Windows
ヘッダー certbcli.h (Certsrv.h を含む)
Library Certadm.lib
[DLL] Certadm.dll

こちらもご覧ください

CertSrvBackupFree

証明書サービスのバックアップと復元の機能の使用