Remove ALL stubs which might be of questionable origin.
[reactos.git] / reactos / lib / advapi32 / sec / ac.c
1 /* $Id: ac.c,v 1.9 2004/02/25 14:25:11 ekohl Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/advapi32/sec/ac.c
6 * PURPOSE: ACL/ACE functions
7 */
8
9 #define NTOS_MODE_USER
10 #include <ntos.h>
11 #include <windows.h>
12
13
14 /* --- ACL --- */
15
16 /*
17 * @implemented
18 */
19 BOOL
20 STDCALL
21 GetAclInformation (
22 PACL pAcl,
23 LPVOID pAclInformation,
24 DWORD nAclInformationLength,
25 ACL_INFORMATION_CLASS dwAclInformationClass
26 )
27 {
28 NTSTATUS Status;
29
30 Status = RtlQueryInformationAcl (pAcl,
31 pAclInformation,
32 nAclInformationLength,
33 dwAclInformationClass);
34 if (!NT_SUCCESS(Status))
35 {
36 SetLastError (RtlNtStatusToDosError (Status));
37 return FALSE;
38 }
39
40 return TRUE;
41 }
42
43
44 /*
45 * @implemented
46 */
47 BOOL
48 STDCALL
49 InitializeAcl (
50 PACL pAcl,
51 DWORD nAclLength,
52 DWORD dwAclRevision
53 )
54 {
55 NTSTATUS Status;
56
57 Status = RtlCreateAcl (pAcl,
58 nAclLength,
59 dwAclRevision);
60 if (!NT_SUCCESS(Status))
61 {
62 SetLastError (RtlNtStatusToDosError (Status));
63 return FALSE;
64 }
65
66 return TRUE;
67 }
68
69
70 /*
71 * @implemented
72 */
73 BOOL
74 STDCALL
75 IsValidAcl (
76 PACL pAcl
77 )
78 {
79 return RtlValidAcl (pAcl);
80 }
81
82
83 /*
84 * @implemented
85 */
86 BOOL
87 STDCALL
88 SetAclInformation (
89 PACL pAcl,
90 LPVOID pAclInformation,
91 DWORD nAclInformationLength,
92 ACL_INFORMATION_CLASS dwAclInformationClass
93 )
94 {
95 NTSTATUS Status;
96
97 Status = RtlSetInformationAcl (pAcl,
98 pAclInformation,
99 nAclInformationLength,
100 dwAclInformationClass);
101 if (!NT_SUCCESS(Status))
102 {
103 SetLastError (RtlNtStatusToDosError (Status));
104 return FALSE;
105 }
106
107 return TRUE;
108 }
109
110
111 /* --- ACE --- */
112
113 /*
114 * @implemented
115 */
116 BOOL
117 STDCALL
118 AddAccessAllowedAce (
119 PACL pAcl,
120 DWORD dwAceRevision,
121 DWORD AccessMask,
122 PSID pSid
123 )
124 {
125 NTSTATUS Status;
126
127 Status = RtlAddAccessAllowedAce (pAcl,
128 dwAceRevision,
129 AccessMask,
130 pSid);
131 if (!NT_SUCCESS(Status))
132 {
133 SetLastError (RtlNtStatusToDosError (Status));
134 return FALSE;
135 }
136
137 return TRUE;
138 }
139
140
141 /*
142 * @implemented
143 */
144 BOOL
145 STDCALL
146 AddAccessDeniedAce (
147 PACL pAcl,
148 DWORD dwAceRevision,
149 DWORD AccessMask,
150 PSID pSid
151 )
152 {
153 NTSTATUS Status;
154
155 Status = RtlAddAccessDeniedAce (pAcl,
156 dwAceRevision,
157 AccessMask,
158 pSid);
159 if (!NT_SUCCESS(Status))
160 {
161 SetLastError (RtlNtStatusToDosError (Status));
162 return FALSE;
163 }
164
165 return TRUE;
166 }
167
168
169 /*
170 * @implemented
171 */
172 BOOL
173 STDCALL
174 AddAce (
175 PACL pAcl,
176 DWORD dwAceRevision,
177 DWORD dwStartingAceIndex,
178 LPVOID pAceList,
179 DWORD nAceListLength
180 )
181 {
182 NTSTATUS Status;
183
184 Status = RtlAddAce (pAcl,
185 dwAceRevision,
186 dwStartingAceIndex,
187 pAceList,
188 nAceListLength);
189 if (!NT_SUCCESS(Status))
190 {
191 SetLastError (RtlNtStatusToDosError (Status));
192 return FALSE;
193 }
194
195 return TRUE;
196 }
197
198
199 /*
200 * @implemented
201 */
202 BOOL
203 STDCALL
204 AddAuditAccessAce (
205 PACL pAcl,
206 DWORD dwAceRevision,
207 DWORD dwAccessMask,
208 PSID pSid,
209 BOOL bAuditSuccess,
210 BOOL bAuditFailure
211 )
212 {
213 NTSTATUS Status;
214
215 Status = RtlAddAuditAccessAce (pAcl,
216 dwAceRevision,
217 dwAccessMask,
218 pSid,
219 bAuditSuccess,
220 bAuditFailure);
221 if (!NT_SUCCESS(Status))
222 {
223 SetLastError (RtlNtStatusToDosError (Status));
224 return FALSE;
225 }
226
227 return TRUE;
228 }
229
230
231 /*
232 * @implemented
233 */
234 BOOL
235 STDCALL
236 DeleteAce (
237 PACL pAcl,
238 DWORD dwAceIndex
239 )
240 {
241 NTSTATUS Status;
242
243 Status = RtlDeleteAce (pAcl,
244 dwAceIndex);
245 if (!NT_SUCCESS(Status))
246 {
247 SetLastError (RtlNtStatusToDosError (Status));
248 return FALSE;
249 }
250
251 return TRUE;
252 }
253
254
255 /*
256 * @implemented
257 */
258 BOOL
259 STDCALL
260 FindFirstFreeAce (
261 PACL pAcl,
262 LPVOID * pAce
263 )
264 {
265 return RtlFirstFreeAce (pAcl,
266 (PACE*)pAce);
267 }
268
269
270 /*
271 * @implemented
272 */
273 BOOL
274 STDCALL
275 GetAce (
276 PACL pAcl,
277 DWORD dwAceIndex,
278 LPVOID * pAce
279 )
280 {
281 NTSTATUS Status;
282
283 Status = RtlGetAce (pAcl,
284 dwAceIndex,
285 (PACE*)pAce);
286 if (!NT_SUCCESS(Status))
287 {
288 SetLastError (RtlNtStatusToDosError (Status));
289 return FALSE;
290 }
291
292 return TRUE;
293 }
294
295 /* EOF */