Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
35596ee2
Commit
35596ee2
authored
Apr 26, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
May 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement the majority of ImpersonateLoggedOnUser.
parent
64ff0e54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
security.c
dlls/advapi32/security.c
+46
-2
No files found.
dlls/advapi32/security.c
View file @
35596ee2
...
...
@@ -1667,8 +1667,52 @@ ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
*/
BOOL
WINAPI
ImpersonateLoggedOnUser
(
HANDLE
hToken
)
{
FIXME
(
"(%p):stub returning FALSE
\n
"
,
hToken
);
return
FALSE
;
NTSTATUS
Status
;
HANDLE
ImpersonationToken
;
TOKEN_TYPE
Type
=
TokenImpersonation
;
FIXME
(
"(%p)
\n
"
,
hToken
);
/* FIXME: get token type */
if
(
Type
==
TokenPrimary
)
{
OBJECT_ATTRIBUTES
ObjectAttributes
;
InitializeObjectAttributes
(
&
ObjectAttributes
,
NULL
,
0
,
NULL
,
NULL
);
Status
=
NtDuplicateToken
(
hToken
,
TOKEN_IMPERSONATE
|
TOKEN_QUERY
,
&
ObjectAttributes
,
SecurityImpersonation
,
TokenImpersonation
,
&
ImpersonationToken
);
if
(
Status
!=
STATUS_SUCCESS
)
{
ERR
(
"NtDuplicateToken failed with error 0x%08lx
\n
"
,
Status
);
SetLastError
(
RtlNtStatusToDosError
(
Status
)
);
return
FALSE
;
}
}
else
ImpersonationToken
=
hToken
;
Status
=
NtSetInformationThread
(
GetCurrentThread
(),
ThreadImpersonationToken
,
&
ImpersonationToken
,
sizeof
(
ImpersonationToken
)
);
if
(
Type
==
TokenPrimary
)
NtClose
(
ImpersonationToken
);
if
(
Status
!=
STATUS_SUCCESS
)
{
ERR
(
"NtSetInformationThread failed with error 0x%08lx
\n
"
,
Status
);
SetLastError
(
RtlNtStatusToDosError
(
Status
)
);
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************************
...
...
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