[FASTFAT]

- Assert that clusters supposedly belonging to a file are not in fact marked as free
CORE-9433

svn path=/trunk/; revision=66932
This commit is contained in:
Thomas Faber 2015-03-28 17:14:14 +00:00
parent 7f5f21a52f
commit abf3e9f6bf

View file

@ -49,6 +49,7 @@ FAT32GetNextCluster(
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
CurrentCluster = 0xffffffff;
ASSERT(CurrentCluster != 0);
CcUnpinData(Context);
*NextCluster = CurrentCluster;
return STATUS_SUCCESS;
@ -80,6 +81,7 @@ FAT16GetNextCluster(
CurrentCluster = *((PUSHORT)((char*)BaseAddress + (FATOffset % ChunkSize)));
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
CurrentCluster = 0xffffffff;
ASSERT(CurrentCluster != 0);
CcUnpinData(Context);
*NextCluster = CurrentCluster;
return STATUS_SUCCESS;
@ -123,6 +125,7 @@ FAT12GetNextCluster(
Entry = 0xffffffff;
// DPRINT("Returning %x\n",Entry);
ASSERT(Entry != 0);
*NextCluster = Entry;
CcUnpinData(Context);
// return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
@ -667,7 +670,10 @@ GetNextCluster(
DeviceExt, CurrentCluster);
if (CurrentCluster == 0)
{
ASSERT(CurrentCluster != 0);
return STATUS_INVALID_PARAMETER;
}
ExAcquireResourceSharedLite(&DeviceExt->FatResource, TRUE);
Status = DeviceExt->GetNextCluster(DeviceExt, CurrentCluster, NextCluster);