ICertServerPolicy::SetContext 方法 (certif.h)

SetContext 方法會指定要做為後續憑證服務呼叫內容的要求。

語法

HRESULT SetContext(
  [in] LONG Context
);

參數

[in] Context

指定要求。 此參數必須設定為 在 Context 參數中傳回的相同值
ICertPolicy::VerifyRequest 方法。

傳回值

VB

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

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

備註

原則模組必須先呼叫 SetContext 方法,再呼叫任何其他 ICertServerPolicy 方法,讓介面參考有效的要求。

範例

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

規格需求

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

另請參閱

ICertPolicy::VerifyRequest

ICertServerPolicy