https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ac976626192df5d6bfe83…
commit ac976626192df5d6bfe836346065ef1ce4817f62
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sat May 8 17:25:33 2021 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Tue May 11 09:20:28 2021 +0200
[KMTESTS:SE] Remove erroneous tests regarding impersonation level
These tests didn't make much sense. The captured token from the subject context is
not an impersonation token and both Windows and ReactOS ultimately fail on those tests.
---
.../rostests/kmtests/ntos_se/SeQueryInfoToken.c | 23 +++++-----------------
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/modules/rostests/kmtests/ntos_se/SeQueryInfoToken.c
b/modules/rostests/kmtests/ntos_se/SeQueryInfoToken.c
index 6e4f3b1cf24..97ea924cf76 100644
--- a/modules/rostests/kmtests/ntos_se/SeQueryInfoToken.c
+++ b/modules/rostests/kmtests/ntos_se/SeQueryInfoToken.c
@@ -104,26 +104,13 @@ void TestsSeQueryInformationToken(PACCESS_TOKEN Token)
//----------------------------------------------------------------//
- // Call SQIT with TokenImpersonationLevel argument
- //
- // What's up? Why SQIT fails with right arg?
- // Because your token has Token->TokenType != TokenImpersonation. -hbelusca
+ // Call SQIT with TokenImpersonationLevel argument. Although our token
+ // is not an impersonation token, the call will outright fail.
Buffer = NULL;
Status = SeQueryInformationToken(Token, TokenImpersonationLevel, &Buffer);
- ok(Status == STATUS_SUCCESS, "SQIT with TokenImpersonationLevel fails with
status 0x%08X\n", Status);
- if (Buffer) ExFreePool(Buffer);
-
- Buffer = NULL;
- Status = SeQueryInformationToken(Token, TokenImpersonationLevel, &Buffer);
- ok(Status == STATUS_SUCCESS, "and again: SQIT with TokenImpersonationLevel fails
with status 0x%08X\n", Status);
- if (Status == STATUS_SUCCESS)
- {
- ok(Buffer != NULL, "Wrong. SQIT call was successful with
TokenImpersonationLevel arg. But Buffer == NULL\n");
- } else {
- ok(Buffer == NULL, "Wrong. SQIT call failed. But Buffer != NULL\n");
- }
- if (Buffer) ExFreePool(Buffer);
+ ok(Status == STATUS_INVALID_INFO_CLASS, "SQIT with TokenImpersonationLevel must
return STATUS_INVALID_INFO_CLASS but got 0x%08X\n", Status);
+ ok(Buffer == NULL, "SQIT has failed to query the impersonation level but buffer
is not NULL!\n");
//----------------------------------------------------------------//
@@ -420,4 +407,4 @@ START_TEST(SeQueryInfoToken)
if (SubjectContext) ExFreePool(SubjectContext);
if (AuxData) ExFreePool(AuxData);
if (AccessState) ExFreePool(AccessState);
-}
\ No newline at end of file
+}