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
bf1bebc3
Commit
bf1bebc3
authored
May 29, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credui: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bcdbd34f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
34 deletions
+35
-34
Makefile.in
dlls/credui/Makefile.in
+2
-0
credui_main.c
dlls/credui/credui_main.c
+33
-34
No files found.
dlls/credui/Makefile.in
View file @
bf1bebc3
...
...
@@ -2,6 +2,8 @@ MODULE = credui.dll
IMPORTLIB
=
credui
IMPORTS
=
comctl32 user32 advapi32
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
credui_main.c
...
...
dlls/credui/credui_main.c
View file @
bf1bebc3
...
...
@@ -32,7 +32,6 @@
#include "credui_resources.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
credui
);
...
...
@@ -89,7 +88,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszTargetName
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszUsername
);
SecureZeroMemory
(
entry
->
pszPassword
,
strlenW
(
entry
->
pszPassword
)
*
sizeof
(
WCHAR
));
SecureZeroMemory
(
entry
->
pszPassword
,
l
strlenW
(
entry
->
pszPassword
)
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszPassword
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
}
...
...
@@ -111,7 +110,7 @@ static DWORD save_credentials(PCWSTR pszTargetName, PCWSTR pszUsername,
cred
.
Type
=
generic
?
CRED_TYPE_GENERIC
:
CRED_TYPE_DOMAIN_PASSWORD
;
cred
.
TargetName
=
(
LPWSTR
)
pszTargetName
;
cred
.
Comment
=
NULL
;
cred
.
CredentialBlobSize
=
strlenW
(
pszPassword
)
*
sizeof
(
WCHAR
);
cred
.
CredentialBlobSize
=
l
strlenW
(
pszPassword
)
*
sizeof
(
WCHAR
);
cred
.
CredentialBlob
=
(
LPBYTE
)
pszPassword
;
cred
.
Persist
=
CRED_PERSIST_ENTERPRISE
;
cred
.
AttributeCount
=
0
;
...
...
@@ -180,7 +179,7 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, const struct cred_dia
/* don't add another item with the same name if we've already added it */
for
(
j
=
0
;
j
<
i
;
j
++
)
if
(
credentials
[
j
]
->
UserName
&&
!
strcmpW
(
credentials
[
i
]
->
UserName
,
credentials
[
j
]
->
UserName
))
&&
!
l
strcmpW
(
credentials
[
i
]
->
UserName
,
credentials
[
j
]
->
UserName
))
{
duplicate
=
TRUE
;
break
;
...
...
@@ -391,7 +390,7 @@ static BOOL CredDialogInit(HWND hwndDlg, struct cred_dialog_params *params)
WCHAR
format
[
256
];
WCHAR
message
[
256
];
LoadStringW
(
hinstCredUI
,
IDS_MESSAGEFORMAT
,
format
,
ARRAY_SIZE
(
format
));
s
nprintfW
(
message
,
ARRAY_SIZE
(
message
),
format
,
params
->
pszTargetName
);
s
wprintf
(
message
,
ARRAY_SIZE
(
message
),
format
,
params
->
pszTargetName
);
SetDlgItemTextW
(
hwndDlg
,
IDC_MESSAGE
,
message
);
}
SetWindowTextW
(
hwndUsername
,
params
->
pszUsername
);
...
...
@@ -416,7 +415,7 @@ static BOOL CredDialogInit(HWND hwndDlg, struct cred_dialog_params *params)
WCHAR
format
[
256
];
WCHAR
title
[
256
];
LoadStringW
(
hinstCredUI
,
IDS_TITLEFORMAT
,
format
,
ARRAY_SIZE
(
format
));
s
nprintfW
(
title
,
ARRAY_SIZE
(
title
),
format
,
params
->
pszTargetName
);
s
wprintf
(
title
,
ARRAY_SIZE
(
title
),
format
,
params
->
pszTargetName
);
SetWindowTextW
(
hwndDlg
,
title
);
}
...
...
@@ -455,9 +454,9 @@ static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params)
return
;
}
if
(
!
strchrW
(
user
,
'\\'
)
&&
!
strchrW
(
user
,
'@'
))
if
(
!
wcschr
(
user
,
'\\'
)
&&
!
wcschr
(
user
,
'@'
))
{
ULONG
len_target
=
strlenW
(
params
->
pszTargetName
);
ULONG
len_target
=
l
strlenW
(
params
->
pszTargetName
);
memcpy
(
params
->
pszUsername
,
params
->
pszTargetName
,
min
(
len_target
,
params
->
ulUsernameMaxChars
)
*
sizeof
(
WCHAR
));
if
(
len_target
+
1
<
params
->
ulUsernameMaxChars
)
...
...
@@ -468,7 +467,7 @@ static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params)
else
if
(
params
->
ulUsernameMaxChars
>
0
)
params
->
pszUsername
[
0
]
=
'\0'
;
len2
=
strlenW
(
params
->
pszUsername
);
len2
=
l
strlenW
(
params
->
pszUsername
);
memcpy
(
params
->
pszUsername
+
len2
,
user
,
min
(
len
,
params
->
ulUsernameMaxChars
-
len2
)
*
sizeof
(
WCHAR
));
if
(
params
->
ulUsernameMaxChars
)
params
->
pszUsername
[
len2
+
min
(
len
,
params
->
ulUsernameMaxChars
-
len2
-
1
)]
=
'\0'
;
...
...
@@ -573,13 +572,13 @@ static BOOL find_existing_credential(const WCHAR *target, WCHAR *username, ULONG
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
&&
if
((
!*
username
||
!
l
strcmpW
(
username
,
credentials
[
i
]
->
UserName
))
&&
l
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
);
l
strcpyW
(
username
,
credentials
[
i
]
->
UserName
);
memcpy
(
password
,
credentials
[
i
]
->
CredentialBlob
,
credentials
[
i
]
->
CredentialBlobSize
);
password
[
credentials
[
i
]
->
CredentialBlobSize
/
sizeof
(
WCHAR
)]
=
0
;
...
...
@@ -676,27 +675,27 @@ DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo,
/* find existing pending credentials for the same target and overwrite */
/* FIXME: is this correct? */
LIST_FOR_EACH_ENTRY
(
entry
,
&
pending_credentials_list
,
struct
pending_credentials
,
entry
)
if
(
!
strcmpW
(
pszTargetName
,
entry
->
pszTargetName
))
if
(
!
l
strcmpW
(
pszTargetName
,
entry
->
pszTargetName
))
{
found
=
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszUsername
);
SecureZeroMemory
(
entry
->
pszPassword
,
strlenW
(
entry
->
pszPassword
)
*
sizeof
(
WCHAR
));
SecureZeroMemory
(
entry
->
pszPassword
,
l
strlenW
(
entry
->
pszPassword
)
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszPassword
);
}
if
(
!
found
)
{
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
entry
));
len
=
strlenW
(
pszTargetName
);
len
=
l
strlenW
(
pszTargetName
);
entry
->
pszTargetName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
entry
->
pszTargetName
,
pszTargetName
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
list_add_tail
(
&
pending_credentials_list
,
&
entry
->
entry
);
}
len
=
strlenW
(
params
.
pszUsername
);
len
=
l
strlenW
(
params
.
pszUsername
);
entry
->
pszUsername
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
entry
->
pszUsername
,
params
.
pszUsername
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
len
=
strlenW
(
params
.
pszPassword
);
len
=
l
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
)
!=
0
;
...
...
@@ -728,7 +727,7 @@ DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm)
LIST_FOR_EACH_ENTRY
(
entry
,
&
pending_credentials_list
,
struct
pending_credentials
,
entry
)
{
if
(
!
strcmpW
(
pszTargetName
,
entry
->
pszTargetName
))
if
(
!
l
strcmpW
(
pszTargetName
,
entry
->
pszTargetName
))
{
if
(
bConfirm
)
result
=
save_credentials
(
entry
->
pszTargetName
,
entry
->
pszUsername
,
...
...
@@ -740,7 +739,7 @@ DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm)
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszTargetName
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszUsername
);
SecureZeroMemory
(
entry
->
pszPassword
,
strlenW
(
entry
->
pszPassword
)
*
sizeof
(
WCHAR
));
SecureZeroMemory
(
entry
->
pszPassword
,
l
strlenW
(
entry
->
pszPassword
)
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
entry
->
pszPassword
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
...
...
@@ -771,37 +770,37 @@ DWORD WINAPI CredUIParseUserNameW(PCWSTR pszUserName, PWSTR pszUser,
/* FIXME: handle marshaled credentials */
p
=
strchrW
(
pszUserName
,
'\\'
);
p
=
wcschr
(
pszUserName
,
'\\'
);
if
(
p
)
{
if
(
p
-
pszUserName
>
ulMaxDomainChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
strlenW
(
p
+
1
)
>
ulMaxUserChars
-
1
)
if
(
l
strlenW
(
p
+
1
)
>
ulMaxUserChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
pszUser
,
p
+
1
);
l
strcpyW
(
pszUser
,
p
+
1
);
memcpy
(
pszDomain
,
pszUserName
,
(
p
-
pszUserName
)
*
sizeof
(
WCHAR
));
pszDomain
[
p
-
pszUserName
]
=
'\0'
;
return
ERROR_SUCCESS
;
}
p
=
strrchrW
(
pszUserName
,
'@'
);
p
=
wcsrchr
(
pszUserName
,
'@'
);
if
(
p
)
{
if
(
p
+
1
-
pszUserName
>
ulMaxUserChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
strlenW
(
p
+
1
)
>
ulMaxDomainChars
-
1
)
if
(
l
strlenW
(
p
+
1
)
>
ulMaxDomainChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
pszDomain
,
p
+
1
);
l
strcpyW
(
pszDomain
,
p
+
1
);
memcpy
(
pszUser
,
pszUserName
,
(
p
-
pszUserName
)
*
sizeof
(
WCHAR
));
pszUser
[
p
-
pszUserName
]
=
'\0'
;
return
ERROR_SUCCESS
;
}
if
(
strlenW
(
pszUserName
)
>
ulMaxUserChars
-
1
)
if
(
l
strlenW
(
pszUserName
)
>
ulMaxUserChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
pszUser
,
pszUserName
);
l
strcpyW
(
pszUser
,
pszUserName
);
pszDomain
[
0
]
=
'\0'
;
return
ERROR_SUCCESS
;
...
...
@@ -884,8 +883,8 @@ ULONG SEC_ENTRY SspiPromptForCredentialsW( PCWSTR target, void *info,
error
,
debugstr_w
(
package
),
input_id
,
output_id
,
save
,
sspi_flags
);
if
(
!
target
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
package
||
(
strcmpiW
(
package
,
basicW
)
&&
strcmpiW
(
package
,
ntlmW
)
&&
strcmpiW
(
package
,
negotiateW
)))
if
(
!
package
||
(
wcsicmp
(
package
,
basicW
)
&&
wcsicmp
(
package
,
ntlmW
)
&&
wcsicmp
(
package
,
negotiateW
)))
{
FIXME
(
"package %s not supported
\n
"
,
debugstr_w
(
package
)
);
return
ERROR_NO_SUCH_PACKAGE
;
...
...
@@ -920,19 +919,19 @@ ULONG SEC_ENTRY SspiPromptForCredentialsW( PCWSTR target, void *info,
DWORD
size
=
sizeof
(
*
id
),
len_domain
=
0
;
WCHAR
*
ptr
,
*
user
=
username
,
*
domain
=
NULL
;
if
((
ptr
=
strchrW
(
username
,
'\\'
)))
if
((
ptr
=
wcschr
(
username
,
'\\'
)))
{
user
=
ptr
+
1
;
len_username
=
strlenW
(
user
);
if
(
!
strcmpiW
(
package
,
ntlmW
)
||
!
strcmpiW
(
package
,
negotiateW
))
len_username
=
l
strlenW
(
user
);
if
(
!
wcsicmp
(
package
,
ntlmW
)
||
!
wcsicmp
(
package
,
negotiateW
))
{
domain
=
username
;
len_domain
=
ptr
-
username
;
}
*
ptr
=
0
;
}
else
len_username
=
strlenW
(
username
);
len_password
=
strlenW
(
password
);
else
len_username
=
l
strlenW
(
username
);
len_password
=
l
strlenW
(
password
);
size
+=
(
len_username
+
1
)
*
sizeof
(
WCHAR
);
size
+=
(
len_domain
+
1
)
*
sizeof
(
WCHAR
);
...
...
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