f98ccaacaf826e08c5cf33879eb44844006d1a10
[reactos.git] / reactos / ntoskrnl / include / internal / se.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_SE_H
21 #define __NTOSKRNL_INCLUDE_INTERNAL_SE_H
22
23
24 extern POBJECT_TYPE SepTokenObjectType;
25
26 /* SID Authorities */
27 extern SID_IDENTIFIER_AUTHORITY SeNullSidAuthority;
28 extern SID_IDENTIFIER_AUTHORITY SeWorldSidAuthority;
29 extern SID_IDENTIFIER_AUTHORITY SeLocalSidAuthority;
30 extern SID_IDENTIFIER_AUTHORITY SeCreatorSidAuthority;
31 extern SID_IDENTIFIER_AUTHORITY SeNtSidAuthority;
32
33 /* SIDs */
34 extern PSID SeNullSid;
35 extern PSID SeWorldSid;
36 extern PSID SeLocalSid;
37 extern PSID SeCreatorOwnerSid;
38 extern PSID SeCreatorGroupSid;
39 extern PSID SeCreatorOwnerServerSid;
40 extern PSID SeCreatorGroupServerSid;
41 extern PSID SeNtAuthoritySid;
42 extern PSID SeDialupSid;
43 extern PSID SeNetworkSid;
44 extern PSID SeBatchSid;
45 extern PSID SeInteractiveSid;
46 extern PSID SeServiceSid;
47 extern PSID SeAnonymousLogonSid;
48 extern PSID SePrincipalSelfSid;
49 extern PSID SeLocalSystemSid;
50 extern PSID SeAuthenticatedUserSid;
51 extern PSID SeRestrictedCodeSid;
52 extern PSID SeAliasAdminsSid;
53 extern PSID SeAliasUsersSid;
54 extern PSID SeAliasGuestsSid;
55 extern PSID SeAliasPowerUsersSid;
56 extern PSID SeAliasAccountOpsSid;
57 extern PSID SeAliasSystemOpsSid;
58 extern PSID SeAliasPrintOpsSid;
59 extern PSID SeAliasBackupOpsSid;
60
61 /* Privileges */
62 extern LUID SeCreateTokenPrivilege;
63 extern LUID SeAssignPrimaryTokenPrivilege;
64 extern LUID SeLockMemoryPrivilege;
65 extern LUID SeIncreaseQuotaPrivilege;
66 extern LUID SeUnsolicitedInputPrivilege;
67 extern LUID SeTcbPrivilege;
68 extern LUID SeSecurityPrivilege;
69 extern LUID SeTakeOwnershipPrivilege;
70 extern LUID SeLoadDriverPrivilege;
71 extern LUID SeCreatePagefilePrivilege;
72 extern LUID SeIncreaseBasePriorityPrivilege;
73 extern LUID SeSystemProfilePrivilege;
74 extern LUID SeSystemtimePrivilege;
75 extern LUID SeProfileSingleProcessPrivilege;
76 extern LUID SeCreatePermanentPrivilege;
77 extern LUID SeBackupPrivilege;
78 extern LUID SeRestorePrivilege;
79 extern LUID SeShutdownPrivilege;
80 extern LUID SeDebugPrivilege;
81 extern LUID SeAuditPrivilege;
82 extern LUID SeSystemEnvironmentPrivilege;
83 extern LUID SeChangeNotifyPrivilege;
84 extern LUID SeRemoteShutdownPrivilege;
85
86 /* DACLs */
87 extern PACL SePublicDefaultUnrestrictedDacl;
88 extern PACL SePublicOpenDacl;
89 extern PACL SePublicOpenUnrestrictedDacl;
90 extern PACL SeUnrestrictedDacl;
91
92 /* SDs */
93 extern PSECURITY_DESCRIPTOR SePublicDefaultSd;
94 extern PSECURITY_DESCRIPTOR SePublicDefaultUnrestrictedSd;
95 extern PSECURITY_DESCRIPTOR SePublicOpenSd;
96 extern PSECURITY_DESCRIPTOR SePublicOpenUnrestrictedSd;
97 extern PSECURITY_DESCRIPTOR SeSystemDefaultSd;
98 extern PSECURITY_DESCRIPTOR SeUnrestrictedSd;
99
100
101 /* Functions */
102
103 BOOLEAN SeInit1(VOID);
104 BOOLEAN SeInit2(VOID);
105 BOOLEAN SeInitSRM(VOID);
106
107 VOID SepInitLuid(VOID);
108 VOID SepInitPrivileges(VOID);
109 BOOLEAN SepInitSecurityIDs(VOID);
110 BOOLEAN SepInitDACLs(VOID);
111 BOOLEAN SepInitSDs(VOID);
112
113 VOID SepInitializeTokenImplementation(VOID);
114
115 NTSTATUS SepCreateSystemProcessToken(struct _EPROCESS* Process);
116 NTSTATUS SepInitializeNewProcess(struct _EPROCESS* NewProcess,
117 struct _EPROCESS* ParentProcess);
118
119 NTSTATUS SeExchangePrimaryToken(struct _EPROCESS* Process,
120 PACCESS_TOKEN NewToken,
121 PACCESS_TOKEN* OldTokenP);
122
123 NTSTATUS
124 SeCaptureLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Src,
125 ULONG PrivilegeCount,
126 KPROCESSOR_MODE PreviousMode,
127 PLUID_AND_ATTRIBUTES AllocatedMem,
128 ULONG AllocatedLength,
129 POOL_TYPE PoolType,
130 ULONG d,
131 PLUID_AND_ATTRIBUTES* Dest,
132 PULONG Length);
133
134 VOID
135 SeReleaseLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Privilege,
136 KPROCESSOR_MODE PreviousMode,
137 ULONG a);
138
139
140 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_SE_H */
141
142 /* EOF */