ICertServerPolicy::EnumerateExtensionsSetup 方法 (certif.h)

EnumerateExtensionsSetup 方法會初始化與目前內容相關聯之第一個憑證延伸模組的內部列舉指標。

語法

HRESULT EnumerateExtensionsSetup(
  [in] LONG Flags
);

參數

[in] Flags

此參數是保留的,而且必須設定為零。

傳回值

VB

如果方法成功,方法會傳回S_OK。

如果方法失敗,它會傳回指出錯誤的 HRESULT 值。 如需常見錯誤碼的清單,請參閱 一般 HRESULT 值

備註

呼叫這個方法之前,必須先呼叫 SetContext 方法。 對 SetContext 的呼叫會指定哪個要求是目前的內容。

若要擷取擴充功能,請呼叫 EnumerateExtensions 方法。 EnumerateExtensions 的呼叫會擷取第一個延伸模組,並在存在時將索引移至下一個延伸模組。

範例

// Set the context. The value nContext (long) would be the same
// as the context parameter in ICertPolicy::VerifyRequest.
// hr is defined as an HRESULT.
// pCertServerPolicy has been used to call SetContext previously.
hr = pCertServerPolicy->SetContext( nContext );
if (FAILED(hr))
{
    printf("Failed SetContext [%x]\n", hr);
    goto error;
}
// Setup the enumeration.
hr = pCertServerPolicy->EnumerateExtensionsSetup( 0 );
if (FAILED(hr))
{
    printf("Failed EnumerateExtensionsSetup [%x]\n", hr);
    goto error;
}

規格需求

需求
最低支援的用戶端 都不支援
最低支援的伺服器 Windows Server 2003 [僅限桌面應用程式]
目標平台 Windows
標頭 certif.h (包含 Certsrv.h)
程式庫 Certidl.lib
Dll Certcli.dll

另請參閱

EnumerateExtensions

ICertServerPolicy

SetContext