[KMTESTS:SE] Implement initial logon session tests

This implements tests for SeMarkLogonSessionForTerminationNotification exported routine so far.
This commit is contained in:
George Bișoc 2021-06-17 18:12:12 +02:00
parent 506cee3219
commit 32a45ce15c
3 changed files with 38 additions and 0 deletions

View file

@ -96,6 +96,7 @@ list(APPEND KMTEST_DRV_SOURCE
ntos_ps/PsNotify.c
ntos_se/SeHelpers.c
ntos_se/SeInheritance.c
ntos_se/SeLogonSession.c
ntos_se/SeQueryInfoToken.c
rtl/RtlIsValidOemCharacter.c
rtl/RtlRangeList.c

View file

@ -64,6 +64,7 @@ KMT_TESTFUNC Test_ObTypeNoClean;
KMT_TESTFUNC Test_ObTypes;
KMT_TESTFUNC Test_PsNotify;
KMT_TESTFUNC Test_SeInheritance;
KMT_TESTFUNC Test_SeLogonSession;
KMT_TESTFUNC Test_SeQueryInfoToken;
KMT_TESTFUNC Test_RtlAvlTree;
KMT_TESTFUNC Test_RtlException;
@ -152,6 +153,7 @@ const KMT_TEST TestList[] =
{ "RtlStrSafeKM", Test_RtlStrSafe },
{ "RtlUnicodeStringKM", Test_RtlUnicodeString },
{ "SeInheritance", Test_SeInheritance },
{ "SeLogonSession", Test_SeLogonSession },
{ "SeQueryInfoToken", Test_SeQueryInfoToken },
{ "ZwAllocateVirtualMemory", Test_ZwAllocateVirtualMemory },
{ "ZwCreateSection", Test_ZwCreateSection },

View file

@ -0,0 +1,35 @@
/*
* PROJECT: ReactOS kernel-mode tests
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Kernel mode tests for logon session manipulation API
* COPYRIGHT: Copyright 2021 George Bișoc <george.bisoc@reactos.org>
*/
#include <kmt_test.h>
#include <ntifs.h>
#define IMAGINARY_LOGON {0x001, 0}
static
VOID
LogonMarkTermination(VOID)
{
NTSTATUS Status;
LUID SystemLogonID = SYSTEM_LUID;
LUID NonExistentLogonID = IMAGINARY_LOGON;
/* Mark the system authentication logon for termination */
Status = SeMarkLogonSessionForTerminationNotification(&SystemLogonID);
ok_irql(PASSIVE_LEVEL);
ok_eq_hex(Status, STATUS_SUCCESS);
/* We give a non existent logon */
Status = SeMarkLogonSessionForTerminationNotification(&NonExistentLogonID);
ok_irql(PASSIVE_LEVEL);
ok_eq_hex(Status, STATUS_NOT_FOUND);
}
START_TEST(SeLogonSession)
{
LogonMarkTermination();
}