ICertPolicy::Initialize method (certpol.h)

The Initialize method is called by the server engine to allow the policy module to perform initialization tasks.

Syntax

HRESULT Initialize(
  [in] const BSTR strConfig
);

Parameters

[in] strConfig

Represents the name of the certification authority, as entered during Certificate Services setup. For information about the configuration string name, see ICertConfig2.

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

When you write custom policy modules, implement this method.

Examples

#include <windows.h>
#include <Certpol.h>

STDMETHODIMP CCertPolicy::Initialize(
    /* [in] */ BSTR const strConfig)
{
    // strConfig can be used by the Policy module.
    // Here, it is stored in a BSTR member variable.
    // m_strConfig is an application-defined variable.
    // Call SysFreeString to free m_strConfig when done.
    m_strConfig = SysAllocString( strConfig );
    // Check to determine whether there was enough memory.
    if (NULL == m_strConfig)
        return ( E_OUTOFMEMORY );  // Not enough memory

    return( S_OK );
}

Requirements

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

See also

ICertConfig

ICertPolicy

ICertPolicy2