ReactOS  0.4.14-dev-317-g96040ec
ac.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: lib/advapi32/sec/ac.c
5  * PURPOSE: ACL/ACE functions
6  */
7 
8 #include <advapi32.h>
10 
11 /* --- ACE --- */
12 
13 /*
14  * @implemented
15  */
16 BOOL
17 WINAPI
22  GUID *ObjectTypeGuid,
23  GUID *InheritedObjectTypeGuid,
24  PSID pSid)
25 {
27 
30  AceFlags,
31  AccessMask,
32  ObjectTypeGuid,
33  InheritedObjectTypeGuid,
34  pSid);
35  if (!NT_SUCCESS(Status))
36  {
38  return FALSE;
39  }
40 
41  return TRUE;
42 }
43 
44 /*
45  * @implemented
46  */
47 BOOL
48 WINAPI
53  GUID* ObjectTypeGuid,
54  GUID* InheritedObjectTypeGuid,
55  PSID pSid)
56 {
58 
61  AceFlags,
62  AccessMask,
63  ObjectTypeGuid,
64  InheritedObjectTypeGuid,
65  pSid);
66  if (!NT_SUCCESS(Status))
67  {
69  return FALSE;
70  }
71 
72  return TRUE;
73 }
74 
75 /*
76  * @implemented
77  */
78 BOOL
79 WINAPI
84  GUID *ObjectTypeGuid,
85  GUID *InheritedObjectTypeGuid,
86  PSID pSid,
87  BOOL bAuditSuccess,
88  BOOL bAuditFailure)
89 {
91 
94  AceFlags,
95  AccessMask,
96  ObjectTypeGuid,
97  InheritedObjectTypeGuid,
98  pSid,
99  bAuditSuccess,
100  bAuditFailure);
101  if (!NT_SUCCESS(Status))
102  {
104  return FALSE;
105  }
106 
107  return TRUE;
108 }
109 
110 /*
111  * @implemented
112  */
113 DWORD
114 WINAPI
117  SECURITY_INFORMATION SecurityInfo,
118  BOOL Container,
119  GUID **pObjectClassGuids OPTIONAL,
120  DWORD GuidCount,
121  PACL pAcl,
123  PGENERIC_MAPPING pGenericMapping,
124  PINHERITED_FROMW pInheritArray)
125 {
127 
129  if (ErrorCode == ERROR_SUCCESS)
130  {
131  /* call the MARTA provider */
132  ErrorCode = AccGetInheritanceSource(pObjectName,
133  ObjectType,
134  SecurityInfo,
135  Container,
136  pObjectClassGuids,
137  GuidCount,
138  pAcl,
139  pfnArray,
140  pGenericMapping,
141  pInheritArray);
142  }
143 
144  return ErrorCode;
145 }
146 
147 
148 /*
149  * @unimplemented
150  */
151 DWORD
152 WINAPI
155  SECURITY_INFORMATION SecurityInfo,
156  BOOL Container,
157  GUID **pObjectClassGuids OPTIONAL,
158  DWORD GuidCount,
159  PACL pAcl,
161  PGENERIC_MAPPING pGenericMapping,
162  PINHERITED_FROMA pInheritArray)
163 {
164  /* That's all this function does, at least up to w2k3... Even MS was too
165  lazy to implement it... */
167 }
168 
169 
170 /*
171  * @implemented
172  */
173 DWORD
174 WINAPI
175 FreeInheritedFromArray(PINHERITED_FROMW pInheritArray,
176  USHORT AceCnt,
178 {
180 
182  if (ErrorCode == ERROR_SUCCESS)
183  {
184  /* call the MARTA provider */
185  ErrorCode = AccFreeIndexArray(pInheritArray,
186  AceCnt,
187  pfnArray);
188  }
189 
190  return ErrorCode;
191 }
192 
193 
194 /*
195  * @implemented
196  */
197 DWORD
198 WINAPI
199 SetEntriesInAclW(ULONG cCountOfExplicitEntries,
200  PEXPLICIT_ACCESS_W pListOfExplicitEntries,
201  PACL OldAcl,
202  PACL *NewAcl)
203 {
205 
206  if (!NewAcl)
207  {
209  }
210 
212  if (ErrorCode == ERROR_SUCCESS)
213  {
214  /* call the MARTA provider */
215  ErrorCode = AccRewriteSetEntriesInAcl(cCountOfExplicitEntries,
216  pListOfExplicitEntries,
217  OldAcl,
218  NewAcl);
219  }
220 
221  return ErrorCode;
222 }
223 
224 
225 static DWORD
227  OUT PTRUSTEE_W *pTrusteeW)
228 {
229  TRUSTEE_FORM TrusteeForm;
230  INT BufferSize = 0;
231  PSTR lpStr;
233 
234  //ASSERT(sizeof(TRUSTEE_W) == sizeof(TRUSTEE_A));
235 
236  TrusteeForm = GetTrusteeFormA(pTrusteeA);
237  switch (TrusteeForm)
238  {
239  case TRUSTEE_IS_NAME:
240  {
241  /* directly copy the array, this works as the size of the EXPLICIT_ACCESS_A
242  structure matches the size of the EXPLICIT_ACCESS_W version */
243  lpStr = GetTrusteeNameA(pTrusteeA);
244  if (lpStr != NULL)
245  BufferSize = strlen(lpStr) + 1;
246 
247  *pTrusteeW = RtlAllocateHeap(RtlGetProcessHeap(),
248  0,
249  sizeof(TRUSTEE_W) + (BufferSize * sizeof(WCHAR)));
250  if (*pTrusteeW != NULL)
251  {
252  RtlCopyMemory(*pTrusteeW,
253  pTrusteeA,
255  ptstrName));
256 
257  if (lpStr != NULL)
258  {
259  (*pTrusteeW)->ptstrName = (PWSTR)((*pTrusteeW) + 1);
260 
261  /* convert the trustee's name */
263  0,
264  lpStr,
265  -1,
266  (*pTrusteeW)->ptstrName,
267  BufferSize) == 0)
268  {
269  goto ConvertErr;
270  }
271  }
272  else
273  {
274  RtlFreeHeap(RtlGetProcessHeap(),
275  0,
276  *pTrusteeW);
277  goto NothingToConvert;
278  }
279  }
280  else
282  break;
283  }
284 
286  {
289  PWSTR StrBuf;
290 
291  /* calculate the size needed */
293  oanA->InheritedObjectTypeName != NULL)
294  {
296  }
297  if (oanA->ptstrName != NULL)
298  {
299  BufferSize += strlen(oanA->ptstrName) + 1;
300  }
301 
302  *pTrusteeW = RtlAllocateHeap(RtlGetProcessHeap(),
303  0,
304  sizeof(TRUSTEE_W) + sizeof(OBJECTS_AND_NAME_W) +
305  (BufferSize * sizeof(WCHAR)));
306 
307  if (*pTrusteeW != NULL)
308  {
309  oan = (POBJECTS_AND_NAME_W)((*pTrusteeW) + 1);
310  StrBuf = (PWSTR)(oan + 1);
311 
312  /* copy over the parts of the TRUSTEE structure that don't need
313  to be touched */
314  RtlCopyMemory(*pTrusteeW,
315  pTrusteeA,
317  ptstrName));
318 
319  (*pTrusteeW)->ptstrName = (LPWSTR)oan;
320 
321  /* convert the OBJECTS_AND_NAME_A structure */
322  oan->ObjectsPresent = oanA->ObjectsPresent;
323  oan->ObjectType = oanA->ObjectType;
324 
326  oanA->InheritedObjectTypeName != NULL)
327  {
328  /* convert inherited object type name */
330 
332  0,
334  -1,
335  StrBuf,
336  BufferSize) == 0)
337  {
338  goto ConvertErr;
339  }
340  oan->InheritedObjectTypeName = StrBuf;
341 
342  StrBuf += BufferSize;
343  }
344  else
346 
347  if (oanA->ptstrName != NULL)
348  {
349  /* convert the trustee name */
350  BufferSize = strlen(oanA->ptstrName) + 1;
351 
353  0,
354  oanA->ptstrName,
355  -1,
356  StrBuf,
357  BufferSize) == 0)
358  {
359  goto ConvertErr;
360  }
361  oan->ptstrName = StrBuf;
362  }
363  else
364  oan->ptstrName = NULL;
365  }
366  else
368  break;
369  }
370 
371  default:
372  {
373 NothingToConvert:
374  /* no need to convert anything to unicode */
375  *pTrusteeW = (PTRUSTEE_W)pTrusteeA;
376  break;
377  }
378  }
379 
380  return ErrorCode;
381 
382 ConvertErr:
384 
385  /* cleanup */
386  RtlFreeHeap(RtlGetProcessHeap(),
387  0,
388  *pTrusteeW);
389 
390  return ErrorCode;
391 }
392 
393 
394 static __inline VOID
396  IN PTRUSTEE_A pTrusteeA)
397 {
398  if ((PVOID)pTrusteeW != (PVOID)pTrusteeA)
399  {
400  RtlFreeHeap(RtlGetProcessHeap(),
401  0,
402  pTrusteeW);
403  }
404 }
405 
406 
407 static DWORD
408 InternalExplicitAccessAToW(IN ULONG cCountOfExplicitEntries,
409  IN PEXPLICIT_ACCESS_A pListOfExplicitEntriesA,
410  OUT PEXPLICIT_ACCESS_W *pListOfExplicitEntriesW)
411 {
412  TRUSTEE_FORM TrusteeForm;
413  SIZE_T Size;
414  ULONG i;
415  ULONG ObjectsAndNameCount = 0;
416  PEXPLICIT_ACCESS_W peaw = NULL;
418  LPSTR lpStr;
419 
420  /* NOTE: This code assumes that the size of the TRUSTEE_A and TRUSTEE_W structure matches! */
421  //ASSERT(sizeof(TRUSTEE_A) == sizeof(TRUSTEE_W));
422 
423  if (cCountOfExplicitEntries != 0)
424  {
425  /* calculate the size needed */
426  Size = cCountOfExplicitEntries * sizeof(EXPLICIT_ACCESS_W);
427  for (i = 0; i != cCountOfExplicitEntries; i++)
428  {
429  TrusteeForm = GetTrusteeFormA(&pListOfExplicitEntriesA[i].Trustee);
430 
431  switch (TrusteeForm)
432  {
433  case TRUSTEE_IS_NAME:
434  {
435  lpStr = GetTrusteeNameA(&pListOfExplicitEntriesA[i].Trustee);
436  if (lpStr != NULL)
437  Size += (strlen(lpStr) + 1) * sizeof(WCHAR);
438  break;
439  }
440 
442  {
443  POBJECTS_AND_NAME_A oan = (POBJECTS_AND_NAME_A)GetTrusteeNameA(&pListOfExplicitEntriesA[i].Trustee);
444 
447  {
448  Size += (strlen(oan->InheritedObjectTypeName) + 1) * sizeof(WCHAR);
449  }
450 
451  if (oan->ptstrName != NULL)
452  Size += (strlen(oan->ptstrName) + 1) * sizeof(WCHAR);
453 
454  ObjectsAndNameCount++;
455  break;
456  }
457 
458  default:
459  break;
460  }
461  }
462 
463  /* allocate the array */
464  peaw = RtlAllocateHeap(RtlGetProcessHeap(),
465  0,
466  Size);
467  if (peaw != NULL)
468  {
469  INT BufferSize;
470  POBJECTS_AND_NAME_W oan = (POBJECTS_AND_NAME_W)(peaw + cCountOfExplicitEntries);
471  LPWSTR StrBuf = (LPWSTR)(oan + ObjectsAndNameCount);
472 
473  /* convert the array to unicode */
474  for (i = 0; i != cCountOfExplicitEntries; i++)
475  {
476  peaw[i].grfAccessPermissions = pListOfExplicitEntriesA[i].grfAccessPermissions;
477  peaw[i].grfAccessMode = pListOfExplicitEntriesA[i].grfAccessMode;
478  peaw[i].grfInheritance = pListOfExplicitEntriesA[i].grfInheritance;
479 
480  /* convert or copy the TRUSTEE structure */
481  TrusteeForm = GetTrusteeFormA(&pListOfExplicitEntriesA[i].Trustee);
482  switch (TrusteeForm)
483  {
484  case TRUSTEE_IS_NAME:
485  {
486  lpStr = GetTrusteeNameA(&pListOfExplicitEntriesA[i].Trustee);
487  if (lpStr != NULL)
488  {
489  /* convert the trustee name */
490  BufferSize = strlen(lpStr) + 1;
491 
493  0,
494  lpStr,
495  -1,
496  StrBuf,
497  BufferSize) == 0)
498  {
499  goto ConvertErr;
500  }
501  peaw[i].Trustee.ptstrName = StrBuf;
502 
503  StrBuf += BufferSize;
504  }
505  else
506  goto RawTrusteeCopy;
507 
508  break;
509  }
510 
512  {
513  POBJECTS_AND_NAME_A oanA = (POBJECTS_AND_NAME_A)GetTrusteeNameA(&pListOfExplicitEntriesA[i].Trustee);
514 
515  /* copy over the parts of the TRUSTEE structure that don't need
516  to be touched */
517  RtlCopyMemory(&peaw[i].Trustee,
518  &pListOfExplicitEntriesA[i].Trustee,
520  ptstrName));
521 
522  peaw[i].Trustee.ptstrName = (LPWSTR)oan;
523 
524  /* convert the OBJECTS_AND_NAME_A structure */
525  oan->ObjectsPresent = oanA->ObjectsPresent;
526  oan->ObjectType = oanA->ObjectType;
527 
529  oanA->InheritedObjectTypeName != NULL)
530  {
531  /* convert inherited object type name */
533 
535  0,
537  -1,
538  StrBuf,
539  BufferSize) == 0)
540  {
541  goto ConvertErr;
542  }
543  oan->InheritedObjectTypeName = StrBuf;
544 
545  StrBuf += BufferSize;
546  }
547  else
549 
550  if (oanA->ptstrName != NULL)
551  {
552  /* convert the trustee name */
553  BufferSize = strlen(oanA->ptstrName) + 1;
554 
556  0,
557  oanA->ptstrName,
558  -1,
559  StrBuf,
560  BufferSize) == 0)
561  {
562  goto ConvertErr;
563  }
564  oan->ptstrName = StrBuf;
565 
566  StrBuf += BufferSize;
567  }
568  else
569  oan->ptstrName = NULL;
570 
571  /* move on to the next OBJECTS_AND_NAME_A structure */
572  oan++;
573  break;
574  }
575 
576  default:
577  {
578 RawTrusteeCopy:
579  /* just copy over the TRUSTEE structure, they don't contain any
580  ansi/unicode specific data */
581  RtlCopyMemory(&peaw[i].Trustee,
582  &pListOfExplicitEntriesA[i].Trustee,
583  sizeof(TRUSTEE_A));
584  break;
585  }
586  }
587  }
588 
590  *pListOfExplicitEntriesW = peaw;
591  }
592  else
594  }
595 
596  return ErrorCode;
597 
598 ConvertErr:
600 
601  /* cleanup */
602  RtlFreeHeap(RtlGetProcessHeap(),
603  0,
604  peaw);
605 
606  return ErrorCode;
607 }
608 
609 
610 /*
611  * @implemented
612  */
613 DWORD
614 WINAPI
615 SetEntriesInAclA(ULONG cCountOfExplicitEntries,
616  PEXPLICIT_ACCESS_A pListOfExplicitEntries,
617  PACL OldAcl,
618  PACL *NewAcl)
619 {
620  PEXPLICIT_ACCESS_W ListOfExplicitEntriesW = NULL;
622 
623  ErrorCode = InternalExplicitAccessAToW(cCountOfExplicitEntries,
624  pListOfExplicitEntries,
625  &ListOfExplicitEntriesW);
626  if (ErrorCode == ERROR_SUCCESS)
627  {
628  ErrorCode = SetEntriesInAclW(cCountOfExplicitEntries,
629  ListOfExplicitEntriesW,
630  OldAcl,
631  NewAcl);
632 
633  /* free the allocated array */
634  RtlFreeHeap(RtlGetProcessHeap(),
635  0,
636  ListOfExplicitEntriesW);
637  }
638 
639  return ErrorCode;
640 }
641 
642 
643 /*
644  * @implemented
645  */
646 DWORD
647 WINAPI
649  PULONG pcCountOfExplicitEntries,
650  PEXPLICIT_ACCESS_W *pListOfExplicitEntries)
651 {
653 
655  if (ErrorCode == ERROR_SUCCESS)
656  {
657  /* call the MARTA provider */
659  pcCountOfExplicitEntries,
660  pListOfExplicitEntries);
661  }
662 
663  return ErrorCode;
664 }
665 
666 
667 /*
668  * @unimplemented
669  */
670 DWORD
671 WINAPI
673  IN PTRUSTEE_W pTrustee,
674  OUT PACCESS_MASK pAccessRights)
675 {
676  FIXME("%p %p %p - stub\n", pacl, pTrustee, pAccessRights);
677 
678  *pAccessRights = STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL;
679  return ERROR_SUCCESS;
680 }
681 
682 
683 /*
684  * @implemented
685  */
686 DWORD
687 WINAPI
689  IN PTRUSTEE_A pTrustee,
690  OUT PACCESS_MASK pAccessRights)
691 {
692  PTRUSTEE_W pTrusteeW = NULL;
694 
695  ErrorCode = InternalTrusteeAToW(pTrustee,
696  &pTrusteeW);
697  if (ErrorCode == ERROR_SUCCESS)
698  {
700  pTrusteeW,
701  pAccessRights);
702 
704  pTrustee);
705  }
706  else
708 
709  return ErrorCode;
710 }
711 
712 
713 /*
714  * @unimplemented
715  */
716 DWORD
717 WINAPI
719  IN PTRUSTEE_W pTrustee,
720  OUT PACCESS_MASK pSuccessfulAuditedRights,
721  OUT PACCESS_MASK pFailedAuditRights)
722 {
723  FIXME("%s() not implemented!\n", __FUNCTION__);
725 }
726 
727 
728 /*
729  * @implemented
730  */
731 DWORD
732 WINAPI
734  IN PTRUSTEE_A pTrustee,
735  OUT PACCESS_MASK pSuccessfulAuditedRights,
736  OUT PACCESS_MASK pFailedAuditRights)
737 {
738  PTRUSTEE_W pTrusteeW = NULL;
740 
741  ErrorCode = InternalTrusteeAToW(pTrustee,
742  &pTrusteeW);
743  if (ErrorCode == ERROR_SUCCESS)
744  {
746  pTrusteeW,
747  pSuccessfulAuditedRights,
748  pFailedAuditRights);
749 
751  pTrustee);
752  }
753  else
755 
756  return ErrorCode;
757 }
758 
759 /* EOF */
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD WINAPI GetExplicitEntriesFromAclW(PACL pacl, PULONG pcCountOfExplicitEntries, PEXPLICIT_ACCESS_W *pListOfExplicitEntries)
Definition: ac.c:648
BOOL WINAPI AddAccessAllowedObjectAce(PACL pAcl, DWORD dwAceRevision, DWORD AceFlags, DWORD AccessMask, GUID *ObjectTypeGuid, GUID *InheritedObjectTypeGuid, PSID pSid)
Definition: ac.c:18
ObjectType
Definition: metafile.c:80
DWORD WINAPI SetEntriesInAclW(ULONG cCountOfExplicitEntries, PEXPLICIT_ACCESS_W pListOfExplicitEntries, PACL OldAcl, PACL *NewAcl)
Definition: ac.c:199
DWORD WINAPI AccGetInheritanceSource(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, BOOL Container, GUID **pObjectClassGuids, DWORD GuidCount, PACL pAcl, PFN_OBJECT_MGR_FUNCTS pfnArray, PGENERIC_MAPPING pGenericMapping, PINHERITED_FROMW pInheritArray)
Definition: ntmarta.c:1569
#define IN
Definition: typedefs.h:38
BOOL WINAPI AddAuditAccessObjectAce(PACL pAcl, DWORD dwAceRevision, DWORD AceFlags, DWORD AccessMask, GUID *ObjectTypeGuid, GUID *InheritedObjectTypeGuid, PSID pSid, BOOL bAuditSuccess, BOOL bAuditFailure)
Definition: ac.c:80
DWORD WINAPI AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries, PEXPLICIT_ACCESS_W pListOfExplicitEntries, PACL OldAcl, PACL *NewAcl)
Definition: ntmarta.c:1322
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetInheritanceSourceW(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, BOOL Container, GUID **pObjectClassGuids OPTIONAL, DWORD GuidCount, PACL pAcl, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL, PGENERIC_MAPPING pGenericMapping, PINHERITED_FROMW pInheritArray)
Definition: ac.c:115
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
uint16_t * PWSTR
Definition: typedefs.h:54
#define CP_ACP
Definition: compat.h:99
DWORD ObjectsPresent
Definition: accctrl.h:356
DWORD WINAPI AccFreeIndexArray(PINHERITED_FROMW pInheritArray, USHORT AceCnt, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL)
Definition: ntmarta.c:1591
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI GetEffectiveRightsFromAclA(IN PACL pacl, IN PTRUSTEE_A pTrustee, OUT PACCESS_MASK pAccessRights)
Definition: ac.c:688
SE_OBJECT_TYPE ObjectType
Definition: accctrl.h:366
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
DWORD WINAPI SetEntriesInAclA(ULONG cCountOfExplicitEntries, PEXPLICIT_ACCESS_A pListOfExplicitEntries, PACL OldAcl, PACL *NewAcl)
Definition: ac.c:615
LPWSTR InheritedObjectTypeName
Definition: accctrl.h:368
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
DWORD WINAPI FreeInheritedFromArray(PINHERITED_FROMW pInheritArray, USHORT AceCnt, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL)
Definition: ac.c:175
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
#define FIXME(fmt,...)
Definition: debug.h:110
#define ACE_INHERITED_OBJECT_TYPE_PRESENT
Definition: winnt_old.h:107
smooth NULL
Definition: ftsmooth.c:416
SE_OBJECT_TYPE ObjectType
Definition: accctrl.h:357
WINE_DEFAULT_DEBUG_CHANNEL(advapi)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
BOOL WINAPI AddAccessDeniedObjectAce(PACL pAcl, DWORD dwAceRevision, DWORD AceFlags, DWORD AccessMask, GUID *ObjectTypeGuid, GUID *InheritedObjectTypeGuid, PSID pSid)
Definition: ac.c:49
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
struct _TRUSTEE_W * PTRUSTEE_W
DWORD grfInheritance
Definition: accctrl.h:342
#define WINAPI
Definition: msvc.h:8
DWORD WINAPI GetEffectiveRightsFromAclW(IN PACL pacl, IN PTRUSTEE_W pTrustee, OUT PACCESS_MASK pAccessRights)
Definition: ac.c:672
struct _OBJECTS_AND_NAME_W * POBJECTS_AND_NAME_W
_In_ ACCESS_MASK AccessMask
Definition: exfuncs.h:186
ACCESS_MODE grfAccessMode
Definition: accctrl.h:341
#define BufferSize
Definition: classpnp.h:419
NTSYSAPI NTSTATUS NTAPI RtlAddAccessAllowedObjectAce(_Inout_ PACL pAcl, _In_ ULONG dwAceRevision, _In_ ULONG AceFlags, _In_ ACCESS_MASK AccessMask, _In_opt_ GUID *ObjectTypeGuid, _In_opt_ GUID *InheritedObjectTypeGuid, _In_ PSID pSid)
TRUSTEE_W Trustee
Definition: accctrl.h:343
struct _EXPLICIT_ACCESS_W EXPLICIT_ACCESS_W
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SPECIFIC_RIGHTS_ALL
Definition: nt_native.h:71
#define SetLastError(x)
Definition: compat.h:409
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
DWORD ObjectsPresent
Definition: accctrl.h:365
DWORD CheckNtMartaPresent(VOID)
Definition: misc.c:74
LPWSTR ptstrName
Definition: accctrl.h:217
DWORD WINAPI GetAuditedPermissionsFromAclW(IN PACL pacl, IN PTRUSTEE_W pTrustee, OUT PACCESS_MASK pSuccessfulAuditedRights, OUT PACCESS_MASK pFailedAuditRights)
Definition: ac.c:718
DWORD WINAPI AccRewriteGetExplicitEntriesFromAcl(PACL pacl, PULONG pcCountOfExplicitEntries, PEXPLICIT_ACCESS_W *pListOfExplicitEntries)
Definition: ntmarta.c:1621
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
unsigned short USHORT
Definition: pedump.c:61
static DWORD InternalTrusteeAToW(IN PTRUSTEE_A pTrusteeA, OUT PTRUSTEE_W *pTrusteeW)
Definition: ac.c:226
DWORD grfAccessPermissions
Definition: accctrl.h:340
DWORD WINAPI GetInheritanceSourceA(LPSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, BOOL Container, GUID **pObjectClassGuids OPTIONAL, DWORD GuidCount, PACL pAcl, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL, PGENERIC_MAPPING pGenericMapping, PINHERITED_FROMA pInheritArray)
Definition: ac.c:153
_In_ ULONG dwAceRevision
Definition: rtlfuncs.h:1115
signed char * PSTR
Definition: retypes.h:7
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int * PULONG
Definition: retypes.h:1
static DWORD InternalExplicitAccessAToW(IN ULONG cCountOfExplicitEntries, IN PEXPLICIT_ACCESS_A pListOfExplicitEntriesA, OUT PEXPLICIT_ACCESS_W *pListOfExplicitEntriesW)
Definition: ac.c:408
static PSID pSid
Definition: security.c:74
TRUSTEE_FORM WINAPI GetTrusteeFormA(PTRUSTEEA pTrustee)
Definition: security.c:2082
#define MultiByteToWideChar
Definition: compat.h:100
NTSYSAPI NTSTATUS NTAPI RtlAddAuditAccessObjectAce(_Inout_ PACL Acl, _In_ ULONG Revision, _In_ ULONG Flags, _In_ ACCESS_MASK AccessMask, _In_opt_ GUID *ObjectTypeGuid, _In_opt_ GUID *InheritedObjectTypeGuid, _In_ PSID Sid, _In_ BOOLEAN Success, _In_ BOOLEAN Failure)
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
LPSTR WINAPI GetTrusteeNameA(PTRUSTEE_A pTrustee)
Definition: security.c:2109
LPSTR InheritedObjectTypeName
Definition: accctrl.h:359
WCHAR * LPWSTR
Definition: xmlstorage.h:184
enum _TRUSTEE_FORM TRUSTEE_FORM
#define __FUNCTION__
Definition: types.h:112
struct _OBJECTS_AND_NAME_A * POBJECTS_AND_NAME_A
static __inline VOID InternalFreeConvertedTrustee(IN PTRUSTEE_W pTrusteeW, IN PTRUSTEE_A pTrusteeA)
Definition: ac.c:395
enum _SE_OBJECT_TYPE SE_OBJECT_TYPE
Definition: security.c:104
static const ACEFLAG AceFlags[]
Definition: security.c:2300
DWORD WINAPI GetAuditedPermissionsFromAclA(IN PACL pacl, IN PTRUSTEE_A pTrustee, OUT PACCESS_MASK pSuccessfulAuditedRights, OUT PACCESS_MASK pFailedAuditRights)
Definition: ac.c:733
NTSYSAPI NTSTATUS NTAPI RtlAddAccessDeniedObjectAce(_Inout_ PACL pAcl, _In_ ULONG dwAceRevision, _In_ ULONG AceFlags, _In_ ACCESS_MASK AccessMask, _In_opt_ GUID *ObjectTypeGuid, _In_opt_ GUID *InheritedObjectTypeGuid, _In_ PSID pSid)
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68