[FASTFAT]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 6 Aug 2016 08:57:47 +0000 (08:57 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 6 Aug 2016 08:57:47 +0000 (08:57 +0000)
Don't mess with parentless FCB.
Dedicated to Thomas :-).

CORE-11377
CORE-11426

svn path=/trunk/; revision=72126

reactos/drivers/filesystems/fastfat/fcb.c

index f8b0a48..3a63a34 100644 (file)
@@ -268,11 +268,15 @@ vfatDestroyFCB(
     PVFATFCB pFCB)
 {
     FsRtlUninitializeFileLock(&pFCB->FileLock);
     PVFATFCB pFCB)
 {
     FsRtlUninitializeFileLock(&pFCB->FileLock);
+    if (!vfatFCBIsRoot(pFCB) &&
+        !BooleanFlagOn(pFCB->Flags, FCB_IS_FAT) && !BooleanFlagOn(pFCB->Flags, FCB_IS_VOLUME))
+    {
+        RemoveEntryList(&pFCB->ParentListEntry);
+    }
     ExFreePool(pFCB->PathNameBuffer);
     ExDeleteResourceLite(&pFCB->PagingIoResource);
     ExDeleteResourceLite(&pFCB->MainResource);
     ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB);
     ExFreePool(pFCB->PathNameBuffer);
     ExDeleteResourceLite(&pFCB->PagingIoResource);
     ExDeleteResourceLite(&pFCB->MainResource);
     ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB);
-    RemoveEntryList(&pFCB->ParentListEntry);
     ASSERT(IsListEmpty(&pFCB->ParentListHead));
 }
 
     ASSERT(IsListEmpty(&pFCB->ParentListHead));
 }