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
9d95d331
Commit
9d95d331
authored
Oct 18, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credui: Don't show a dialog if existing credentials can be found.
parent
d6f86876
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
credui_main.c
dlls/credui/credui_main.c
+37
-0
No files found.
dlls/credui/credui_main.c
View file @
9d95d331
...
...
@@ -548,6 +548,38 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
}
}
static
BOOL
find_existing_credential
(
const
WCHAR
*
target
,
WCHAR
*
username
,
ULONG
len_username
,
WCHAR
*
password
,
ULONG
len_password
)
{
DWORD
count
,
i
;
CREDENTIALW
**
credentials
;
if
(
!
CredEnumerateW
(
target
,
0
,
&
count
,
&
credentials
))
return
FALSE
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
credentials
[
i
]
->
Type
!=
CRED_TYPE_DOMAIN_PASSWORD
)
{
FIXME
(
"no support for type %u credentials
\n
"
,
credentials
[
i
]
->
Type
);
continue
;
}
if
((
!*
username
||
!
strcmpW
(
username
,
credentials
[
i
]
->
UserName
))
&&
strlenW
(
credentials
[
i
]
->
UserName
)
<
len_username
&&
credentials
[
i
]
->
CredentialBlobSize
/
sizeof
(
WCHAR
)
<
len_password
)
{
TRACE
(
"found existing credential for %s
\n
"
,
debugstr_w
(
credentials
[
i
]
->
UserName
));
strcpyW
(
username
,
credentials
[
i
]
->
UserName
);
memcpy
(
password
,
credentials
[
i
]
->
CredentialBlob
,
credentials
[
i
]
->
CredentialBlobSize
);
password
[
credentials
[
i
]
->
CredentialBlobSize
/
sizeof
(
WCHAR
)]
=
0
;
CredFree
(
credentials
);
return
TRUE
;
}
}
CredFree
(
credentials
);
return
FALSE
;
}
/******************************************************************************
* CredUIPromptForCredentialsW [CREDUI.@]
*/
...
...
@@ -578,6 +610,11 @@ DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo,
if
((
dwFlags
&
CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX
)
&&
!
pfSave
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
dwFlags
&
CREDUI_FLAGS_ALWAYS_SHOW_UI
)
&&
!
(
dwFlags
&
CREDUI_FLAGS_INCORRECT_PASSWORD
)
&&
find_existing_credential
(
pszTargetName
,
pszUsername
,
ulUsernameMaxChars
,
pszPassword
,
ulPasswordMaxChars
))
return
ERROR_SUCCESS
;
params
.
pszTargetName
=
pszTargetName
;
if
(
pUIInfo
)
{
...
...
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