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
f8dea2d8
Commit
f8dea2d8
authored
May 26, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Avoid some code duplication.
parent
a534fdec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
45 deletions
+21
-45
ntlm.c
dlls/secur32/ntlm.c
+21
-45
No files found.
dlls/secur32/ntlm.c
View file @
f8dea2d8
...
...
@@ -129,69 +129,45 @@ static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(
LPWKSTA_USER_INFO_1
ui
=
NULL
;
NET_API_STATUS
status
;
if
((
status
=
NetWkstaUserGetInfo
(
NULL
,
1
,
(
LPBYTE
*
)
&
ui
))
!=
NERR_Success
)
status
=
NetWkstaUserGetInfo
(
NULL
,
1
,
(
LPBYTE
*
)
&
ui
);
if
(
status
!=
NERR_Success
||
ui
==
NULL
)
{
ret
=
SEC_E_NO_CREDENTIALS
;
phCredential
=
NULL
;
break
;
}
if
(
ui
!=
NULL
)
{
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
ui
->
wkui1_username
)
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
username
,
ui
->
wkui1_username
);
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
ui
->
wkui1_username
)
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
username
,
ui
->
wkui1_username
);
/* same for the domain */
domain
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
ui
->
wkui1_logon_domain
)
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
domain
,
ui
->
wkui1_logon_domain
);
NetApiBufferFree
(
ui
);
}
else
{
ret
=
SEC_E_NO_CREDENTIALS
;
phCredential
=
NULL
;
break
;
}
/* same for the domain */
domain
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
ui
->
wkui1_logon_domain
)
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
domain
,
ui
->
wkui1_logon_domain
);
NetApiBufferFree
(
ui
);
}
else
{
PSEC_WINNT_AUTH_IDENTITY_W
auth_data
=
(
PSEC_WINNT_AUTH_IDENTITY_W
)
pAuthData
;
if
(
auth_data
->
UserLength
!=
0
)
{
/* Get username and domain from pAuthData */
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
auth_data
->
UserLength
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
username
,
auth_data
->
User
);
}
else
if
(
!
auth_data
->
UserLength
||
!
auth_data
->
DomainLength
)
{
ret
=
SEC_E_NO_CREDENTIALS
;
phCredential
=
NULL
;
break
;
}
if
(
auth_data
->
DomainLength
!=
0
)
{
domain
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
auth_data
->
DomainLength
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
domain
,
auth_data
->
Domain
);
}
else
{
ret
=
SEC_E_NO_CREDENTIALS
;
phCredential
=
NULL
;
break
;
}
/* Get username and domain from pAuthData */
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
auth_data
->
UserLength
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
username
,
auth_data
->
User
);
domain
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
auth_data
->
DomainLength
+
1
)
*
sizeof
(
SEC_WCHAR
));
lstrcpyW
(
domain
,
auth_data
->
Domain
);
}
TRACE
(
"Username is %s
\n
"
,
debugstr_w
(
username
));
unixcp_size
=
WideCharToMultiByte
(
CP_UNIXCP
,
WC_NO_BEST_FIT_CHARS
,
...
...
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