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
bc59d7e8
Commit
bc59d7e8
authored
Jan 13, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Slightly simplify the GetUserNameExW implementation.
parent
55ad9da9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
21 deletions
+14
-21
secur32.c
dlls/secur32/secur32.c
+14
-21
No files found.
dlls/secur32/secur32.c
View file @
bc59d7e8
...
...
@@ -1096,16 +1096,16 @@ BOOLEAN WINAPI GetUserNameExA(
BOOLEAN
WINAPI
GetUserNameExW
(
EXTENDED_NAME_FORMAT
NameFormat
,
LPWSTR
lpNameBuffer
,
PULONG
nSize
)
{
BOOLEAN
status
;
WCHAR
samname
[
UNLEN
+
1
+
MAX_COMPUTERNAME_LENGTH
+
1
];
LPWSTR
out
;
DWORD
len
;
TRACE
(
"(%d %p %p)
\n
"
,
NameFormat
,
lpNameBuffer
,
nSize
);
switch
(
NameFormat
)
{
case
NameSamCompatible
:
{
WCHAR
samname
[
UNLEN
+
1
+
MAX_COMPUTERNAME_LENGTH
+
1
];
LPWSTR
out
;
DWORD
len
;
/* This assumes the current user is always a local account */
len
=
MAX_COMPUTERNAME_LENGTH
+
1
;
if
(
GetComputerNameW
(
samname
,
&
len
))
...
...
@@ -1115,25 +1115,20 @@ BOOLEAN WINAPI GetUserNameExW(
len
=
UNLEN
+
1
;
if
(
GetUserNameW
(
out
,
&
len
))
{
status
=
(
lstrlenW
(
samname
)
<
*
nSize
);
if
(
status
)
if
(
lstrlenW
(
samname
)
<
*
nSize
)
{
lstrcpyW
(
lpNameBuffer
,
samname
);
*
nSize
=
lstrlenW
(
samname
);
return
TRUE
;
}
else
{
SetLastError
(
ERROR_MORE_DATA
);
*
nSize
=
lstrlenW
(
samname
)
+
1
;
}
SetLastError
(
ERROR_MORE_DATA
);
*
nSize
=
lstrlenW
(
samname
)
+
1
;
}
else
status
=
FALSE
;
}
else
status
=
FALSE
;
return
FALSE
;
}
break
;
case
NameUnknown
:
case
NameFullyQualifiedDN
:
case
NameDisplay
:
...
...
@@ -1144,14 +1139,12 @@ BOOLEAN WINAPI GetUserNameExW(
case
NameServicePrincipal
:
case
NameDnsDomain
:
SetLastError
(
ERROR_NONE_MAPPED
);
status
=
FALSE
;
break
;
return
FALSE
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
status
=
FALSE
;
return
FALSE
;
}
return
status
;
}
BOOLEAN
WINAPI
TranslateNameA
(
...
...
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