ICertPolicy2::GetDescription method

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

Syntax


HRESULT GetDescription(
  [out] BSTR *pstrDescription
);

Parameters

pstrDescription [out]

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

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
ICertPolicy2

 

 

Show: