EnumerateAttributesSetup 方法初始化与当前 上下文关联的第一个请求 属性的内部枚举指针。
语法
HRESULT EnumerateAttributesSetup(
[in] LONG Flags
);
参数
[in] Flags
此参数是保留的,必须设置为零。
返回值
VB
如果方法成功,该方法将返回S_OK。如果方法失败,它将返回指示错误的 HRESULT 值。 有关常见错误代码的列表,请参阅 常见 HRESULT 值。
言论
在调用此方法之前,必须调用 SetContext 方法。 SetContext 调用指定要用作当前上下文的请求。
若要检索属性,请调用 EnumerateAttributes 方法。 对 EnumerateAttributes 的调用 检索第一个属性,并将索引移动到下一个属性(如果存在)。
例子
// Set the context. The value nContext (long) would be the same
// as the context parameter in ICertPolicy::VerifyRequest.
// hr is defined as an HRESULT.
// pCertServerPolicy has been used to call SetContext previously.
hr = pCertServerPolicy->SetContext(nContext);
if (FAILED(hr))
{
printf("Failed SetContext [%x]\n", hr);
goto error;
}
// Setup the enumeration.
hr = pCertServerPolicy->EnumerateAttributesSetup(0);
if (FAILED(hr))
{
printf("Failed EnumerateAttributesSetup [%x]\n", hr);
goto error;
}
要求
要求 | 价值 |
---|---|
最低支持的客户端 | 不支持 |
支持的最低服务器 | Windows Server 2003 [仅限桌面应用] |
目标平台 | 窗户 |
标头 | certif.h (include Certsrv.h) |
库 | Certidl.lib |
DLL | Certcli.dll |
另请参阅
ICertServerPolicy::EnumerateAttributes