[This is preliminary documentation and subject to change.]
The GetFlags method retrieves the policy and origin flags of the extension. Both the policy and origin flags are stored in one variable, and bitmasks are provided to retrieve the individual values.
[VB] Long GetFlags();
[JAVA] int GetFlags();
[C++] HRESULT GetFlags(
LONG *pFlags // out
);
[VB][JAVA] The return value represents the policy and origin values of the extension.
[C++] The return value is an HRESULT. A value of S_OK indicates success.
This function is used to determine both the policy and origin flags of the extension currently referenced by the IEnumCERTVIEWEXTENSION object.
The bitmasks in the following table can be used to determine the individual values for the policy and origin flags.
Bitmask | Usage |
---|---|
EXTENSION_POLICY_MASK | Determines policy value |
EXTENSION_ORIGIN_MASK | Determines origin value |
If the IEnumCERTVIEWEXTENSION object is not referencing a valid extension, GetFlags will fail. Use the IEnumCERTVIEWEXTENSION Next method to reference a valid extension.
HRESULT hr;
LONG ExtFlags;
// pEnumExt is previously instantiated IEnumCERTVIEWEXTENSION object
hr = pEnumExt->GetFlags(&ExtFlags);
if ( S_OK != hr )
printf("Failed GetFlags call!\n");
else
{
switch ( ExtFlags & EXTENSION_POLICY_MASK )
{
case EXTENSION_CRITICAL_FLAG:
printf("Extension critical\n");
break;
case EXTENSION_DISABLE_FLAG:
printf("Extension disabled\n");
break;
case 0:
printf("No extension policy set\n");
break;
default:
printf("Unknown extension policy flag\n");
break;
}
switch ( ExtFlags & EXTENSION_ORIGIN_MASK )
{
case EXTENSION_ORIGIN_REQUEST:
printf("Extension originated by Request\n");
break;
case EXTENSION_ORIGIN_POLICY:
printf("Extension originated by Policy\n");
break;
case EXTENSION_ORIGIN_ADMIN:
printf("Extension originated by Admin\n");
break;
case EXTENSION_ORIGIN_SERVER:
printf("Extension originated by Server\n");
break;
default:
printf("Unknown extension origin\n");
break;
}
}
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in certview.h.
Import Library: Use certidl.lib.
IEnumCERTVIEWEXTENSION::GetName, IEnumCERTVIEWEXTENSION::GetValue