Author: ekohl
Date: Sun Oct 10 11:31:51 2010
New Revision: 49091
URL:
http://svn.reactos.org/svn/reactos?rev=49091&view=rev
Log:
[NTOSKRNL]
Implement SeImpersonateClientEx() and simplify SeImpersonateClient().
Modified:
trunk/reactos/ntoskrnl/se/access.c
Modified: trunk/reactos/ntoskrnl/se/access.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/access.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/se/access.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/se/access.c [iso-8859-1] Sun Oct 10 11:31:51 2010
@@ -331,15 +331,36 @@
}
/*
- * @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 @@
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);
+ PAGED_CODE();
+
+ SeImpersonateClientEx(ClientContext,
+ ServerThread);
}
/* EOF */