ICertServerPolicy::EnumerateAttributesSetup 方法 (certif.h)

EnumerateAttributesSetup 方法會將與目前內容相關聯的第一個要求屬性的內部列舉指標初始化。

語法

HRESULT EnumerateAttributesSetup(
  [in] LONG Flags
);

參數

[in] Flags

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

傳回值

VB

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

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

備註

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

若要擷取屬性,請呼叫 EnumerateAttributes 方法。 EnumerateAttributes 的呼叫會擷取第一個屬性,並在有索引時將索引移至下一個屬性。

範例

// 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->EnumerateAttributesSetup(0);
if (FAILED(hr))
{
    printf("Failed EnumerateAttributesSetup [%x]\n", hr);
    goto error;
}

規格需求

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

另請參閱

ICertServerPolicy

ICertServerPolicy::EnumerateAttributes

ICertServerPolicy::EnumerateAttributesClose

ICertServerPolicy::SetContext