[NTOS:PS] Adjust the PsReferenceEffectiveToken() prototype in the header; add a comment about the fact that the ImpersonationLevel parameter can be left untouched on purpose in one special case.

This commit is contained in:
Hermès Bélusca-Maïto 2018-06-25 15:21:33 +02:00
parent 3cdb717a7b
commit 813879f02f
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 8 additions and 5 deletions

View 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

View 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;
}