Author: arty Date: Mon Sep 1 09:27:00 2008 New Revision: 35858
URL: http://svn.reactos.org/svn/reactos?rev=35858&view=rev Log: Don't actually need all spew anymore. Keep a reference to the associated file object. MmGetDeviceObjectForFile was way more complicated than it needed to be, due to my wrong understanding of IoGetRelatedDeviceObject.
VFAT read is now working.
Modified: branches/arty-newcc/ntoskrnl/cache/fssup.c branches/arty-newcc/ntoskrnl/cache/pinsup.c branches/arty-newcc/ntoskrnl/mm/section.c
Modified: branches/arty-newcc/ntoskrnl/cache/fssup.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/fssup.... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] Mon Sep 1 09:27:00 2008 @@ -115,10 +115,10 @@ PNOCC_CACHE_MAP Map = ExAllocatePool(NonPagedPool, sizeof(NOCC_CACHE_MAP)); FileObject->SectionObjectPointer->SharedCacheMap = Map; Map->RefCount = 1; + ObReferenceObject(FileObject); Map->FileObject = FileObject; Map->NumberOfMaps = 0; Map->FileSizes = *FileSizes; - ASSERT(Map->FileSizes.ValidDataLength.HighPart != 0xcccccccc); DPRINT("FileSizes->ValidDataLength %x\n", FileSizes->ValidDataLength.LowPart); InitializeListHead(&Map->AssociatedBcb); } @@ -175,6 +175,8 @@ } } + ObDereferenceObject(Map->FileObject); + ExFreePool(Map); /* Clear the cache map */
Modified: branches/arty-newcc/ntoskrnl/cache/pinsup.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/pinsup... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/pinsup.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/pinsup.c [iso-8859-1] Mon Sep 1 09:27:00 2008 @@ -10,7 +10,7 @@ /* INCLUDES *******************************************************************/
#include <ntoskrnl.h> -//#define NDEBUG +#define NDEBUG #include <debug.h>
/* GLOBALS ********************************************************************/
Modified: branches/arty-newcc/ntoskrnl/mm/section.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section.c... ============================================================================== --- branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] Mon Sep 1 09:27:00 2008 @@ -45,7 +45,7 @@ /* INCLUDES *****************************************************************/
#include <ntoskrnl.h> -//#define NDEBUG +#define NDEBUG #include <internal/debug.h> #include <reactos/exeformat.h>
@@ -98,15 +98,7 @@ NTAPI MmGetDeviceObjectForFile(IN PFILE_OBJECT FileObject) { - if (FileObject->Flags & (FO_DIRECT_DEVICE_OPEN | FO_STREAM_FILE)) - { - /* Get the device object */ - return IoGetAttachedDevice(FileObject->DeviceObject); - } - else - { - return IoGetRelatedDeviceObject(FileObject); - } + return IoGetRelatedDeviceObject(FileObject); }
PFILE_OBJECT