[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.
This commit is contained in:
George Bișoc 2021-05-08 17:25:33 +02:00
parent 55060911e4
commit ac97662619
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

View file

@ -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);
}
}