IEnumCERTVIEWEXTENSION::GetName method (certview.h)

The GetName method retrieves the name of the current extension in the extension-enumeration sequence.

The returned extension name is an object identifier (OID) string, as in L"2.5.29.31".

Syntax

HRESULT GetName(
  [out] BSTR *pstrOut
);

Parameters

[out] pstrOut

A pointer to a value of BSTR type that contains the name of the extension.

Return value

C++

If the method succeeds, the method returns S_OK and tat the pstrOut parameter is set to the name of the extension.

To use this method, create a variable of BSTR type, set the variable equal to NULL, and pass the address of this variable as pstrOut. When you have finished using the BSTR, free it by calling the SysFreeString function.

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

The return value is a String that contains the name of the extension.

Remarks

This function is used to retrieve the name of the extension currently referenced by the extension-enumeration sequence.

If the extension-enumeration sequence is not referencing a valid extension, GetName will fail. Use one of the following methods to navigate through the enumeration:

Examples

BSTR  bstrExtName = NULL;

// pEnumExt is previously instantiated IEnumCERTVIEWEXTENSION object
hr = pEnumExt->GetName(&bstrExtName);
if (S_OK == hr)
    printf("Extension name is: %ws\n", bstrExtName);
else
    printf("GetName failed: %x\n", hr);

// free memory when done
if (NULL != bstrExtName)
    SysFreeString(bstrExtName);

Requirements

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

See also

IEnumCERTVIEWEXTENSION

IEnumCERTVIEWEXTENSION::GetFlags

IEnumCERTVIEWEXTENSION::GetValue

IEnumCERTVIEWEXTENSION::Next

IEnumCERTVIEWEXTENSION::Reset

IEnumCERTVIEWEXTENSION::Skip