Author: ekohl
Date: Tue Mar 23 22:53:19 2010
New Revision: 46370
URL:
http://svn.reactos.org/svn/reactos?rev=46370&view=rev
Log:
[NTOSKRNL]
Fail if you query a primary token for its impersonation level.
Modified:
trunk/reactos/ntoskrnl/se/token.c
Modified: trunk/reactos/ntoskrnl/se/token.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/token.c?rev=46…
==============================================================================
--- trunk/reactos/ntoskrnl/se/token.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/se/token.c [iso-8859-1] Tue Mar 23 22:53:19 2010
@@ -1347,6 +1347,14 @@
PSECURITY_IMPERSONATION_LEVEL sil =
(PSECURITY_IMPERSONATION_LEVEL)TokenInformation;
DPRINT("NtQueryInformationToken(TokenImpersonationLevel)\n");
+
+ /* Fail if the token is not an impersonation token */
+ if (Token->TokenType != TokenImpersonation)
+ {
+ Status = STATUS_INVALID_INFO_CLASS;
+ break;
+ }
+
RequiredLength = sizeof(SECURITY_IMPERSONATION_LEVEL);
_SEH2_TRY