ICertServerPolicy::SetContext method (certif.h)

The SetContext method specifies the request to be used as the context for subsequent calls to Certificate Services.

Syntax

HRESULT SetContext(
  [in] LONG Context
);

Parameters

[in] Context

Specifies the request. This parameter must be set to the identical value returned in the Context parameter of the
ICertPolicy::VerifyRequest method.

Return value

VB

If the method succeeds, the method returns S_OK.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Remarks

The policy module must call the SetContext method first, before calls to any other ICertServerPolicy method, so that the interface references a valid request.

Examples

// 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;
}

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header certif.h (include Certsrv.h)
Library Certidl.lib
DLL Certcli.dll

See also

ICertPolicy::VerifyRequest

ICertServerPolicy