ICertExit::Initialize method (certexit.h)
The Initialize method is called by the server engine when it initializes itself.
The call to the exit module's Initialize method allows the exit module to perform initialization and inform the server engine which kinds of events it would like to be notified of.
Syntax
HRESULT Initialize(
[in] const BSTR strConfig,
[out, retval] LONG *pEventMask
);
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.
[out, retval] pEventMask
A pointer to the value that represents the events for which the exit module requests notification. This can be one or more of the following values.
Value | Meaning |
---|---|
|
Certificate denied. |
|
Certificate issued. |
|
Certificate pending. |
|
Successful call to RetrievePending. |
|
Certificate revoked. |
|
Certificate revocation list issued. |
|
Certificate Services shutdown. |
Return value
C++
If the method succeeds, the method returns S_OK and *pEventMask is set to a combination of the flags in the table below (or EXITEVENT_INVALID if the exit module does not want to be notified of any events).If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.
If the exit module does not want to be notified of any events, then the flag EXITEVENT_INVALID should be set.
VB
The return value is a mask that contains flags that indicate the events for which the exit module requests notification. After the call, all events of those types will be signaled by the server engine to the exit module through a call to Notify. Any or all of the following flags may be set.Return code/value | Description |
---|---|
|
Certificate denied. |
|
Certificate issued. |
|
Certificate pending. |
|
Successful call to RetrievePending. |
|
Certificate revoked. |
|
Certificate revocation list issued. |
|
The event is currently not valid. |
|
Certificate Services shutdown. |
Remarks
When you write a custom exit module, implement this method.
Examples
#include <windows.h>
#include <stdio.h>
#include <Certexit.h>
STDMETHODIMP CCertExit::Initialize(
/* [in] */ BSTR const strConfig,
/* [retval][out] */ LONG __RPC_FAR *pEventMask)
{
// Verify valid pointer passed in.
if (NULL == pEventMask)
return ( E_POINTER ); // Bad pointer
// strConfig can be used by the Exit module.
// Here, it is stored in a BSTR member variable.
// Remember to 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
// Inform server engine (CA) that we're interested in
// the following events.
*pEventMask = EXITEVENT_CERTISSUED |
EXITEVENT_CERTPENDING |
EXITEVENT_CERTDENIED |
EXITEVENT_CERTREVOKED |
EXITEVENT_CERTRETRIEVEPENDING |
EXITEVENT_CRLISSUED |
EXITEVENT_SHUTDOWN;
if ( fDebug )
{
printf("Exit's Initialize member called\n");
printf("\tstrConfig = %ws\n", strConfig );
}
return( S_OK );
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | certexit.h (include Certsrv.h) |