Author: weiden Date: Fri Oct 20 18:20:27 2006 New Revision: 24582
URL: http://svn.reactos.org/svn/reactos?rev=24582&view=rev Log: Prefer inline probing macros for base types
Modified: trunk/reactos/ntoskrnl/se/sd.c
Modified: trunk/reactos/ntoskrnl/se/sd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sd.c?rev=24582&... ============================================================================== --- trunk/reactos/ntoskrnl/se/sd.c (original) +++ trunk/reactos/ntoskrnl/se/sd.c Fri Oct 20 18:20:27 2006 @@ -541,10 +541,7 @@ /* 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 @@ DetermineSIDSize(Owner); DetermineSIDSize(Group);
+#undef DetermineSIDSize + /* determine the size of the ACLs */ #define DetermineACLSize(AclType, AclFlag) \ do { \ @@ -587,10 +586,7 @@ /* 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 @@ 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 @@ CopySID(Owner); CopySID(Group);
+#undef CopySID + #define CopyACL(Type) \ do { \ if(DescriptorCopy.Type != NULL) \ @@ -683,6 +683,8 @@
CopyACL(Sacl); CopyACL(Dacl); + +#undef CopyACL } _SEH_HANDLE {