Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cdb6e9ed
Commit
cdb6e9ed
authored
Nov 17, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Nov 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credui: Enumerate saved credentials and use these to populate the combo box.
parent
96714cf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
4 deletions
+42
-4
credui_main.c
dlls/credui/credui_main.c
+42
-4
No files found.
dlls/credui/credui_main.c
View file @
cdb6e9ed
...
...
@@ -130,8 +130,44 @@ struct cred_dialog_params
DWORD
dwFlags
;
};
static
void
CredDialogFillUsernameCombo
(
HWND
hwndUsername
,
struct
cred_dialog_params
*
params
)
{
DWORD
count
;
DWORD
i
;
PCREDENTIALW
*
credentials
;
if
(
!
CredEnumerateW
(
NULL
,
0
,
&
count
,
&
credentials
))
return
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
COMBOBOXEXITEMW
comboitem
;
if
(
params
->
dwFlags
&
CREDUI_FLAGS_GENERIC_CREDENTIALS
)
{
if
((
credentials
[
i
]
->
Type
!=
CRED_TYPE_GENERIC
)
||
!
credentials
[
i
]
->
UserName
)
continue
;
}
else
{
if
(
credentials
[
i
]
->
Type
==
CRED_TYPE_GENERIC
)
continue
;
}
comboitem
.
mask
=
CBEIF_TEXT
;
comboitem
.
iItem
=
-
1
;
comboitem
.
pszText
=
credentials
[
i
]
->
UserName
;
SendMessageW
(
hwndUsername
,
CBEM_INSERTITEMW
,
0
,
(
LPARAM
)
&
comboitem
);
}
CredFree
(
credentials
);
}
static
BOOL
CredDialogInit
(
HWND
hwndDlg
,
struct
cred_dialog_params
*
params
)
{
HWND
hwndUsername
=
GetDlgItem
(
hwndDlg
,
IDC_USERNAME
);
HWND
hwndPassword
=
GetDlgItem
(
hwndDlg
,
IDC_PASSWORD
);
SetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
,
(
LONG_PTR
)
params
);
if
(
params
->
pszMessageText
)
SetDlgItemTextW
(
hwndDlg
,
IDC_MESSAGE
,
params
->
pszMessageText
);
...
...
@@ -143,13 +179,15 @@ static BOOL CredDialogInit(HWND hwndDlg, struct cred_dialog_params *params)
snprintfW
(
message
,
sizeof
(
message
)
/
sizeof
(
message
[
0
]),
format
,
params
->
pszTargetName
);
SetDlgItemTextW
(
hwndDlg
,
IDC_MESSAGE
,
message
);
}
SetDlgItemTextW
(
hwndDlg
,
IDC_USERNAME
,
params
->
pszUsername
);
SetDlgItemTextW
(
hwndDlg
,
IDC_PASSWORD
,
params
->
pszPassword
);
SetWindowTextW
(
hwndUsername
,
params
->
pszUsername
);
SetWindowTextW
(
hwndPassword
,
params
->
pszPassword
);
CredDialogFillUsernameCombo
(
hwndUsername
,
params
);
if
(
params
->
pszUsername
[
0
])
SetFocus
(
GetDlgItem
(
hwndDlg
,
IDC_PASSWORD
)
);
SetFocus
(
hwndPassword
);
else
SetFocus
(
GetDlgItem
(
hwndDlg
,
IDC_USERNAME
)
);
SetFocus
(
hwndUsername
);
if
(
params
->
pszCaptionText
)
SetWindowTextW
(
hwndDlg
,
params
->
pszCaptionText
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment