From 39d8412f56ed40bc6092873412e06872be4f6562 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 20 Jun 2004 10:21:48 +0000 Subject: [PATCH] - Use raw size for image sections if virtual size isn't specified. Patch by Nathan Lineback from BugZilla #364. svn path=/trunk/; revision=9744 --- reactos/ntoskrnl/mm/section.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 26c78e26e29..9db45c2dfb8 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: section.c,v 1.151 2004/06/06 08:36:31 hbirr Exp $ +/* $Id: section.c,v 1.152 2004/06/20 10:21:48 navaraf Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/section.c @@ -2966,7 +2966,14 @@ MmCreateImageSection(PHANDLE SectionHandle, } SectionSegments[i].RawLength = ImageSections[i-1].SizeOfRawData; - SectionSegments[i].Length = ImageSections[i-1].Misc.VirtualSize; + if (ImageSections[i-1].Misc.VirtualSize != 0) + { + SectionSegments[i].Length = ImageSections[i-1].Misc.VirtualSize; + } + else + { + SectionSegments[i].Length = ImageSections[i-1].SizeOfRawData; + } SectionSegments[i].Flags = 0; SectionSegments[i].ReferenceCount = 1; SectionSegments[i].VirtualAddress = (PVOID)ImageSections[i-1].VirtualAddress;