From 96bb83f2a9c7e17685836d4ce1ee6b742ba3500a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Fri, 1 Oct 2004 20:06:43 +0000 Subject: [PATCH] Handle mapping a view of a section at non-zero file offset svn path=/trunk/; revision=11141 --- reactos/ntoskrnl/mm/section.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 652e5f84bc0..f30cd9bada3 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.163 2004/09/28 20:58:29 gvg Exp $ +/* $Id: section.c,v 1.164 2004/10/01 20:06:43 gvg Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/section.c @@ -913,6 +913,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, /* * Get the entry corresponding to the offset within the section */ + Offset += MemoryArea->Data.SectionData.ViewOffset; Entry = MmGetPageEntrySectionSegment(Segment, Offset); if (Entry == 0) @@ -3175,12 +3176,12 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, Address = (PVOID)PAGE_ROUND_DOWN(Address); - Offset = ((ULONG)Address - (ULONG)MArea->BaseAddress); + Offset = ((ULONG_PTR)Address - (ULONG_PTR)MArea->BaseAddress) + + MemoryArea->Data.SectionData.ViewOffset; Section = MArea->Data.SectionData.Section; Segment = MArea->Data.SectionData.Segment; - PageOp = MmCheckForPageOp(MArea, 0, NULL, Segment, Offset); while (PageOp) @@ -3831,7 +3832,7 @@ MmMapViewOfSection(IN PVOID SectionObject, &SBaseAddress, SectionSegments[i].Length, SectionSegments[i].Protection, - (ULONG_PTR)SectionSegments[i].VirtualAddress, + 0, FALSE); MmUnlockSectionSegment(&SectionSegments[i]); if (!NT_SUCCESS(Status))