Export (0) Print
Expand All

ICertPolicy2::Initialize method

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

strConfig [in]

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

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Certpol.h (include Certsrv.h)

Library

Certidl.lib

IID

IID_ICertPolicy2 is defined as 3db4910e-8001-4bf1-aa1b-f43a808317a0

See also

ICertPolicy
ICertConfig
ICertPolicy2

 

 

Community Additions

ADD
Show:
© 2014 Microsoft