if (FirstCluster == 0)
{
DbgPrint("OffsetToCluster is called with FirstCluster = 0!\n");
- KEBUGCHECK(0);
+ ASSERT(FALSE);
}
if (FirstCluster == 1)
PDEVICE_EXTENSION DeviceExt;
BOOLEAN First = TRUE;
PVFATFCB Fcb;
- PVFATCCB Ccb;
NTSTATUS Status;
ULONG BytesDone;
ULONG BytesPerSector;
*LengthRead = 0;
- Ccb = (PVFATCCB)IrpContext->FileObject->FsContext2;
Fcb = IrpContext->FileObject->FsContext;
BytesPerSector = DeviceExt->FatInfo.BytesPerSector;
BytesPerCluster = DeviceExt->FatInfo.BytesPerCluster;
if (FirstCluster == 1)
{
// Directory of FAT12/16 needs a special handling
- CHECKPOINT;
if (ReadOffset.u.LowPart + Length > DeviceExt->FatInfo.rootDirectorySectors * BytesPerSector)
{
Length = DeviceExt->FatInfo.rootDirectorySectors * BytesPerSector - ReadOffset.u.LowPart;
ROUND_DOWN(ReadOffset.u.LowPart, BytesPerCluster),
&CorrectCluster, FALSE);
if (CorrectCluster != CurrentCluster)
- KEBUGCHECK(FAT_FILE_SYSTEM);
+ KeBugCheck(FAT_FILE_SYSTEM);
}
#endif
}
{
PDEVICE_EXTENSION DeviceExt;
PVFATFCB Fcb;
- PVFATCCB Ccb;
ULONG Count;
ULONG FirstCluster;
ULONG CurrentCluster;
ASSERT(IrpContext->FileObject);
ASSERT(IrpContext->FileObject->FsContext2 != NULL);
- Ccb = (PVFATCCB)IrpContext->FileObject->FsContext2;
Fcb = IrpContext->FileObject->FsContext;
BytesPerCluster = DeviceExt->FatInfo.BytesPerCluster;
BytesPerSector = DeviceExt->FatInfo.BytesPerSector;
ROUND_DOWN(WriteOffset.u.LowPart, BytesPerCluster),
&CorrectCluster, FALSE);
if (CorrectCluster != CurrentCluster)
- KEBUGCHECK(FAT_FILE_SYSTEM);
+ KeBugCheck(FAT_FILE_SYSTEM);
}
#endif
}
!(Fcb->Flags & (FCB_IS_PAGE_FILE|FCB_IS_VOLUME)))
{
// cached read
- CHECKPOINT;
Status = STATUS_SUCCESS;
if (ByteOffset.u.LowPart + Length > Fcb->RFCB.FileSize.u.LowPart)
{
Status = /*STATUS_END_OF_FILE*/STATUS_SUCCESS;
}
- CHECKPOINT;
if (IrpContext->FileObject->PrivateCacheMap == NULL)
{
-#ifdef USE_ROS_CC_AND_FS
- ULONG CacheSize;
- CacheSize = max(IrpContext->DeviceExt->FatInfo.BytesPerCluster,
- 8 * PAGE_SIZE);
- CcRosInitializeFileCache(IrpContext->FileObject, CacheSize);
-#else
- /* FIXME: Guard by SEH. */
CcInitializeCacheMap(IrpContext->FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
&(VfatGlobalData->CacheMgrCallbacks),
Fcb);
-#endif
}
if (!CcCopyRead(IrpContext->FileObject, &ByteOffset, Length,
(BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT), Buffer,
&IrpContext->Irp->IoStatus))
{
- Status = IrpContext->Irp->IoStatus.Status;//STATUS_PENDING;
+ Status = STATUS_PENDING;
goto ByeBye;
}
- CHECKPOINT;
if (!NT_SUCCESS(IrpContext->Irp->IoStatus.Status))
{
Status = IrpContext->Irp->IoStatus.Status;
else
{
// non cached read
- CHECKPOINT;
if (ByteOffset.QuadPart + Length > ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector))
{
Length = (ULONG)(ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector) - ByteOffset.QuadPart);
IrpContext->DeviceExt, &AllocationSize);
if (!NT_SUCCESS (Status))
{
- CHECKPOINT;
goto ByeBye;
}
}
!(Fcb->Flags & (FCB_IS_PAGE_FILE|FCB_IS_VOLUME)))
{
// cached write
- CHECKPOINT;
if (IrpContext->FileObject->PrivateCacheMap == NULL)
{
-#ifdef USE_ROS_CC_AND_FS
- ULONG CacheSize;
- CacheSize = max(IrpContext->DeviceExt->FatInfo.BytesPerCluster,
- 8 * PAGE_SIZE);
- CcRosInitializeFileCache(IrpContext->FileObject, CacheSize);
-#else
- /* FIXME: Guard by SEH. */
CcInitializeCacheMap(IrpContext->FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
&VfatGlobalData->CacheMgrCallbacks,
Fcb);
-#endif
}
if (ByteOffset.QuadPart > OldFileSize.QuadPart)
{
{
Status = STATUS_UNSUCCESSFUL;
}
- CHECKPOINT;
}
else
{
// non cached write
- CHECKPOINT;
if (ByteOffset.QuadPart > OldFileSize.QuadPart)
{