12#include <../../ntoskrnl/include/internal/se.h>
32 Current = (
PACE)(Acl + 1);
36 for (
i = 0;
i < Acl->AceCount;
i++)
44 if ((
ULONG_PTR)Current <= AclEnd) *FirstFreeAce = Current;
98 ULONG AceSize, InvalidFlags;
122 InvalidFlags =
Flags & ~VALID_INHERIT_FLAGS;
144 Ace->Header.AceSize = (
WORD)AceSize;
169 ULONG AceSize, InvalidFlags, AceObjectFlags = 0;
193 InvalidFlags =
Flags & ~VALID_INHERIT_FLAGS;
212 AceSize +=
sizeof(
GUID);
214 if (InheritedObjectTypeGuid)
217 AceSize +=
sizeof(
GUID);
229 Ace->Header.AceSize = (
WORD)AceSize;
231 Ace->Flags = AceObjectFlags;
238 SidStart +=
sizeof(
GUID);
240 if (InheritedObjectTypeGuid)
243 SidStart +=
sizeof(
GUID);
316 if (!(ObjectTypeGuid) && !(InheritedObjectTypeGuid))
333 InheritedObjectTypeGuid,
397 if (!(ObjectTypeGuid) && !(InheritedObjectTypeGuid))
414 InheritedObjectTypeGuid,
495 if (!(ObjectTypeGuid) && !(InheritedObjectTypeGuid))
512 InheritedObjectTypeGuid,
584 for (
Ace = AceList, NewAceCount = 0;
633 Acl->AceCount += NewAceCount;
814 if (Acl->AclRevision >=
Info->AclRevision)
820 Acl->AclRevision = (
BYTE)
Info->AclRevision;
842 USHORT RequiredObjectAceSize;
853 DPRINT1(
"Invalid ACL revision: %u\n", Acl->AclRevision);
860 DPRINT1(
"Misaligned ACL size: %u\n", Acl->AclSize);
865 if (Acl->AclSize <
sizeof(
ACL))
867 DPRINT1(
"Too small ACL size: %u\n", Acl->AclSize);
873 for (
i = 0;
i < Acl->AceCount;
i++)
885 DPRINT1(
"Invalid ACE size: %lx\n",
Ace->AceSize);
892 DPRINT1(
"Invalid ACE size %lx %lx\n",
Ace->AceSize, Acl->AclSize);
941 DPRINT1(
"Invalid ACL revision for Object ACE: %u\n", Acl->AclRevision);
948 DPRINT1(
"Misaligned Object ACE size: %lx\n",
Ace->AceSize);
955 DPRINT1(
"Too small Object ACE size to hold KNOWN_OBJECT_ACE header: %lx\n",
Ace->AceSize);
966 GuidSize +=
sizeof(
GUID);
971 GuidSize +=
sizeof(
GUID);
991 if (
Ace->AceSize < RequiredObjectAceSize)
993 DPRINT1(
"Too small Object ACE size: AceSize %u RequiredSize %u\n",
Ace->AceSize, RequiredObjectAceSize);
999 DPRINT1(
"Unsupported ACE in ReactOS, assuming valid\n");
1004 DPRINT1(
"Unsupported ACE in ReactOS, assuming valid\n");
#define ROUND_UP(n, align)
#define ROUND_DOWN(n, align)
_In_ FILTER_INFORMATION_CLASS InformationClass
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
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD, PSID, PSID)
#define EXCEPTION_EXECUTE_HANDLER
struct _ACE_HEADER ACE_HEADER
struct _ACE_HEADER * PACE_HEADER
_In_ ACCESS_MASK AccessMask
NTSYSAPI BOOLEAN NTAPI RtlValidAcl(PACL Acl)
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
_In_ ULONG _In_ ULONG Offset
struct _KNOWN_OBJECT_ACE KNOWN_OBJECT_ACE
struct _KNOWN_OBJECT_ACE * PKNOWN_OBJECT_ACE
#define STATUS_INVALID_ACL
#define STATUS_INVALID_SID
#define STATUS_ALLOTTED_SPACE_EXCEEDED
#define STATUS_INVALID_INFO_CLASS
#define STATUS_REVISION_MISMATCH
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
NTSTATUS NTAPI RtlAddAuditAccessAceEx(IN PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN PSID Sid, IN BOOLEAN Success, IN BOOLEAN Failure)
BOOLEAN NTAPI RtlFirstFreeAce(IN PACL Acl, OUT PACE *FirstFreeAce)
NTSTATUS NTAPI RtlAddAccessDeniedObjectAce(IN OUT PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN GUID *ObjectTypeGuid OPTIONAL, IN GUID *InheritedObjectTypeGuid OPTIONAL, IN PSID Sid)
NTSTATUS NTAPI RtlAddAccessAllowedAceEx(IN OUT PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN PSID Sid)
NTSTATUS NTAPI RtlAddAccessAllowedObjectAce(IN OUT PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN GUID *ObjectTypeGuid OPTIONAL, IN GUID *InheritedObjectTypeGuid OPTIONAL, IN PSID Sid)
NTSTATUS NTAPI RtlQueryInformationAcl(IN PACL Acl, IN PVOID Information, IN ULONG InformationLength, IN ACL_INFORMATION_CLASS InformationClass)
NTSTATUS NTAPI RtlAddAce(IN PACL Acl, IN ULONG AclRevision, IN ULONG StartingIndex, IN PVOID AceList, IN ULONG AceListLength)
NTSTATUS NTAPI RtlAddAccessDeniedAceEx(IN OUT PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN PSID Sid)
VOID NTAPI RtlpAddData(IN PVOID AceList, IN ULONG AceListLength, IN PVOID Ace, IN ULONG Offset)
NTSTATUS NTAPI RtlSetInformationAcl(IN PACL Acl, IN PVOID Information, IN ULONG InformationLength, IN ACL_INFORMATION_CLASS InformationClass)
NTSTATUS NTAPI RtlpAddKnownObjectAce(IN PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN GUID *ObjectTypeGuid OPTIONAL, IN GUID *InheritedObjectTypeGuid OPTIONAL, IN PSID Sid, IN UCHAR Type)
NTSTATUS NTAPI RtlDeleteAce(IN PACL Acl, IN ULONG AceIndex)
VOID NTAPI RtlpDeleteData(IN PVOID Ace, IN ULONG AceSize, IN ULONG Offset)
NTSTATUS NTAPI RtlGetAce(IN PACL Acl, IN ULONG AceIndex, OUT PVOID *Ace)
NTSTATUS NTAPI RtlAddAuditAccessAce(IN PACL Acl, IN ULONG Revision, IN ACCESS_MASK AccessMask, IN PSID Sid, IN BOOLEAN Success, IN BOOLEAN Failure)
NTSTATUS NTAPI RtlAddAccessDeniedAce(IN PACL Acl, IN ULONG Revision, IN ACCESS_MASK AccessMask, IN PSID Sid)
NTSTATUS NTAPI RtlAddAuditAccessObjectAce(IN PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN GUID *ObjectTypeGuid OPTIONAL, IN GUID *InheritedObjectTypeGuid OPTIONAL, IN PSID Sid, IN BOOLEAN Success, IN BOOLEAN Failure)
NTSTATUS NTAPI RtlpAddKnownAce(IN PACL Acl, IN ULONG Revision, IN ULONG Flags, IN ACCESS_MASK AccessMask, IN PSID Sid, IN UCHAR Type)
#define STATUS_BUFFER_TOO_SMALL
PULONG MinorVersion OPTIONAL
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
struct _ACL_REVISION_INFORMATION * PACL_REVISION_INFORMATION
enum _ACL_INFORMATION_CLASS ACL_INFORMATION_CLASS
struct _ACL_SIZE_INFORMATION * PACL_SIZE_INFORMATION
_Must_inspect_result_ _In_ ULONG Flags
_In_ ULONG _In_ ULONG _In_ ULONG AceListLength
_In_ ULONG _In_ ULONG AclRevision
#define VALID_INHERIT_FLAGS
#define ACE_INHERITED_OBJECT_TYPE_PRESENT
#define ACCESS_MAX_MS_ACE_TYPE
#define ACCESS_DENIED_OBJECT_ACE_TYPE
#define SYSTEM_AUDIT_ACE_TYPE
#define ACCESS_ALLOWED_ACE_TYPE
#define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE
#define ACCESS_DENIED_ACE_TYPE
#define ACCESS_MAX_MS_V2_ACE_TYPE
#define ACCESS_MIN_MS_OBJECT_ACE_TYPE
#define ACE_OBJECT_TYPE_PRESENT
#define ACCESS_ALLOWED_OBJECT_ACE_TYPE
#define ACCESS_ALLOWED_COMPOUND_ACE_TYPE
#define SID_MAX_SUB_AUTHORITIES
#define SYSTEM_AUDIT_OBJECT_ACE_TYPE
#define FAILED_ACCESS_ACE_FLAG
#define SUCCESSFUL_ACCESS_ACE_FLAG
#define ACCESS_MAX_MS_V3_ACE_TYPE
#define ACCESS_MAX_MS_OBJECT_ACE_TYPE