Author: pschweitzer
Date: Sun Feb 19 11:22:21 2017
New Revision: 73836
URL:
http://svn.reactos.org/svn/reactos?rev=73836&view=rev
Log:
[FASTFAT]
Avoid uninit variable usage.
CID 1401257, 1401259
Modified:
trunk/reactos/drivers/filesystems/fastfat/rw.c
Modified: trunk/reactos/drivers/filesystems/fastfat/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/rw.c [iso-8859-1] Sun Feb 19 11:22:21 2017
@@ -555,6 +555,10 @@
ASSERT(IrpContext->DeviceObject);
+ PagingIo = BooleanFlagOn(IrpContext->Irp->Flags, IRP_PAGING_IO);
+ CanWait = BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT);
+ NoCache = BooleanFlagOn(IrpContext->Irp->Flags, IRP_NOCACHE);
+
// This request is not allowed on the main device object
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
{
@@ -567,6 +571,8 @@
ASSERT(IrpContext->FileObject);
Fcb = IrpContext->FileObject->FsContext;
ASSERT(Fcb);
+
+ IsVolume = BooleanFlagOn(Fcb->Flags, FCB_IS_VOLUME);
if (BooleanFlagOn(Fcb->Flags, FCB_IS_PAGE_FILE))
{
@@ -584,10 +590,6 @@
ByteOffset = IrpContext->Stack->Parameters.Read.ByteOffset;
Length = IrpContext->Stack->Parameters.Read.Length;
BytesPerSector = IrpContext->DeviceExt->FatInfo.BytesPerSector;
- PagingIo = BooleanFlagOn(IrpContext->Irp->Flags, IRP_PAGING_IO);
- CanWait = BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT);
- IsVolume = BooleanFlagOn(Fcb->Flags, FCB_IS_VOLUME);
- NoCache = BooleanFlagOn(IrpContext->Irp->Flags, IRP_NOCACHE);
/* fail if file is a directory and no paged read */
if (vfatFCBIsDirectory(Fcb) && !PagingIo)
@@ -779,6 +781,10 @@
ASSERT(IrpContext->DeviceObject);
+ PagingIo = BooleanFlagOn(IrpContext->Irp->Flags, IRP_PAGING_IO);
+ CanWait = BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT);
+ NoCache = BooleanFlagOn(IrpContext->Irp->Flags, IRP_NOCACHE);
+
// This request is not allowed on the main device object
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
{
@@ -791,6 +797,9 @@
ASSERT(IrpContext->FileObject);
Fcb = IrpContext->FileObject->FsContext;
ASSERT(Fcb);
+
+ IsVolume = BooleanFlagOn(Fcb->Flags, FCB_IS_VOLUME);
+ IsFAT = BooleanFlagOn(Fcb->Flags, FCB_IS_FAT);
if (BooleanFlagOn(Fcb->Flags, FCB_IS_PAGE_FILE))
{
@@ -804,12 +813,6 @@
}
DPRINT("<%wZ>\n", &Fcb->PathNameU);
-
- PagingIo = BooleanFlagOn(IrpContext->Irp->Flags, IRP_PAGING_IO);
- CanWait = BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT);
- IsVolume = BooleanFlagOn(Fcb->Flags, FCB_IS_VOLUME);
- IsFAT = BooleanFlagOn(Fcb->Flags, FCB_IS_FAT);
- NoCache = BooleanFlagOn(IrpContext->Irp->Flags, IRP_NOCACHE);
/* fail if file is a directory and no paged read */
if (vfatFCBIsDirectory(Fcb) && !PagingIo)