758c4bc0266d61a9af677b91b99947cbfc869fce
[reactos.git] / rostests / kmtests / ntos_se / se.h
1 /*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite Se helper declarations
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8 #ifndef _KMTEST_SE_H_
9 #define _KMTEST_SE_H_
10
11 /* FIXME: belongs in ntifs.h or something */
12 #define SEF_DACL_AUTO_INHERIT 1
13 #define SEF_SACL_AUTO_INHERIT 2
14 #define SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT 4
15 #define SEF_AVOID_PRIVILEGE_CHECK 8
16 #define SEF_AVOID_OWNER_CHECK 16
17 #define SEF_DEFAULT_OWNER_FROM_PARENT 32
18 #define SEF_DEFAULT_GROUP_FROM_PARENT 64
19 #define SEF_MACL_NO_WRITE_UP 256
20 #define SEF_MACL_NO_READ_UP 512
21 #define SEF_MACL_NO_EXECUTE_UP 1024
22 #define SEF_AI_USE_EXTRA_PARAMS 2048
23 #define SEF_AVOID_OWNER_RESTRICTION 4096
24 #define SEF_MACL_VALID_FLAGS (SEF_MACL_NO_WRITE_UP | SEF_MACL_NO_READ_UP | SEF_MACL_NO_EXECUTE_UP)
25
26 NTSTATUS
27 RtlxAddAuditAccessAceEx(
28 _Inout_ PACL Acl,
29 _In_ ULONG Revision,
30 _In_ ULONG Flags,
31 _In_ ACCESS_MASK AccessMask,
32 _In_ PSID Sid,
33 _In_ BOOLEAN Success,
34 _In_ BOOLEAN Failure);
35
36 #define NO_SIZE ((ULONG)-1)
37
38 #define CheckSid(Sid, SidSize, ExpectedSid) CheckSid_(Sid, SidSize, ExpectedSid, __FILE__, __LINE__)
39 #define CheckSid_(Sid, SidSize, ExpectedSid, file, line) CheckSid__(Sid, SidSize, ExpectedSid, file ":" KMT_STRINGIZE(line))
40 VOID
41 CheckSid__(
42 _In_ PSID Sid,
43 _In_ ULONG SidSize,
44 _In_ PISID ExpectedSid,
45 _In_ PCSTR FileAndLine);
46
47 VOID
48 VCheckAcl__(
49 _In_ PACL Acl,
50 _In_ ULONG AceCount,
51 _In_ PCSTR FileAndLine,
52 _In_ va_list Arguments);
53
54 #define CheckAcl(Acl, AceCount, ...) CheckAcl_(Acl, AceCount, __FILE__, __LINE__, ##__VA_ARGS__)
55 #define CheckAcl_(Acl, AceCount, file, line, ...) CheckAcl__(Acl, AceCount, file ":" KMT_STRINGIZE(line), ##__VA_ARGS__)
56 VOID
57 CheckAcl__(
58 _In_ PACL Acl,
59 _In_ ULONG AceCount,
60 _In_ PCSTR FileAndLine,
61 ...);
62
63 #endif /* !defined _KMTEST_SE_H_ */