Use free Windows DDK and compile with latest MinGW releases.
[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 #ifndef AS_INVOKED
24
25 extern POBJECT_TYPE SepTokenObjectType;
26
27 /* SID Authorities */
28 extern SID_IDENTIFIER_AUTHORITY SeNullSidAuthority;
29 extern SID_IDENTIFIER_AUTHORITY SeWorldSidAuthority;
30 extern SID_IDENTIFIER_AUTHORITY SeLocalSidAuthority;
31 extern SID_IDENTIFIER_AUTHORITY SeCreatorSidAuthority;
32 extern SID_IDENTIFIER_AUTHORITY SeNtSidAuthority;
33
34 /* SIDs */
35 extern PSID SeNullSid;
36 extern PSID SeWorldSid;
37 extern PSID SeLocalSid;
38 extern PSID SeCreatorOwnerSid;
39 extern PSID SeCreatorGroupSid;
40 extern PSID SeCreatorOwnerServerSid;
41 extern PSID SeCreatorGroupServerSid;
42 extern PSID SeNtAuthoritySid;
43 extern PSID SeDialupSid;
44 extern PSID SeNetworkSid;
45 extern PSID SeBatchSid;
46 extern PSID SeInteractiveSid;
47 extern PSID SeServiceSid;
48 extern PSID SeAnonymousLogonSid;
49 extern PSID SePrincipalSelfSid;
50 extern PSID SeLocalSystemSid;
51 extern PSID SeAuthenticatedUserSid;
52 extern PSID SeRestrictedCodeSid;
53 extern PSID SeAliasAdminsSid;
54 extern PSID SeAliasUsersSid;
55 extern PSID SeAliasGuestsSid;
56 extern PSID SeAliasPowerUsersSid;
57 extern PSID SeAliasAccountOpsSid;
58 extern PSID SeAliasSystemOpsSid;
59 extern PSID SeAliasPrintOpsSid;
60 extern PSID SeAliasBackupOpsSid;
61
62 /* Privileges */
63 extern LUID SeCreateTokenPrivilege;
64 extern LUID SeAssignPrimaryTokenPrivilege;
65 extern LUID SeLockMemoryPrivilege;
66 extern LUID SeIncreaseQuotaPrivilege;
67 extern LUID SeUnsolicitedInputPrivilege;
68 extern LUID SeTcbPrivilege;
69 extern LUID SeSecurityPrivilege;
70 extern LUID SeTakeOwnershipPrivilege;
71 extern LUID SeLoadDriverPrivilege;
72 extern LUID SeCreatePagefilePrivilege;
73 extern LUID SeIncreaseBasePriorityPrivilege;
74 extern LUID SeSystemProfilePrivilege;
75 extern LUID SeSystemtimePrivilege;
76 extern LUID SeProfileSingleProcessPrivilege;
77 extern LUID SeCreatePermanentPrivilege;
78 extern LUID SeBackupPrivilege;
79 extern LUID SeRestorePrivilege;
80 extern LUID SeShutdownPrivilege;
81 extern LUID SeDebugPrivilege;
82 extern LUID SeAuditPrivilege;
83 extern LUID SeSystemEnvironmentPrivilege;
84 extern LUID SeChangeNotifyPrivilege;
85 extern LUID SeRemoteShutdownPrivilege;
86
87 /* DACLs */
88 extern PACL SePublicDefaultUnrestrictedDacl;
89 extern PACL SePublicOpenDacl;
90 extern PACL SePublicOpenUnrestrictedDacl;
91 extern PACL SeUnrestrictedDacl;
92
93
94 /* Functions */
95
96 BOOLEAN SeInit1(VOID);
97 BOOLEAN SeInit2(VOID);
98
99 VOID SepInitLuid(VOID);
100 VOID SepInitPrivileges(VOID);
101 BOOLEAN SepInitSecurityIDs(VOID);
102 BOOLEAN SepInitDACLs(VOID);
103 BOOLEAN SepInitSDs(VOID);
104
105 VOID SepInitializeTokenImplementation(VOID);
106
107 NTSTATUS SepCreateSystemProcessToken(struct _EPROCESS* Process);
108 NTSTATUS SepInitializeNewProcess(struct _EPROCESS* NewProcess,
109 struct _EPROCESS* ParentProcess);
110
111 NTSTATUS SeExchangePrimaryToken(struct _EPROCESS* Process,
112 PIACCESS_TOKEN NewToken,
113 PIACCESS_TOKEN* OldTokenP);
114
115 NTSTATUS SeCaptureLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Src,
116 ULONG PrivilegeCount,
117 KPROCESSOR_MODE PreviousMode,
118 PLUID_AND_ATTRIBUTES AllocatedMem,
119 ULONG AllocatedLength,
120 POOL_TYPE PoolType,
121 ULONG d,
122 PLUID_AND_ATTRIBUTES* Dest,
123 PULONG Length);
124
125 NTSTATUS STDCALL
126 RtlCopySidAndAttributesArray(ULONG Count,
127 PSID_AND_ATTRIBUTES_ARRAY Src,
128 ULONG SidAreaSize,
129 PSID_AND_ATTRIBUTES_ARRAY Dest,
130 PVOID SidArea,
131 PVOID* RemainingSidArea,
132 PULONG RemainingSidAreaSize);
133
134 #endif /* !AS_INVOKED */
135
136 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_SE_H */
137
138 /* EOF */