[NTOS:PS] Adjust the PsReferenceEffectiveToken() prototype in the header; add a comme...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 25 Jun 2018 13:21:33 +0000 (15:21 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 27 Jun 2018 21:40:13 +0000 (23:40 +0200)
ntoskrnl/include/internal/ps.h
ntoskrnl/ps/security.c

index f39239f..b6eb06d 100644 (file)
@@ -170,9 +170,9 @@ PACCESS_TOKEN
 NTAPI
 PsReferenceEffectiveToken(
     IN PETHREAD Thread,
-    OUT PTOKEN_TYPE TokenType,
-    OUT PUCHAR b,
-    OUT PSECURITY_IMPERSONATION_LEVEL Level
+    OUT IN PTOKEN_TYPE TokenType,
+    OUT PBOOLEAN EffectiveOnly,
+    OUT PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel
 );
 
 NTSTATUS
index e49e23b..f696d0f 100644 (file)
@@ -691,11 +691,13 @@ NTAPI
 PsReferenceEffectiveToken(IN PETHREAD Thread,
                           OUT IN PTOKEN_TYPE TokenType,
                           OUT PBOOLEAN EffectiveOnly,
-                          OUT PSECURITY_IMPERSONATION_LEVEL Level)
+                          OUT PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
 {
     PEPROCESS Process;
     PACCESS_TOKEN Token = NULL;
+
     PAGED_CODE();
+
     PSTRACE(PS_SECURITY_DEBUG,
             "Thread: %p, TokenType: %p\n", Thread, TokenType);
 
@@ -716,7 +718,7 @@ PsReferenceEffectiveToken(IN PETHREAD Thread,
             /* Return data to caller */
             *TokenType = TokenImpersonation;
             *EffectiveOnly = Thread->ImpersonationInfo->EffectiveOnly;
-            *Level = Thread->ImpersonationInfo->ImpersonationLevel;
+            *ImpersonationLevel = Thread->ImpersonationInfo->ImpersonationLevel;
 
             /* Unlock the Process */
             PspUnlockProcessSecurityShared(Process);
@@ -746,6 +748,7 @@ PsReferenceEffectiveToken(IN PETHREAD Thread,
     /* Return the token */
     *TokenType = TokenPrimary;
     *EffectiveOnly = FALSE;
+    // NOTE: ImpersonationLevel is left untouched on purpose!
     return Token;
 }