[FASTFAT]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 26 Oct 2014 15:56:20 +0000 (15:56 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 26 Oct 2014 15:56:20 +0000 (15:56 +0000)
Make FATGetNextDirEntry() and vfatFindDirSpace() complain when they are given a cleaned up FCB (which shouldn't happen!).
They'll display full path, references count, open handles count.

Where are you little reference leak?

svn path=/trunk/; revision=65014

reactos/drivers/filesystems/fastfat/direntry.c
reactos/drivers/filesystems/fastfat/dirwr.c

index 336f014..f3dc5b9 100644 (file)
@@ -201,6 +201,12 @@ FATGetNextDirEntry(
             CcUnpinData(*pContext);
         }
 
+        if (!pDirFcb->FileObject)
+        {
+            DPRINT1("Buggy FCB (cleaned up)! %S (%d / %u)\n", pDirFcb->PathNameBuffer, pDirFcb->RefCount, pDirFcb->OpenHandleCount);
+            return STATUS_NO_MORE_ENTRIES;
+        }
+
         if (FileOffset.u.LowPart >= pDirFcb->RFCB.FileSize.u.LowPart ||
             !CcMapData(pDirFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, pPage))
         {
index 21b0e69..e9622a8 100644 (file)
@@ -167,6 +167,11 @@ vfatFindDirSpace(
             {
                 CcUnpinData(Context);
             }
+            if (!pDirFcb->FileObject)
+            {
+                DPRINT1("Buggy FCB (cleaned up)! %S (%d / %u)\n", pDirFcb->PathNameBuffer, pDirFcb->RefCount, pDirFcb->OpenHandleCount);
+                return FALSE;
+            }
             if (!CcPinRead(pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
                       TRUE, &Context, (PVOID*)&pFatEntry))
             {