diff --git a/reactos/ntoskrnl/se/sd.c b/reactos/ntoskrnl/se/sd.c index 1924c872dd4..42287192c92 100644 --- a/reactos/ntoskrnl/se/sd.c +++ b/reactos/ntoskrnl/se/sd.c @@ -541,10 +541,7 @@ SeCaptureSecurityDescriptor( /* securely access the buffers! */ \ _SEH_TRY \ { \ - ProbeForRead(&SidType->SubAuthorityCount, \ - sizeof(SidType->SubAuthorityCount), \ - 1); \ - SidType##SAC = SidType->SubAuthorityCount; \ + SidType##SAC = ProbeForReadUchar(&SidType->SubAuthorityCount); \ SidType##Size = RtlLengthRequiredSid(SidType##SAC); \ DescriptorSize += ROUND_UP(SidType##Size, sizeof(ULONG)); \ ProbeForRead(SidType, \ @@ -574,6 +571,8 @@ SeCaptureSecurityDescriptor( DetermineSIDSize(Owner); DetermineSIDSize(Group); +#undef DetermineSIDSize + /* determine the size of the ACLs */ #define DetermineACLSize(AclType, AclFlag) \ do { \ @@ -587,10 +586,7 @@ SeCaptureSecurityDescriptor( /* securely access the buffers! */ \ _SEH_TRY \ { \ - ProbeForRead(&AclType->AclSize, \ - sizeof(AclType->AclSize), \ - 1); \ - AclType##Size = AclType->AclSize; \ + AclType##Size = ProbeForReadUshort(&AclType->AclSize); \ DescriptorSize += ROUND_UP(AclType##Size, sizeof(ULONG)); \ ProbeForRead(AclType, \ AclType##Size, \ @@ -622,6 +618,8 @@ SeCaptureSecurityDescriptor( DetermineACLSize(Sacl, SACL); DetermineACLSize(Dacl, DACL); +#undef DetermineACLSize + /* allocate enough memory to store a complete copy of a self-relative security descriptor */ NewDescriptor = ExAllocatePool(PoolType, @@ -663,6 +661,8 @@ SeCaptureSecurityDescriptor( CopySID(Owner); CopySID(Group); +#undef CopySID + #define CopyACL(Type) \ do { \ if(DescriptorCopy.Type != NULL) \ @@ -683,6 +683,8 @@ SeCaptureSecurityDescriptor( CopyACL(Sacl); CopyACL(Dacl); + +#undef CopyACL } _SEH_HANDLE {