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
c9c328c1
Commit
c9c328c1
authored
Jan 26, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Feb 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credui: Implement CredUIParseUserName.
parent
4ca5d44c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletion
+56
-1
credui.spec
dlls/credui/credui.spec
+1
-1
credui_main.c
dlls/credui/credui_main.c
+55
-0
No files found.
dlls/credui/credui.spec
View file @
c9c328c1
...
...
@@ -4,7 +4,7 @@
@ stdcall CredUIConfirmCredentialsW(wstr long)
@ stub CredUIInitControls
@ stub CredUIParseUserNameA
@ st
ub CredUIParseUserNameW
@ st
dcall CredUIParseUserNameW(wstr ptr long ptr long)
@ stub CredUIPromptForCredentialsA
@ stdcall CredUIPromptForCredentialsW(ptr wstr ptr long ptr long ptr long ptr long)
@ stub CredUIReadSSOCredA
...
...
dlls/credui/credui_main.c
View file @
c9c328c1
...
...
@@ -29,6 +29,7 @@
#include "credui_resources.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
credui
);
...
...
@@ -177,3 +178,57 @@ DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm)
bConfirm
?
"TRUE"
:
"FALSE"
);
return
ERROR_SUCCESS
;
}
/******************************************************************************
* CredUIParseUserNameW [CREDUI.@]
*/
DWORD
WINAPI
CredUIParseUserNameW
(
PCWSTR
pszUserName
,
PWSTR
pszUser
,
ULONG
ulMaxUserChars
,
PWSTR
pszDomain
,
ULONG
ulMaxDomainChars
)
{
PWSTR
p
;
TRACE
(
"(%s, %p, %d, %p, %d)
\n
"
,
debugstr_w
(
pszUserName
),
pszUser
,
ulMaxUserChars
,
pszDomain
,
ulMaxDomainChars
);
if
(
!
pszUserName
||
!
pszUser
||
!
ulMaxUserChars
||
!
pszDomain
||
!
ulMaxDomainChars
)
return
ERROR_INVALID_PARAMETER
;
/* FIXME: handle marshaled credentials */
p
=
strchrW
(
pszUserName
,
'\\'
);
if
(
p
)
{
if
(
p
-
pszUserName
>
ulMaxDomainChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
strlenW
(
p
+
1
)
>
ulMaxUserChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
pszUser
,
p
+
1
);
memcpy
(
pszDomain
,
pszUserName
,
(
p
-
pszUserName
)
*
sizeof
(
WCHAR
));
pszDomain
[
p
-
pszUserName
]
=
'\0'
;
return
ERROR_SUCCESS
;
}
p
=
strrchrW
(
pszUserName
,
'@'
);
if
(
p
)
{
if
(
p
+
1
-
pszUserName
>
ulMaxUserChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
strlenW
(
p
+
1
)
>
ulMaxDomainChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
pszDomain
,
p
+
1
);
memcpy
(
pszUser
,
pszUserName
,
(
p
-
pszUserName
)
*
sizeof
(
WCHAR
));
pszUser
[
p
-
pszUserName
]
=
'\0'
;
return
ERROR_SUCCESS
;
}
if
(
strlenW
(
pszUserName
)
>
ulMaxUserChars
-
1
)
return
ERROR_INSUFFICIENT_BUFFER
;
strcpyW
(
pszUser
,
pszUserName
);
pszDomain
[
0
]
=
'\0'
;
return
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