Skip to content

Commit 32a45ce

Browse files
committed
[KMTESTS:SE] Implement initial logon session tests
This implements tests for SeMarkLogonSessionForTerminationNotification exported routine so far.
1 parent 506cee3 commit 32a45ce

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

modules/rostests/kmtests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ list(APPEND KMTEST_DRV_SOURCE
9696
ntos_ps/PsNotify.c
9797
ntos_se/SeHelpers.c
9898
ntos_se/SeInheritance.c
99+
ntos_se/SeLogonSession.c
99100
ntos_se/SeQueryInfoToken.c
100101
rtl/RtlIsValidOemCharacter.c
101102
rtl/RtlRangeList.c

modules/rostests/kmtests/kmtest_drv/testlist.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ KMT_TESTFUNC Test_ObTypeNoClean;
6464
KMT_TESTFUNC Test_ObTypes;
6565
KMT_TESTFUNC Test_PsNotify;
6666
KMT_TESTFUNC Test_SeInheritance;
67+
KMT_TESTFUNC Test_SeLogonSession;
6768
KMT_TESTFUNC Test_SeQueryInfoToken;
6869
KMT_TESTFUNC Test_RtlAvlTree;
6970
KMT_TESTFUNC Test_RtlException;
@@ -152,6 +153,7 @@ const KMT_TEST TestList[] =
152153
{ "RtlStrSafeKM", Test_RtlStrSafe },
153154
{ "RtlUnicodeStringKM", Test_RtlUnicodeString },
154155
{ "SeInheritance", Test_SeInheritance },
156+
{ "SeLogonSession", Test_SeLogonSession },
155157
{ "SeQueryInfoToken", Test_SeQueryInfoToken },
156158
{ "ZwAllocateVirtualMemory", Test_ZwAllocateVirtualMemory },
157159
{ "ZwCreateSection", Test_ZwCreateSection },
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* PROJECT: ReactOS kernel-mode tests
3+
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4+
* PURPOSE: Kernel mode tests for logon session manipulation API
5+
* COPYRIGHT: Copyright 2021 George Bișoc <[email protected]>
6+
*/
7+
8+
#include <kmt_test.h>
9+
#include <ntifs.h>
10+
11+
#define IMAGINARY_LOGON {0x001, 0}
12+
13+
static
14+
VOID
15+
LogonMarkTermination(VOID)
16+
{
17+
NTSTATUS Status;
18+
LUID SystemLogonID = SYSTEM_LUID;
19+
LUID NonExistentLogonID = IMAGINARY_LOGON;
20+
21+
/* Mark the system authentication logon for termination */
22+
Status = SeMarkLogonSessionForTerminationNotification(&SystemLogonID);
23+
ok_irql(PASSIVE_LEVEL);
24+
ok_eq_hex(Status, STATUS_SUCCESS);
25+
26+
/* We give a non existent logon */
27+
Status = SeMarkLogonSessionForTerminationNotification(&NonExistentLogonID);
28+
ok_irql(PASSIVE_LEVEL);
29+
ok_eq_hex(Status, STATUS_NOT_FOUND);
30+
}
31+
32+
START_TEST(SeLogonSession)
33+
{
34+
LogonMarkTermination();
35+
}

0 commit comments

Comments
 (0)