Commit 40029642 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

credui: Check for and don't add duplicates when filling the username combo box.

parent cdb6e9ed
......@@ -142,6 +142,8 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, struct cred_dialog_pa
for (i = 0; i < count; i++)
{
COMBOBOXEXITEMW comboitem;
DWORD j;
BOOL duplicate = FALSE;
if (params->dwFlags & CREDUI_FLAGS_GENERIC_CREDENTIALS)
{
......@@ -154,6 +156,17 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, struct cred_dialog_pa
continue;
}
/* don't add another item with the same name if we've already added it */
for (j = 0; j < i; j++)
if (!strcmpW(credentials[i]->UserName, credentials[j]->UserName))
{
duplicate = TRUE;
break;
}
if (duplicate)
continue;
comboitem.mask = CBEIF_TEXT;
comboitem.iItem = -1;
comboitem.pszText = credentials[i]->UserName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment