ICertPolicy::GetDescription method (certpol.h)

The GetDescription method returns a human-readable description of the policy module and its function.

Syntax

HRESULT GetDescription(
  [out] BSTR *pstrDescription
);

Parameters

[out] pstrDescription

A pointer to a BSTR that describes the policy module.

Return value

C++

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.

VB

Returns a string that describes the policy module and its function.

Remarks

When you write custom policy modules, implement this method.

Examples

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

STDMETHODIMP CCertPolicy::GetDescription(
    /* [out, retval] */ BSTR __RPC_FAR *pstrDescription)
{
    if (NULL == pstrDescription)
    {
        // Bad pointer address
        return ( E_POINTER );
    }
    if (NULL != *pstrDescription)
    {
        SysFreeString(*pstrDescription);
        *pstrDescription=NULL;
    }
    // wszMyModuleDesc defined elsewhere, for example:
    // #define wszMyModuleDesc L"My Policy Module"
    *pstrDescription = SysAllocString(wszMyModuleDesc);
    if (NULL == *pstrDescription)
    {
        // Not enough memory
        return ( E_OUTOFMEMORY );
    }
    // Success
    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

ICertPolicy

ICertPolicy2