34 Ace->Header.AceSize = AceSize;
70 Ace->Header.AceSize = AceSize;
101 if (
KmtSkip(SidSize >=
sizeof(
ULONG), FileAndLine,
"Sid too small: %lu\n", SidSize))
104 KmtOk(Okay ==
TRUE, FileAndLine,
"Invalid Sid\n");
105 if (
KmtSkip(Okay, FileAndLine,
"Invalid Sid\n"))
109 KmtOk(SidSize >=
Length, FileAndLine,
"SidSize %lu too small, need %lu\n", SidSize,
Length);
110 if (
KmtSkip(SidSize >=
Length, FileAndLine,
"Sid too small\n"))
113 KmtOk(Okay, FileAndLine,
"Sids %p and %p not equal\n",
Sid, ExpectedSid);
119 RtlInitEmptyUnicodeString(&SidString1, Buffer1,
sizeof(Buffer1));
120 RtlInitEmptyUnicodeString(&SidString2, Buffer2,
sizeof(Buffer2));
123 KmtOk(0, FileAndLine,
"Got %wZ, expected %wZ\n", &SidString1, &SidString2);
145 KmtOk(Acl !=
NULL, FileAndLine,
"Acl is NULL\n");
149 KmtOk(Acl->AclRevision ==
ACL_REVISION, FileAndLine,
"AclRevision is %u\n", Acl->AclRevision);
150 KmtOk(Acl->Sbz1 == 0, FileAndLine,
"Sbz1 is %u\n", Acl->Sbz1);
151 KmtOk(Acl->Sbz2 == 0, FileAndLine,
"Sbz2 is %u\n", Acl->Sbz2);
152 KmtOk(Acl->AclSize >=
sizeof(*Acl), FileAndLine,
"AclSize too small: %u\n", Acl->AclSize);
153 KmtOk(Acl->AceCount == AceCount, FileAndLine,
"AceCount is %u, expected %lu\n", Acl->AceCount, AceCount);
155 for (
i = 0;
i < Acl->AceCount;
i++)
157 KmtOk(Acl->AclSize >=
Offset +
sizeof(*AceHeader), FileAndLine,
"AclSize too small (%u) at Offset %lu, ACE #%lu\n", Acl->AclSize,
Offset,
i);
158 if (Acl->AclSize <
Offset +
sizeof(*AceHeader))
161 KmtOk((
ULONG_PTR)AceHeader %
sizeof(
ULONG) == 0, FileAndLine,
"[%lu] Unaligned ACE %p\n",
i, AceHeader);
163 KmtOk(Acl->AclSize >=
Offset + AceHeader->
AceSize, FileAndLine,
"[%lu] AclSize too small (%u) at Offset %lu\n",
i, Acl->AclSize,
Offset);
177 KmtOk(AceHeader->
AceSize >=
sizeof(*AllowedAce), FileAndLine,
"[%lu] AllowedAce AceSize too small: %u\n",
i, AceHeader->
AceSize);
178 if (AceHeader->
AceSize <
sizeof(*AllowedAce))
181 KmtOk(AllowedAce->
Mask ==
Mask, FileAndLine,
"[%lu] AllowedAce Mask is 0x%lx, expected 0x%lx\n",
i, AllowedAce->
Mask,
Mask);
191 KmtOk(AceHeader->
AceSize >=
sizeof(*DeniedAce), FileAndLine,
"[%lu] DeniedAce AceSize too small: %u\n",
i, AceHeader->
AceSize);
192 if (AceHeader->
AceSize <
sizeof(*DeniedAce))
195 KmtOk(DeniedAce->
Mask ==
Mask, FileAndLine,
"[%lu] DeniedAce Mask is 0x%lx, expected 0x%lx\n",
i, DeniedAce->
Mask,
Mask);
205 KmtOk(AceHeader->
AceSize >=
sizeof(*AuditAce), FileAndLine,
"[%lu] AuditAce AceSize too small: %u\n",
i, AceHeader->
AceSize);
206 if (AceHeader->
AceSize <
sizeof(*AuditAce))
209 KmtOk(AuditAce->
Mask ==
Mask, FileAndLine,
"[%lu] AuditAce Mask is 0x%lx, expected 0x%lx\n",
i, AuditAce->
Mask,
Mask);
228 VCheckAcl__(Acl, AceCount, FileAndLine, Arguments);
VOID VCheckAcl__(_In_ PACL Acl, _In_ ULONG AceCount, _In_ PCSTR FileAndLine, _In_ va_list Arguments)
VOID CheckSid__(_In_ PSID Sid, _In_ ULONG SidSize, _In_ PISID ExpectedSid, _In_ PCSTR FileAndLine)
VOID CheckAcl__(_In_ PACL Acl, _In_ ULONG AceCount, _In_ PCSTR FileAndLine,...)
NTSTATUS RtlxAddAuditAccessAceEx(_Inout_ PACL Acl, _In_ ULONG Revision, _In_ ULONG Flags, _In_ ACCESS_MASK AccessMask, _In_ PSID Sid, _In_ BOOLEAN Success, _In_ BOOLEAN Failure)
NTSTATUS RtlxAddMandatoryLabelAceEx(_Inout_ PACL Acl, _In_ ULONG Revision, _In_ ULONG Flags, _In_ ACCESS_MASK AccessMask, _In_ PSID Sid)
#define NT_SUCCESS(StatCode)
static const ACEFLAG AceFlags[]
static const ACEFLAG AceType[]
#define ExAllocatePoolWithTag(hernya, size, tag)
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 BOOLEAN WINAPI RtlCopySid(DWORD, PSID, PSID)
BOOLEAN BOOLEAN KmtOk(INT Condition, PCSTR FileAndLine, PCSTR Format,...) KMT_FORMAT(ms_printf
BOOLEAN BOOLEAN VOID VOID BOOLEAN BOOLEAN KmtSkip(INT Condition, PCSTR FileAndLine, PCSTR Format,...) KMT_FORMAT(ms_printf
#define ExFreePoolWithTag(_P, _T)
struct _SYSTEM_AUDIT_ACE * PSYSTEM_AUDIT_ACE
struct _ACCESS_DENIED_ACE * PACCESS_DENIED_ACE
struct _ACE_HEADER * PACE_HEADER
struct _ACCESS_ALLOWED_ACE * PACCESS_ALLOWED_ACE
_In_ ACCESS_MASK AccessMask
NTSYSAPI NTSTATUS NTAPI RtlAddAce(_Inout_ PACL Acl, _In_ ULONG AceRevision, _In_ ULONG StartingAceIndex, _In_reads_bytes_(AceListLength) PVOID AceList, _In_ ULONG AceListLength)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
NTSYSAPI BOOLEAN NTAPI RtlEqualSid(_In_ PSID Sid1, _In_ PSID Sid2)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSYSAPI NTSTATUS NTAPI RtlConvertSidToUnicodeString(OUT PUNICODE_STRING DestinationString, IN PVOID Sid, IN BOOLEAN AllocateDestinationString)
#define FIELD_OFFSET(t, f)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ ULONG Flags
#define SYSTEM_AUDIT_ACE_TYPE
#define ACCESS_ALLOWED_ACE_TYPE
#define ACCESS_DENIED_ACE_TYPE
#define SYSTEM_MANDATORY_LABEL_ACE_TYPE
#define FAILED_ACCESS_ACE_FLAG
#define SUCCESSFUL_ACCESS_ACE_FLAG