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 <george.bisoc@reactos.org>
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 }
36