* 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
PVOID BaseAddress;
BOOLEAN UptoDate;
PCACHE_SEGMENT CacheSeg;
- LARGE_INTEGER SegOffset;
PHYSICAL_ADDRESS Addr;
/*
* 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.
* 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
*/
Status = MmCreateVirtualMapping(PsGetCurrentProcess(),
Address,
- Attributes,
+ MemoryArea->Attributes,
Page,
FALSE);
if (!NT_SUCCESS(Status))
BaseAddress);
if (MemoryArea == NULL)
{
- MmUnlockAddressSpace(AddressSpace);
return(STATUS_UNSUCCESSFUL);
}