[This is preliminary documentation and subject to change.]
The GetValue method retrieves the extension value.
[VB] Variant GetValue(
Long Type,
Long Flags
);
[JAVA] com.ms.Variant GetValue(
int Type,
int Flags
);
[C++] HRESULT GetValue(
LONG Type, // in
LONG Flags, // in
VARIANT *pvarValue // out
);
Data type | Meaning |
---|---|
PROPTYPE_BINARY | Binary data |
PROPTYPE_DATE | Date+Time |
PROPTYPE_LONG | Signed long |
PROPTYPE_STRING | Unicode String |
Flag | Meaning |
---|---|
CV_OUT_BASE64HEADER | BASE64 with begin/end |
CV_OUT_BASE64 | BASE64 without begin/end |
CV_OUT_BINARY | binary |
CV_OUT_BASE64REQUESTHEADER | BASE64 with begin/end |
CV_OUT_HEX | hex string |
CV_OUT_HEXASCII | hex string with Ascii+address |
[VB][JAVA] The return value is a Variant representing the data in the extension.
[C++] The return value is an HRESULT. A value of S_OK indicates success.
This function is used to retrieve the data in the extension currently being referenced by the IEnumCERTVIEWEXTENSION object.
If the IEnumCERTVIEWEXTENSION object is not referencing a valid extension, GetValue will fail. Use the IEnumCERTVIEWEXTENSION Next method to reference a valid extension.
VARIANT var;
LONG Index;
HRESULT hr;
SYSTEMTIME systime;
VariantInit( &var );
// Enumerate each extension
// pEnumExt is previously instantiated IEnumCERTVIEWEXTENSION object
while ( S_FALSE != pEnumExt->Next( &Index ) )
{
hr = pEnumExt->GetValue( 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:%S\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 );
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in certview.h.
Import Library: Use certidl.lib.
IEnumCERTVIEWEXTENSION::GetFlags, IEnumCERTVIEWEXTENSION::GetName