ICredentialProviderUserArray interface (credentialprovider.h)

Represents the set of users that will appear in the logon or credential UI. This information enables the credential provider to enumerate the set to retrieve property information about each user to populate fields or filter the set.

Inheritance

The ICredentialProviderUserArray interface inherits from the IUnknown interface. ICredentialProviderUserArray also has these types of members:

Methods

The ICredentialProviderUserArray interface has these methods.

 
ICredentialProviderUserArray::GetAccountOptions

Retrieves a value that indicates whether the "Other user" tile for local or Microsoft accounts is shown in the logon or credential UI.
ICredentialProviderUserArray::GetAt

Retrieves a specified user from the array.
ICredentialProviderUserArray::GetCount

Retrieves the number of ICredentialProviderUser objects in the user array.
ICredentialProviderUserArray::SetProviderFilter

Limits the set of users in the array to either local accounts or Microsoft accounts.

Remarks

This object is provided by the Windows credential provider framework to your credential provider through the ICredentialProviderSetUserArray::SetUserArray method. Ownership of this object remains with the credential provider framework.

When to implement

Third-parties do not implement this interface. An implementation is included with Windows.

Examples

The following example demonstrates a scenario that uses some of the methods of this interface. The pcpua variable represents a previously declared ICredentialProviderUserArray object.


DWORD dwCount = 0;

HRESULT hr = pcpua->GetCount(&dwCount);

if (SUCCEEDED(hr))
{
    for (DWORD i = 0; i < dwCount; i++)
    {
        ICredentialProviderUser *pcpu = NULL;
        hr = pcpua->GetAt(i, &pcpu);

        if (SUCCEEDED(hr))
        {
            PWSTR pszName = NULL;
            hr = pcpu->GetStringValue(PKEY_Identity_UserName, &pszName);

            if (SUCCEEDED(hr))
            {
                // Do something with the string
                CoTaskMemFree(pszName);
            }
            pcpu->Release();
        }
    }
}

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header credentialprovider.h

See also

ICredentialProviderSetUserArray

ICredentialProviderUser

IUnknown