xref: /reactos/dll/win32/authz/authz.c (revision c2c66aff)
1 /*
2  * ReactOS Authorization Framework
3  * Copyright (C) 2005 - 2006 ReactOS Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 /*
20  * PROJECT:         ReactOS Authorization Framework
21  * FILE:            lib/authz/authz.c
22  * PURPOSE:         Authorization Framework
23  * PROGRAMMER:      Thomas Weidenmueller <w3seek@reactos.com>
24  *
25  * UPDATE HISTORY:
26  *      09/30/2005  Created
27  */
28 
29 #include "precomp.h"
30 
31 #define NDEBUG
32 #include <debug.h>
33 
34 HINSTANCE hDllInstance;
35 
36 /*
37  * @unimplemented
38  */
39 AUTHZAPI
40 BOOL
41 WINAPI
AuthzAccessCheck(IN DWORD flags,IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext,IN PAUTHZ_ACCESS_REQUEST pRequest,IN AUTHZ_AUDIT_INFO_HANDLE AuditInfo,IN PSECURITY_DESCRIPTOR pSecurityDescriptor,IN PSECURITY_DESCRIPTOR * OptionalSecurityDescriptorArray,IN DWORD OptionalSecurityDescriptorCount OPTIONAL,IN OUT PAUTHZ_ACCESS_REPLY pReply,OUT PAUTHZ_ACCESS_CHECK_RESULTS_HANDLE pAuthzHandle)42 AuthzAccessCheck(IN DWORD flags,
43                  IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext,
44                  IN PAUTHZ_ACCESS_REQUEST pRequest,
45                  IN AUTHZ_AUDIT_INFO_HANDLE AuditInfo,
46                  IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
47                  IN PSECURITY_DESCRIPTOR* OptionalSecurityDescriptorArray,
48                  IN DWORD OptionalSecurityDescriptorCount  OPTIONAL,
49                  IN OUT PAUTHZ_ACCESS_REPLY pReply,
50                  OUT PAUTHZ_ACCESS_CHECK_RESULTS_HANDLE pAuthzHandle)
51 {
52     UNIMPLEMENTED;
53     return FALSE;
54 }
55 
56 
57 /*
58  * @unimplemented
59  */
60 AUTHZAPI
61 BOOL
62 WINAPI
AuthzAddSidsToContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE OrigClientContext,IN PSID_AND_ATTRIBUTES Sids,IN DWORD SidCount,IN PSID_AND_ATTRIBUTES RestrictedSids,IN DWORD RestrictedSidCount,OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pNewClientContext)63 AuthzAddSidsToContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE OrigClientContext,
64                       IN PSID_AND_ATTRIBUTES Sids,
65                       IN DWORD SidCount,
66                       IN PSID_AND_ATTRIBUTES RestrictedSids,
67                       IN DWORD RestrictedSidCount,
68                       OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pNewClientContext)
69 {
70     UNIMPLEMENTED;
71     return FALSE;
72 }
73 
74 
75 /*
76  * @unimplemented
77  */
78 AUTHZAPI
79 BOOL
80 WINAPI
AuthzCachedAccessCheck(IN DWORD Flags,IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle,IN PAUTHZ_ACCESS_REQUEST pRequest,IN AUTHZ_AUDIT_EVENT_HANDLE AuditInfo,OUT PAUTHZ_ACCESS_REPLY pReply)81 AuthzCachedAccessCheck(IN DWORD Flags,
82                        IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle,
83                        IN PAUTHZ_ACCESS_REQUEST pRequest,
84                        IN AUTHZ_AUDIT_EVENT_HANDLE AuditInfo,
85                        OUT PAUTHZ_ACCESS_REPLY pReply)
86 {
87     UNIMPLEMENTED;
88     return FALSE;
89 }
90 
91 
92 /*
93  * @unimplemented
94  */
95 AUTHZAPI
96 BOOL
97 WINAPI
AuthzEnumerateSecurityEventSources(IN DWORD dwFlags,OUT PAUTHZ_SOURCE_SCHEMA_REGISTRATION Buffer,OUT PDWORD pdwCount,IN OUT PDWORD pdwLength)98 AuthzEnumerateSecurityEventSources(IN DWORD dwFlags,
99                                    OUT PAUTHZ_SOURCE_SCHEMA_REGISTRATION Buffer,
100                                    OUT PDWORD pdwCount,
101                                    IN OUT PDWORD pdwLength)
102 {
103     UNIMPLEMENTED;
104     return FALSE;
105 }
106 
107 
108 /*
109  * @unimplemented
110  */
111 AUTHZAPI
112 BOOL
113 WINAPI
AuthzFreeAuditEvent(IN AUTHZ_AUDIT_EVENT_HANDLE pAuditEventInfo)114 AuthzFreeAuditEvent(IN AUTHZ_AUDIT_EVENT_HANDLE pAuditEventInfo)
115 {
116     UNIMPLEMENTED;
117     return FALSE;
118 }
119 
120 
121 /*
122  * @unimplemented
123  */
124 AUTHZAPI
125 BOOL
126 WINAPI
AuthzFreeHandle(IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle)127 AuthzFreeHandle(IN AUTHZ_ACCESS_CHECK_RESULTS_HANDLE AuthzHandle)
128 {
129     UNIMPLEMENTED;
130     return FALSE;
131 }
132 
133 
134 /*
135  * @unimplemented
136  */
137 AUTHZAPI
138 BOOL
139 WINAPI
AuthzInitializeContextFromAuthzContext(IN DWORD flags,IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzHandle,IN PLARGE_INTEGER ExpirationTime,IN LUID Identifier,IN PVOID DynamicGroupArgs,OUT PAUTHZ_CLIENT_CONTEXT_HANDLE phNewAuthzHandle)140 AuthzInitializeContextFromAuthzContext(IN DWORD flags,
141                                        IN AUTHZ_CLIENT_CONTEXT_HANDLE AuthzHandle,
142                                        IN PLARGE_INTEGER ExpirationTime,
143                                        IN LUID Identifier,
144                                        IN PVOID DynamicGroupArgs,
145                                        OUT PAUTHZ_CLIENT_CONTEXT_HANDLE phNewAuthzHandle)
146 {
147     UNIMPLEMENTED;
148     return FALSE;
149 }
150 
151 
152 /*
153  * @unimplemented
154  */
155 AUTHZAPI
156 BOOL
157 WINAPI
AuthzInitializeContextFromToken(IN DWORD Flags,IN HANDLE TokenHandle,IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager,IN PLARGE_INTEGER pExpirationTime,IN LUID Identifier,IN PVOID DynamicGroupArgs,OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext)158 AuthzInitializeContextFromToken(IN DWORD Flags,
159                                 IN HANDLE TokenHandle,
160                                 IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager,
161                                 IN PLARGE_INTEGER pExpirationTime,
162                                 IN LUID Identifier,
163                                 IN PVOID DynamicGroupArgs,
164                                 OUT PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext)
165 {
166     UNIMPLEMENTED;
167     return FALSE;
168 }
169 
170 
171 /*
172  * @unimplemented
173  */
174 AUTHZAPI
175 BOOL
176 WINAPIV
AuthzInitializeObjectAccessAuditEvent(IN DWORD Flags,IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType,IN PWSTR szOperationType,IN PWSTR szObjectType,IN PWSTR szObjectName,IN PWSTR szAdditionalInfo,OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent,IN DWORD dwAdditionalParamCount,...)177 AuthzInitializeObjectAccessAuditEvent(IN DWORD Flags,
178                                       IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType,
179                                       IN PWSTR szOperationType,
180                                       IN PWSTR szObjectType,
181                                       IN PWSTR szObjectName,
182                                       IN PWSTR szAdditionalInfo,
183                                       OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent,
184                                       IN DWORD dwAdditionalParamCount,
185                                       ...)
186 {
187     UNIMPLEMENTED;
188     return FALSE;
189 }
190 
191 
192 /*
193  * @unimplemented
194  */
195 AUTHZAPI
196 BOOL
197 WINAPIV
AuthzInitializeObjectAccessAuditEvent2(IN DWORD Flags,IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType,IN PWSTR szOperationType,IN PWSTR szObjectType,IN PWSTR szObjectName,IN PWSTR szAdditionalInfo,IN PWSTR szAdditionalInfo2,OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent,IN DWORD dwAdditionalParameterCount,...)198 AuthzInitializeObjectAccessAuditEvent2(IN DWORD Flags,
199                                        IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType,
200                                        IN PWSTR szOperationType,
201                                        IN PWSTR szObjectType,
202                                        IN PWSTR szObjectName,
203                                        IN PWSTR szAdditionalInfo,
204                                        IN PWSTR szAdditionalInfo2,
205                                        OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent,
206                                        IN DWORD dwAdditionalParameterCount,
207                                        ...)
208 {
209     UNIMPLEMENTED;
210     return FALSE;
211 }
212 
213 
214 /*
215  * @unimplemented
216  */
217 AUTHZAPI
218 BOOL
219 WINAPI
AuthzInstallSecurityEventSource(IN DWORD dwFlags,IN PAUTHZ_SOURCE_SCHEMA_REGISTRATION pRegistration)220 AuthzInstallSecurityEventSource(IN DWORD dwFlags,
221                                 IN PAUTHZ_SOURCE_SCHEMA_REGISTRATION pRegistration)
222 {
223     UNIMPLEMENTED;
224     return FALSE;
225 }
226 
227 
228 /*
229  * @unimplemented
230  */
231 AUTHZAPI
232 BOOL
233 WINAPI
AuthzOpenObjectAudit(IN DWORD Flags,IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext,IN PAUTHZ_ACCESS_REQUEST pRequest,IN AUTHZ_AUDIT_EVENT_HANDLE hAuditEvent,IN PSECURITY_DESCRIPTOR pSecurityDescriptor,IN PSECURITY_DESCRIPTOR * SecurityDescriptorArray,IN DWORD SecurityDescriptorCount,OUT PAUTHZ_ACCESS_REPLY pReply)234 AuthzOpenObjectAudit(IN DWORD Flags,
235                      IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContext,
236                      IN PAUTHZ_ACCESS_REQUEST pRequest,
237                      IN AUTHZ_AUDIT_EVENT_HANDLE hAuditEvent,
238                      IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
239                      IN PSECURITY_DESCRIPTOR* SecurityDescriptorArray,
240                      IN DWORD SecurityDescriptorCount,
241                      OUT PAUTHZ_ACCESS_REPLY pReply)
242 {
243     UNIMPLEMENTED;
244     return FALSE;
245 }
246 
247 
248 /*
249  * @unimplemented
250  */
251 AUTHZAPI
252 BOOL
253 WINAPI
AuthzRegisterSecurityEventSource(IN DWORD dwFlags,IN PCWSTR szEventSourceName,IN PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider)254 AuthzRegisterSecurityEventSource(IN DWORD dwFlags,
255                                  IN PCWSTR szEventSourceName,
256                                  IN PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider)
257 {
258     UNIMPLEMENTED;
259     return FALSE;
260 }
261 
262 
263 /*
264  * @unimplemented
265  */
266 AUTHZAPI
267 BOOL
268 WINAPIV
AuthzReportSecurityEvent(IN DWORD dwFlags,IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider,IN DWORD dwAuditId,IN PSID pUserSid OPTIONAL,IN DWORD dwCount,...)269 AuthzReportSecurityEvent(IN DWORD dwFlags,
270                          IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider,
271                          IN DWORD dwAuditId,
272                          IN PSID pUserSid  OPTIONAL,
273                          IN DWORD dwCount,
274                          ...)
275 {
276     UNIMPLEMENTED;
277     return FALSE;
278 }
279 
280 
281 /*
282  * @unimplemented
283  */
284 AUTHZAPI
285 BOOL
286 WINAPI
AuthzReportSecurityEventFromParams(IN DWORD dwFlags,IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider,IN DWORD dwAuditId,IN PSID pUserSid OPTIONAL,IN PAUDIT_PARAMS pParams)287 AuthzReportSecurityEventFromParams(IN DWORD dwFlags,
288                                    IN AUTHZ_SECURITY_EVENT_PROVIDER_HANDLE hEventProvider,
289                                    IN DWORD dwAuditId,
290                                    IN PSID pUserSid  OPTIONAL,
291                                    IN PAUDIT_PARAMS pParams)
292 {
293     UNIMPLEMENTED;
294     return FALSE;
295 }
296 
297 
298 /*
299  * @unimplemented
300  */
301 AUTHZAPI
302 BOOL
303 WINAPI
AuthzUninstallSecurityEventSource(IN DWORD dwFlags,IN PWSTR szEventSourceName)304 AuthzUninstallSecurityEventSource(IN DWORD dwFlags,
305                                   IN PWSTR szEventSourceName)
306 {
307     UNIMPLEMENTED;
308     return FALSE;
309 }
310 
311 
312 /*
313  * @unimplemented
314  */
315 AUTHZAPI
316 BOOL
317 WINAPI
AuthzUnregisterSecurityEventSource(IN DWORD dwFlags,IN OUT PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider)318 AuthzUnregisterSecurityEventSource(IN DWORD dwFlags,
319                                    IN OUT PAUTHZ_SECURITY_EVENT_PROVIDER_HANDLE phEventProvider)
320 {
321     UNIMPLEMENTED;
322     return FALSE;
323 }
324 
325 
326 BOOL WINAPI
DllMain(IN HINSTANCE hinstDLL,IN DWORD dwReason,IN LPVOID lpvReserved)327 DllMain(IN HINSTANCE hinstDLL,
328         IN DWORD dwReason,
329         IN LPVOID lpvReserved)
330 {
331     switch (dwReason)
332     {
333         case DLL_PROCESS_ATTACH:
334             hDllInstance = hinstDLL;
335             break;
336 
337         case DLL_THREAD_ATTACH:
338         case DLL_THREAD_DETACH:
339         case DLL_PROCESS_DETACH:
340             break;
341     }
342     return TRUE;
343 }
344 
345