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
07ec73fc
Commit
07ec73fc
authored
Oct 06, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Retrieve the current user SID from the server in lookup_user_account_name.
parent
da3ee665
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
security.c
dlls/advapi32/security.c
+13
-17
No files found.
dlls/advapi32/security.c
View file @
07ec73fc
...
...
@@ -2555,30 +2555,28 @@ LookupAccountNameA(
static
BOOL
lookup_user_account_name
(
PSID
Sid
,
PDWORD
cbSid
,
LPWSTR
ReferencedDomainName
,
LPDWORD
cchReferencedDomainName
,
PSID_NAME_USE
peUse
)
{
/* Default implementation: Always return a default SID */
SID_IDENTIFIER_AUTHORITY
identifierAuthority
=
{
SECURITY_NT_AUTHORITY
};
char
buffer
[
sizeof
(
TOKEN_USER
)
+
sizeof
(
SID
)
+
sizeof
(
DWORD
)
*
SID_MAX_SUB_AUTHORITIES
];
DWORD
len
=
sizeof
(
buffer
);
HANDLE
token
;
BOOL
ret
;
PSID
pSid
;
static
const
WCHAR
dm
[]
=
{
'D'
,
'O'
,
'M'
,
'A'
,
'I'
,
'N'
,
0
};
DWORD
nameLen
;
LPCWSTR
domainName
;
ret
=
AllocateAndInitializeSid
(
&
identifierAuthority
,
2
,
SECURITY_BUILTIN_DOMAIN_RID
,
DOMAIN_ALIAS_RID_ADMINS
,
0
,
0
,
0
,
0
,
0
,
0
,
&
pSid
);
if
(
!
ret
)
return
FALSE
;
if
(
!
RtlValidSid
(
pSid
))
if
(
!
OpenThreadToken
(
GetCurrentThread
(),
TOKEN_READ
,
TRUE
,
&
token
))
{
FreeSid
(
pSid
)
;
return
FALSE
;
if
(
GetLastError
()
!=
ERROR_NO_TOKEN
)
return
FALSE
;
if
(
!
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_READ
,
&
token
))
return
FALSE
;
}
ret
=
GetTokenInformation
(
token
,
TokenUser
,
buffer
,
len
,
&
len
);
CloseHandle
(
token
);
if
(
!
ret
)
return
FALSE
;
pSid
=
((
TOKEN_USER
*
)
buffer
)
->
User
.
Sid
;
if
(
Sid
!=
NULL
&&
(
*
cbSid
>=
GetLengthSid
(
pSid
)))
CopySid
(
*
cbSid
,
Sid
,
pSid
);
if
(
*
cbSid
<
GetLengthSid
(
pSid
))
...
...
@@ -2605,8 +2603,6 @@ static BOOL lookup_user_account_name(PSID Sid, PDWORD cbSid, LPWSTR ReferencedDo
if
(
ret
)
*
peUse
=
SidTypeUser
;
FreeSid
(
pSid
);
return
ret
;
}
...
...
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