ICertAdmin2::GetCAPropertyDisplayName method

The GetCAPropertyDisplayName method retrieves the property display name for a certification authority (CA) property. This method was first defined in the ICertAdmin interface.

Syntax


HRESULT GetCAPropertyDisplayName(
  [in]  const BSTR strConfig,
  [in]        LONG PropId,
  [out]       BSTR *pstrDisplayName
);

Parameters

strConfig [in]

Represents a valid configuration string for the CA in the form COMPUTERNAME\CANAME, where COMPUTERNAME is the Certificate Services server's network name, and CANAME is the common name of the CA, as entered during Certificate Services setup. For information about the configuration string name, see ICertConfig.

Important  GetCAPropertyDisplayName does not clear the internal cache when the configuration string is changed. When you change the configuration string for the CA, you must instantiate a new ICertAdmin object and call this method again with the new configuration string.
 
PropId [in]

Specifies the property identifier. For information about this parameter, see the table in ICertAdmin2::GetCAProperty.

pstrDisplayName [out]

A pointer to the string representing the property's display name.

It is the responsibility of the caller to free the BSTR when done by calling SysFreeString.

Return value

C++

The return value is an HRESULT. A value of S_OK indicates the method was successful.

VB

A string that represents the property's display name.

Examples

The following example assumes the ICertAdmin2 interface pointer is valid.


BSTR bstrCA = NULL;
BSTR bstrDispName = NULL;
HRESULT  hr;

bstrCA = SysAllocString(L"<COMPUTERNAMEHERE>\\<CANAMEHERE>");
if (NULL == bstrCA)
{
    printf("Failed to allocate memory for bstrCA\n");
    exit(1);
}

// Retrieve a property's display name.
hr = pCertAdmin2->GetCAPropertyDisplayName(bstrCA,
                                           CR_PROP_EXITCOUNT,
                                           &bstrDispName);
if (FAILED(hr))
{
    printf("Failed GetCAPropertyDisplayName\n");
    SysFreeString(bstrCA);
    exit(1);  // Or other error action.
}
// Display the property's name.
printf("Property display name is %ws\n", 
       bstrDispName);

// Free string.
SysFreeString(bstrDispName);
SysFreeString(bstrCA);

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Certadm.h (include Certsrv.h)

Library

Certidl.lib

DLL

Certadm.dll

IID

IID_ICertAdmin2 is defined as f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39

 

 

Show: