:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / 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
93 /* Functions */
94
95 BOOLEAN SeInit1(VOID);
96 BOOLEAN SeInit2(VOID);
97
98 VOID SepInitLuid(VOID);
99 VOID SepInitPrivileges(VOID);
100 BOOLEAN SepInitSecurityIDs(VOID);
101 BOOLEAN SepInitDACLs(VOID);
102 BOOLEAN SepInitSDs(VOID);
103
104 VOID SepInitializeTokenImplementation(VOID);
105
106 NTSTATUS SepCreateSystemProcessToken(struct _EPROCESS* Process);
107 NTSTATUS SepInitializeNewProcess(struct _EPROCESS* NewProcess,
108                                                                  struct _EPROCESS* ParentProcess);
109
110 NTSTATUS SeExchangePrimaryToken(struct _EPROCESS* Process,
111                                 PACCESS_TOKEN NewToken,
112                                 PACCESS_TOKEN* OldTokenP);
113
114 NTSTATUS SeCaptureLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Src,
115                                          ULONG PrivilegeCount,
116                                          KPROCESSOR_MODE PreviousMode,
117                                          PLUID_AND_ATTRIBUTES AllocatedMem,
118                                          ULONG AllocatedLength,
119                                          POOL_TYPE PoolType,
120                                          ULONG d,
121                                          PLUID_AND_ATTRIBUTES* Dest,
122                                          PULONG Length);
123
124
125 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_SE_H */
126
127 /* EOF */