https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b957af4b6b41b05e789908577002c26fe498d25e

commit b957af4b6b41b05e789908577002c26fe498d25e
Author:     Thomas Faber <[email protected]>
AuthorDate: Sun Sep 27 16:43:19 2020 +0200
Commit:     Thomas Faber <[email protected]>
CommitDate: Sat Oct 3 13:13:35 2020 +0200

    [NTOS:MM] VirtualSize overrides SizeOfRawData when mapping PE files. 
CORE-17284
    
    This fixes the related failures in ntdll_apitest:NtMapViewOfSection
    as well as loading of OrgPlayer's DragDrop.ocx.
---
 ntoskrnl/mm/section.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index 9e7958a2aac..2bbbee15e8b 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -754,7 +754,7 @@ l_ReadHeaderFromFile:
         pssSegments[i].Protection = 
SectionCharacteristicsToProtect[nCharacteristics >> 28];
         pssSegments[i].WriteCopy = !(nCharacteristics & IMAGE_SCN_MEM_SHARED);
 
-        if(pishSectionHeaders[i].Misc.VirtualSize == 0 || 
pishSectionHeaders[i].Misc.VirtualSize < pishSectionHeaders[i].SizeOfRawData)
+        if(pishSectionHeaders[i].Misc.VirtualSize == 0)
             pssSegments[i].Length.QuadPart = 
pishSectionHeaders[i].SizeOfRawData;
         else
             pssSegments[i].Length.QuadPart = 
pishSectionHeaders[i].Misc.VirtualSize;

Reply via email to