IEnumCERTVIEWEXTENSION::GetValue method (certview.h)
The GetValue method retrieves the value of the current extension in the extension-enumeration sequence.
Syntax
HRESULT GetValue(
[in] LONG Type,
[in] LONG Flags,
[out] VARIANT *pvarValue
);
Parameters
[in] Type
Data type for the returned data. This parameter can be used to specify that the extension data be decoded before being returned. If PROPTYPE_BINARY is specified, the data is not decoded but instead returned in its raw format.
Specify one of the following values.
[in] Flags
Flag that denotes the output format for the returned data. This parameter can be one of the following values.
[out] pvarValue
A pointer to a value of VARIANT type that contains the data for the currently referenced extension. This method fails if the pvarValue parameter is NULL. Upon successful completion of this function, pvarValue contains the extension data currently referenced by the extension-enumeration sequence. The caller is responsible for calling VariantClear when done with the data in pvarValue.
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
The return value is a Variant that represents the data in the extension.Remarks
This method is used to retrieve the data in the extension currently being referenced by the extension-enumeration sequence.
If the extension-enumeration sequence is not referencing a valid extension, GetValue fails. Use one of the following methods to navigate through the enumeration:
- IEnumCERTVIEWEXTENSION::Reset: Moves to the next extension in the enumeration sequence.
- IEnumCERTVIEWEXTENSION::Next: Moves to the next extension in the enumeration sequence.
- IEnumCERTVIEWEXTENSION::Skip: Skips a specified number of extensions.
Examples
VARIANT var;
LONG Index;
HRESULT hr;
SYSTEMTIME systime;
VariantInit(&var);
// Enumerate each extension
// pEnumExt is previously instantiated IEnumCERTVIEWEXTENSION object
while (S_OK == pEnumExt->Next(&Index))
{
hr = pEnumExt->GetValue(PROPTYPE_BINARY, CV_OUT_HEX, &var);
if (FAILED(hr))
{
printf("Failed GetValue - %x\n", hr);
break;
}
switch(var.vt)
{
case VT_EMPTY:
printf("VT_EMPTY\n");
break;
case VT_BSTR:
printf("BSTR:%ws\n", var.bstrVal);
break;
case VT_DATE:
VariantTimeToSystemTime(var.date, &systime);
printf("%d.%d.%d %02d:%02d:%02d\n",
systime.wMonth,
systime.wDay,
systime.wYear,
systime.wHour,
systime.wMinute,
systime.wSecond );
break;
case VT_I2:
printf("%d\n", var.iVal);
break;
case VT_I4:
printf("%d\n", var.lVal);
break;
default:
printf("type is:%i\n", var.vt);
break;
}
}
// Free resources.
VariantClear( &var );
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