mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:42:59 +00:00
[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:
parent
7f5f21a52f
commit
abf3e9f6bf
1 changed files with 6 additions and 0 deletions
|
@ -49,6 +49,7 @@ FAT32GetNextCluster(
|
||||||
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
|
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
|
||||||
CurrentCluster = 0xffffffff;
|
CurrentCluster = 0xffffffff;
|
||||||
|
|
||||||
|
ASSERT(CurrentCluster != 0);
|
||||||
CcUnpinData(Context);
|
CcUnpinData(Context);
|
||||||
*NextCluster = CurrentCluster;
|
*NextCluster = CurrentCluster;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -80,6 +81,7 @@ FAT16GetNextCluster(
|
||||||
CurrentCluster = *((PUSHORT)((char*)BaseAddress + (FATOffset % ChunkSize)));
|
CurrentCluster = *((PUSHORT)((char*)BaseAddress + (FATOffset % ChunkSize)));
|
||||||
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
|
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
|
||||||
CurrentCluster = 0xffffffff;
|
CurrentCluster = 0xffffffff;
|
||||||
|
ASSERT(CurrentCluster != 0);
|
||||||
CcUnpinData(Context);
|
CcUnpinData(Context);
|
||||||
*NextCluster = CurrentCluster;
|
*NextCluster = CurrentCluster;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -123,6 +125,7 @@ FAT12GetNextCluster(
|
||||||
Entry = 0xffffffff;
|
Entry = 0xffffffff;
|
||||||
|
|
||||||
// DPRINT("Returning %x\n",Entry);
|
// DPRINT("Returning %x\n",Entry);
|
||||||
|
ASSERT(Entry != 0);
|
||||||
*NextCluster = Entry;
|
*NextCluster = Entry;
|
||||||
CcUnpinData(Context);
|
CcUnpinData(Context);
|
||||||
// return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
|
// return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
|
||||||
|
@ -667,7 +670,10 @@ GetNextCluster(
|
||||||
DeviceExt, CurrentCluster);
|
DeviceExt, CurrentCluster);
|
||||||
|
|
||||||
if (CurrentCluster == 0)
|
if (CurrentCluster == 0)
|
||||||
|
{
|
||||||
|
ASSERT(CurrentCluster != 0);
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
ExAcquireResourceSharedLite(&DeviceExt->FatResource, TRUE);
|
ExAcquireResourceSharedLite(&DeviceExt->FatResource, TRUE);
|
||||||
Status = DeviceExt->GetNextCluster(DeviceExt, CurrentCluster, NextCluster);
|
Status = DeviceExt->GetNextCluster(DeviceExt, CurrentCluster, NextCluster);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue