Home > OS >  Why I do the Credential Provider cannot unlock correctly?
Why I do the Credential Provider cannot unlock correctly?

Time:10-28

As title, I made a Credential Provider DLL, used the password login system at alternative mechanisms,
Mainly added a pin input box, used to enter the security key password,

On the Windows 7 system, the CP DLL configuration should be correct, put a 64 - bit DLL in system32, and register,

Main show is:
System login screen display normal, enter the password, no errors
Enter login password, click the login button, don't jump, login failed, check the GetSerialization interface,
Nothing wrong, but just can't remove lock, don't know what's wrong?

Don't know if you have met such a situation?

CodePudding user response:

HRESULT CSampleCredential: : GetSerialization (
CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE * PCPGSR,
CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION * PCPCS,
PWSTR * ppwszOptionalStatusText,
CREDENTIAL_PROVIDER_STATUS_ICON * pcpsiOptionalStatusIcon
)
{
UNREFERENCED_PARAMETER (ppwszOptionalStatusText);
UNREFERENCED_PARAMETER (pcpsiOptionalStatusIcon);

WCHAR WSZ [MAX_COMPUTERNAME_LENGTH + 1];
DWORD CCH=ARRAYSIZE (WSZ);
If (GetComputerNameW (WSZ, & amp; The CCH))
{

PWSTR pwzProtectedPassword;
Hr=ProtectIfNecessaryAndCopyPassword (_rgFieldStrings [SFI_PASSWORD], _cpus, & amp; PwzProtectedPassword);
If (SUCCEEDED (hr))
{
KERB_INTERACTIVE_UNLOCK_LOGON kiul;
Hr=KerbInteractiveUnlockLogonInit (WSZ, _rgFieldStrings [SFI_EDIT_TEXT], pwzProtectedPassword, _cpus, & amp; Kiul);
If (SUCCEEDED (hr))
{

Hr=KerbInteractiveUnlockLogonPack (kiul, & amp; PCPCS - & gt; RgbSerialization, & amp; PCPCS - & gt; CbSerialization);
If (SUCCEEDED (hr))
{
ULONG ulAuthPackage;
Hr=RetrieveNegotiateAuthPackage (& amp; UlAuthPackage);
If (SUCCEEDED (hr))
{
PCPCS - & gt; UlAuthenticationPackage=ulAuthPackage;
PCPCS - & gt; ClsidCredentialProvider=CLSID_CSampleProvider;
* PCPGSR=CPGSR_RETURN_CREDENTIAL_FINISHED;
}
}
}
CoTaskMemFree (pwzProtectedPassword);
}
}
The else
{
DWORD dwErr=GetLastError ();
Hr=HRESULT_FROM_WIN32 (dwErr);
}
Return the hr;
}

CodePudding user response:

Did the ape apes, wish to receive your reply,
  • Related