https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5dd93a8a5bf3936fd1810af520e12abd041675e0
commit 5dd93a8a5bf3936fd1810af520e12abd041675e0 Author: George Bișoc <[email protected]> AuthorDate: Mon May 3 21:23:02 2021 +0200 Commit: George Bișoc <[email protected]> CommitDate: Tue May 4 10:08:26 2021 +0200 [NTOS:SE] Get the session ID and assign it to the new token SeExchangePrimaryToken doesn't assign the session ID to the new token, which could lead to incorrect behaviour in the long run. Let's fix that. --- ntoskrnl/se/token.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/se/token.c b/ntoskrnl/se/token.c index 6c1fa178643..bb623ea7c4c 100644 --- a/ntoskrnl/se/token.c +++ b/ntoskrnl/se/token.c @@ -636,7 +636,8 @@ SeExchangePrimaryToken( /* Mark new token in use */ NewToken->TokenInUse = TRUE; - // TODO: Set a correct SessionId for NewToken + /* Set the session ID for the new token */ + NewToken->SessionId = MmGetSessionId(Process); /* Unlock the new token */ SepReleaseTokenLock(NewToken);
