mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[NTOSKRNL]
Implement SeImpersonateClientEx() and simplify SeImpersonateClient(). svn path=/trunk/; revision=49091
This commit is contained in:
parent
d498e714c6
commit
cc89c1b5b3
1 changed files with 26 additions and 24 deletions
|
@ -331,15 +331,36 @@ SeCreateClientSecurityFromSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectCon
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SeImpersonateClientEx(IN PSECURITY_CLIENT_CONTEXT ClientContext,
|
||||
IN PETHREAD ServerThread OPTIONAL)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
BOOLEAN EffectiveOnly;
|
||||
|
||||
PAGED_CODE();
|
||||
|
||||
if (ClientContext->DirectlyAccessClientToken == FALSE)
|
||||
{
|
||||
EffectiveOnly = ClientContext->SecurityQos.EffectiveOnly;
|
||||
}
|
||||
else
|
||||
{
|
||||
EffectiveOnly = ClientContext->DirectAccessEffectiveOnly;
|
||||
}
|
||||
|
||||
if (ServerThread == NULL)
|
||||
{
|
||||
ServerThread = PsGetCurrentThread();
|
||||
}
|
||||
|
||||
return PsImpersonateClient(ServerThread,
|
||||
ClientContext->ClientToken,
|
||||
TRUE,
|
||||
EffectiveOnly,
|
||||
ClientContext->SecurityQos.ImpersonationLevel);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -350,29 +371,10 @@ NTAPI
|
|||
SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext,
|
||||
IN PETHREAD ServerThread OPTIONAL)
|
||||
{
|
||||
UCHAR b;
|
||||
|
||||
PAGED_CODE();
|
||||
|
||||
if (ClientContext->DirectlyAccessClientToken == FALSE)
|
||||
{
|
||||
b = ClientContext->SecurityQos.EffectiveOnly;
|
||||
}
|
||||
else
|
||||
{
|
||||
b = ClientContext->DirectAccessEffectiveOnly;
|
||||
}
|
||||
|
||||
if (ServerThread == NULL)
|
||||
{
|
||||
ServerThread = PsGetCurrentThread();
|
||||
}
|
||||
|
||||
PsImpersonateClient(ServerThread,
|
||||
ClientContext->ClientToken,
|
||||
1,
|
||||
b,
|
||||
ClientContext->SecurityQos.ImpersonationLevel);
|
||||
SeImpersonateClientEx(ClientContext,
|
||||
ServerThread);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue