From a9a618aeb0ed904ae2e2988f42e08cb3605d50d8 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Tue, 27 Aug 2002 06:40:32 +0000 Subject: [PATCH] Using ReadCacheSegment for reading a cache segment in MiReadPage. Fixed the attribute in a call to MmCreateVirtualMapping in MmNotPresentFaultSectionView. Removed a wrong call to MmUnlockAddressSpace in MmUnmapViewOfSection. svn path=/trunk/; revision=3406 --- reactos/ntoskrnl/mm/section.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 3e0c8a73bf2..9acf7754f54 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.92 2002/08/20 20:37:13 hyperion Exp $ +/* $Id: section.c,v 1.93 2002/08/27 06:40:32 hbirr Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/section.c @@ -339,7 +339,6 @@ MiReadPage(PMEMORY_AREA MemoryArea, PVOID BaseAddress; BOOLEAN UptoDate; PCACHE_SEGMENT CacheSeg; - LARGE_INTEGER SegOffset; PHYSICAL_ADDRESS Addr; /* @@ -363,21 +362,11 @@ MiReadPage(PMEMORY_AREA MemoryArea, * If the cache segment isn't up to date then call the file * system to read in the data. */ - - Mdl = MmCreateMdl(NULL, BaseAddress, Fcb->Bcb->CacheSegmentSize); - MmBuildMdlForNonPagedPool(Mdl); - SegOffset.QuadPart = BaseOffset; - Status = IoPageRead(FileObject, - Mdl, - &SegOffset, - &IoStatus, - TRUE); - if (!NT_SUCCESS(Status) && Status != STATUS_END_OF_FILE) - { - CcRosReleaseCacheSegment(Fcb->Bcb, CacheSeg, FALSE, FALSE, - FALSE); - return(Status); - } + Status = ReadCacheSegment(CacheSeg); + if (!NT_SUCCESS(Status)) + { + return Status; + } } /* * Retrieve the page from the cache segment that we actually want. @@ -406,7 +395,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, * Create an mdl to hold the page we are going to read data into. */ Mdl = MmCreateMdl(NULL, NULL, PAGESIZE); - MmBuildMdlFromPages(Mdl, (PULONG)Page); + MmBuildMdlFromPages(Mdl, &Page->u.LowPart); /* * Call the FSD to read the page */ @@ -547,7 +536,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, Status = MmCreateVirtualMapping(PsGetCurrentProcess(), Address, - Attributes, + MemoryArea->Attributes, Page, FALSE); if (!NT_SUCCESS(Status)) @@ -2946,7 +2935,6 @@ MmUnmapViewOfSection(PEPROCESS Process, BaseAddress); if (MemoryArea == NULL) { - MmUnlockAddressSpace(AddressSpace); return(STATUS_UNSUCCESSFUL); }