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
678d3965
Commit
678d3965
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: Add support for saving the credentials input using…
credui: Add support for saving the credentials input using CredUIPromptForCredentials by calling CredWriteW.
parent
3c8663b7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
Makefile.in
dlls/credui/Makefile.in
+1
-1
credui_main.c
dlls/credui/credui_main.c
+30
-4
No files found.
dlls/credui/Makefile.in
View file @
678d3965
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
credui.dll
IMPORTLIB
=
libcredui.
$(IMPLIBEXT)
IMPORTS
=
comctl32 user32 kernel32
IMPORTS
=
comctl32 user32
advapi32
kernel32
C_SRCS
=
\
credui_main.c
...
...
dlls/credui/credui_main.c
View file @
678d3965
...
...
@@ -41,6 +41,7 @@ struct pending_credentials
PWSTR
pszTargetName
;
PWSTR
pszUsername
;
PWSTR
pszPassword
;
BOOL
generic
;
};
static
HINSTANCE
hinstCredUI
;
...
...
@@ -87,10 +88,32 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
static
DWORD
save_credentials
(
PCWSTR
pszTargetName
,
PCWSTR
pszUsername
,
PCWSTR
pszPassword
)
PCWSTR
pszPassword
,
BOOL
generic
)
{
FIXME
(
"save servername %s with username %s
\n
"
,
debugstr_w
(
pszTargetName
),
debugstr_w
(
pszUsername
));
CREDENTIALW
cred
;
TRACE
(
"saving servername %s with username %s
\n
"
,
debugstr_w
(
pszTargetName
),
debugstr_w
(
pszUsername
));
cred
.
Flags
=
0
;
cred
.
Type
=
generic
?
CRED_TYPE_GENERIC
:
CRED_TYPE_DOMAIN_PASSWORD
;
cred
.
TargetName
=
(
LPWSTR
)
pszTargetName
;
cred
.
Comment
=
NULL
;
cred
.
CredentialBlobSize
=
strlenW
(
pszPassword
)
*
sizeof
(
WCHAR
);
cred
.
CredentialBlob
=
(
LPBYTE
)
pszPassword
;
cred
.
Persist
=
CRED_PERSIST_ENTERPRISE
;
cred
.
AttributeCount
=
0
;
cred
.
Attributes
=
NULL
;
cred
.
TargetAlias
=
NULL
;
cred
.
UserName
=
(
LPWSTR
)
pszUsername
;
if
(
CredWriteW
(
&
cred
,
0
))
return
ERROR_SUCCESS
;
else
{
DWORD
ret
=
GetLastError
();
ERR
(
"CredWriteW failed with error %d
\n
"
,
ret
);
return
ret
;
}
}
struct
cred_dialog_params
...
...
@@ -312,11 +335,13 @@ DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo,
len
=
strlenW
(
params
.
pszPassword
);
entry
->
pszPassword
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
entry
->
pszPassword
,
params
.
pszPassword
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
entry
->
generic
=
dwFlags
&
CREDUI_FLAGS_GENERIC_CREDENTIALS
?
TRUE
:
FALSE
;
LeaveCriticalSection
(
&
csPendingCredentials
);
}
else
result
=
save_credentials
(
pszTargetName
,
pszUsername
,
pszPassword
);
result
=
save_credentials
(
pszTargetName
,
pszUsername
,
pszPassword
,
dwFlags
&
CREDUI_FLAGS_GENERIC_CREDENTIALS
?
TRUE
:
FALSE
);
}
return
result
;
...
...
@@ -342,7 +367,8 @@ DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm)
if
(
!
strcmpW
(
pszTargetName
,
entry
->
pszTargetName
))
{
if
(
bConfirm
)
result
=
save_credentials
(
entry
->
pszTargetName
,
entry
->
pszUsername
,
entry
->
pszPassword
);
result
=
save_credentials
(
entry
->
pszTargetName
,
entry
->
pszUsername
,
entry
->
pszPassword
,
entry
->
generic
);
else
result
=
ERROR_SUCCESS
;
...
...
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