Question

I have used Microsoft's Credential Provider samples to put together a wrapper for the default Windows 7 logon screen.

All appears to be running well in terms of the new CP, but I am getting duplicate tiles appearing on my logon screen, namely the default Windows tile, and my 'wrapped' tile.

How can I remove the default Windows tile, as this does not incorporate my changes?

Was it helpful?

Solution

There are two possible solutions:

1. Take a closer look at GetCredentialCountfunction of your provider.
In case of wrapping existing provider, in that function you should get a count of credentials from underlaying provider (that one being wrapped) and wrap them by yours credentials. Maybe, somehow (due to logical errors in code) you make several duplicates of credentials. (I've never wrote a wrapper, but this approach may have sense).

2. Another way is to write your own CredentialProviderFilter by implementing ICredentialProviderFilter interface.
! If you take a look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication registry key, you will see that among other subkeys there are 2 interesting ones: Credential Providers and Credential Provider Filters.
Thats how it looks on my PC:

Under Credential Providers are listed all credential providers of your windows, and among them there is your own credential provider. The idea of Credential Provider Filter is to filter out all other credential providers, except yours one. You can distinguish your credential provider from others by GUID.
The implementation of this is very simple -- you have to implement just one method from ICredentialProviderFilter interface. This method is ICredentialProviderFilter::Filter.

HRESULT MyProviderFilter::Filter(      
    CREDENTIAL_PROVIDER_USAGE_SCENARIO cpus,
    DWORD dwFlags,
    GUID *rgclsidProviders,
    BOOL *rgbAllow,
    DWORD cProviders)
{
    UNREFERENCED_PARAMETER(dwFlags);

    for (DWORD dwI = 0; dwI < cProviders; dwI++)
    {
        if (!IsEqualGUID(rgclsidProviders[dwI], myProviderGUID))
        {
            rgbAllow[dwI] = FALSE;
        } else rgbAllow[dwI] = TRUE;
    }
    return S_OK;
}


So in result, all providers will be disallowed except yours one. You can implement ICredentialProviderFilter and ICredentialProvider in one module. As far as I remember there is a sample for credential provider filter in Microsoft Windows SDK.

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top