i built a V2 credential provider sample and registe it to windows10, the provider can be load and displayed in unlock screen after i click "Sign-in options", but the provider can not be displayed in power-on/switch-user logon screen. i put some log in the code like this
HRESULT CSampleProvider::_EnumerateCredentials()
{
DebugTrace(__FILEW__, __LINE__, _T("enter _EnumerateCredentials"));
HRESULT hr = E_UNEXPECTED;
if (_pCredProviderUserArray != nullptr)
{
DWORD dwUserCount;
_pCredProviderUserArray->GetCount(&dwUserCount);
**DebugTrace(__FILEW__, __LINE__, _T(" dwUserCount = %d"), dwUserCount);**
if (dwUserCount > 0)
{
ICredentialProviderUser *pCredUser;
hr = _pCredProviderUserArray->GetAt(0, &pCredUser);
if (SUCCEEDED(hr))
{
_pCredential = new(std::nothrow) CSampleCredential();
if (_pCredential != nullptr)
{
hr = _pCredential->Initialize(_cpus, s_rgCredProvFieldDescriptors, s_rgFieldStatePairs, pCredUser);
if (FAILED(hr))
{
_pCredential->Release();
_pCredential = nullptr;
}
}
else
{
hr = E_OUTOFMEMORY;
}
pCredUser->Release();
}
}
}
return hr;
}
turns out dwUserCount is 0 in power-on/switch-user logon screen, so that the provider will not initialize any credential.
My question is, how to make the provider initialize its credentials without ICredentialProviderUser
object?
thanks in advance.