【发布时间】:2015-06-18 16:21:42
【问题描述】:
我正在尝试编写自定义 Windows 凭据提供程序。我已经下载了V2 credential provider sample 并且可以构建、注册和使用它。
为了测试,我设置了一个 hyper-v Windows 8.1 实例并加入了一个 Windows 测试域。
但是,自定义凭据提供程序仅显示在用户磁贴上,而不显示在“其他用户”磁贴上。
文档 (Credential Provider Framework Changes in Windows 8.docx) 提供了一个小sn-p:
// Gets the SID of the user corresponding to the credential. HRESULT CSampleCredential::GetUserSid(__deref_out PWSTR *ppszSid)
{
*ppszSid = nullptr;
HRESULT hr = E_UNEXPECTED;
// _pszUserSid is a private member of CSampleCredential
if (_pszUserSid != nullptr)
{
// ppszSid will be freed by Logon UI
hr = SHStrDupW(_pszUserSid, ppszSid);
}
// Return S_FALSE with a null SID in ppszSid for the
// credential to be associated with an anonymous user tile.
else if (_fIsOtherUserTile)
{
hr = S_FALSE;
}
return hr;
}
我不确定“_fIsOtherUserTile”的来源。如果我忽略这个 并将“hr”设置为 S_FALSE 凭据提供程序仍未显示 “其他用户”磁贴。
我错过了什么?我需要更改哪些内容才能使用“其他用户”磁贴上的凭据提供程序?
我通常做网络项目,所以我对 Windows SDK 的经验很少。
【问题讨论】:
-
你能解决这个问题吗?我有完全相同的问题,此外,我的 CP 仅对本地管理员帐户可见。知道要进行哪些更改以使其对所有本地帐户和其他用户图块可见吗?谢谢
标签: c++ windows winapi credentials credential-providers