ICEnroll4::enumContainers method

[This method is no longer available for use as of Windows Server 2008 and Windows Vista.]

The enumContainers method retrieves the names of containers for the cryptographic service provider (CSP) specified by the ProviderName property. This method was first defined in the ICEnroll interface.

Syntax


HRESULT enumContainers(
  [in]   LONG dwIndex,
  [out]  BSTR *pbstrContainerName
);

Parameters

dwIndex [in]

Specifies the ordinal position of the container whose name will be retrieved. Specify zero for the first container.

pbstrContainerName [out]

A pointer to a BSTR variable that receives the name of the container. When you have finished using the BSTR, free it by calling the SysFreeString function.

Return value

C++

The return value is an HRESULT. A value of S_OK indicates success. The value ERROR_NO_MORE_ITEMS is returned when there are no more items.

VB

The return value is a String variable that represents the name of the container. An exception is raised if an error is encountered or when there are no more items.

Remarks

If the ProviderName property value has not been set, the default value (usually Microsoft Base Cryptographic Provider) of ProviderName as set in the registry, is used.

This method is disabled when the Certificate Enrollment Control is executed as a scripted control.

Examples


BSTR       bstrCon = NULL;
DWORD      nCon = 0;
HRESULT    hr;

// pEnroll is previously instantiated ICEnroll interface pointer
while ( S_OK == pEnroll->enumContainers(nCon, &bstrCon) )
{
    printf("\t%d) %ws\n", nCon++, bstrCon );
    if ( bstrCon )
    {
        SysFreeString( bstrCon );
        bstrCon = NULL;
    }
}

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

End of client support

Windows XP

End of server support

Windows Server 2003

Header

Xenroll.h

Library

Uuid.lib

DLL

Xenroll.dll

IID

IID_ICEnroll4 is defined as c1f1188a-2eb5-4a80-841b-7e729a356d90

See also

ICEnroll4
ICEnroll3
ICEnroll2
ICEnroll
CEnroll
ProviderName

 

 

Community Additions

ADD
Show:
© 2014 Microsoft