[NTOSKRNL]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 10 Oct 2010 11:31:51 +0000 (11:31 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 10 Oct 2010 11:31:51 +0000 (11:31 +0000)
Implement SeImpersonateClientEx() and simplify SeImpersonateClient().

svn path=/trunk/; revision=49091

reactos/ntoskrnl/se/access.c

index fdf4f13..b4ebe9f 100644 (file)
@@ -331,36 +331,24 @@ 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;
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext,
-                    IN PETHREAD ServerThread OPTIONAL)
-{
-    UCHAR b;
+    BOOLEAN EffectiveOnly;
 
     PAGED_CODE();
 
     if (ClientContext->DirectlyAccessClientToken == FALSE)
     {
-        b = ClientContext->SecurityQos.EffectiveOnly;
+        EffectiveOnly = ClientContext->SecurityQos.EffectiveOnly;
     }
     else
     {
-        b = ClientContext->DirectAccessEffectiveOnly;
+        EffectiveOnly = ClientContext->DirectAccessEffectiveOnly;
     }
 
     if (ServerThread == NULL)
@@ -368,11 +356,25 @@ SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext,
         ServerThread = PsGetCurrentThread();
     }
 
-    PsImpersonateClient(ServerThread,
-                        ClientContext->ClientToken,
-                        1,
-                        b,
-                        ClientContext->SecurityQos.ImpersonationLevel);
+    return PsImpersonateClient(ServerThread,
+                               ClientContext->ClientToken,
+                               TRUE,
+                               EffectiveOnly,
+                               ClientContext->SecurityQos.ImpersonationLevel);
+}
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext,
+                    IN PETHREAD ServerThread OPTIONAL)
+{
+    PAGED_CODE();
+
+    SeImpersonateClientEx(ClientContext,
+                          ServerThread);
 }
 
 /* EOF */