ICertServerPolicy::EnumerateAttributesSetup method (certif.h)

The EnumerateAttributesSetup method initializes the internal enumeration pointer to the first request attribute associated with the current context.

Syntax

HRESULT EnumerateAttributesSetup(
  [in] LONG Flags
);

Parameters

[in] Flags

This parameter is reserved and must be set to zero.

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

The SetContext method must be called prior to calling this method. The call to SetContext specifies which request to use as the current context.

To retrieve the attribute, call the EnumerateAttributes method. The call to EnumerateAttributes retrieves the first attribute and moves the index to the next attribute if one exists.

Examples

// Set the context. The value nContext (long) would be the same
// as the context parameter in ICertPolicy::VerifyRequest.
// hr is defined as an HRESULT.
// pCertServerPolicy has been used to call SetContext previously.
hr = pCertServerPolicy->SetContext(nContext);
if (FAILED(hr))
{
    printf("Failed SetContext [%x]\n", hr);
    goto error;
}

// Setup the enumeration.
hr = pCertServerPolicy->EnumerateAttributesSetup(0);
if (FAILED(hr))
{
    printf("Failed EnumerateAttributesSetup [%x]\n", hr);
    goto error;
}

Requirements

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

See also

ICertServerPolicy

ICertServerPolicy::EnumerateAttributes

ICertServerPolicy::EnumerateAttributesClose

ICertServerPolicy::SetContext