Author: pschweitzer
Date: Fri Feb 17 11:38:05 2017
New Revision: 73808
URL:
http://svn.reactos.org/svn/reactos?rev=73808&view=rev
Log:
[FASTFAT]
Thomas->happiness++;
Modified:
trunk/reactos/drivers/filesystems/fastfat/finfo.c
trunk/reactos/drivers/filesystems/fastfat/rw.c
Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Fri Feb 17 11:38:05
2017
@@ -97,7 +97,7 @@
StandardInfo->Directory = FALSE;
}
StandardInfo->NumberOfLinks = 1;
- StandardInfo->DeletePending = BooleanFlagOn(FCB->Flags, FCB_DELETE_PENDING) ?
TRUE : FALSE;
+ StandardInfo->DeletePending = BooleanFlagOn(FCB->Flags, FCB_DELETE_PENDING);
*BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
return STATUS_SUCCESS;
@@ -165,7 +165,7 @@
/* Check volume label bit */
ASSERT(0 == (*FCB->Attributes & _A_VOLID));
- if (FCB->Flags & FCB_IS_FATX_ENTRY)
+ if (BooleanFlagOn(FCB->Flags, FCB_IS_FATX_ENTRY))
{
if (BasicInfo->CreationTime.QuadPart != 0 &&
BasicInfo->CreationTime.QuadPart != -1)
{
@@ -254,7 +254,7 @@
if (*BufferLength < sizeof(FILE_BASIC_INFORMATION))
return STATUS_BUFFER_OVERFLOW;
- if (FCB->Flags & FCB_IS_FATX_ENTRY)
+ if (BooleanFlagOn(FCB->Flags, FCB_IS_FATX_ENTRY))
{
FsdDosDateTimeToSystemTime(DeviceExt,
FCB->entry.FatX.CreationDate,
@@ -331,7 +331,7 @@
return STATUS_SUCCESS;
}
- if (FCB->Flags & FCB_DELETE_PENDING)
+ if (BooleanFlagOn(FCB->Flags, FCB_DELETE_PENDING))
{
/* stream already marked for deletion. just update the file object */
FileObject->DeletePending = TRUE;
@@ -1043,7 +1043,7 @@
if (*BufferLength < sizeof(FILE_NETWORK_OPEN_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
- if (Fcb->Flags & FCB_IS_FATX_ENTRY)
+ if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
{
FsdDosDateTimeToSystemTime(DeviceExt,
Fcb->entry.FatX.CreationDate,
@@ -1196,7 +1196,7 @@
}
if (!vfatFCBIsDirectory(Fcb))
{
- if (Fcb->Flags & FCB_IS_FATX_ENTRY)
+ if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
Fcb->entry.FatX.FileSize = Size;
else
Fcb->entry.Fat.FileSize = Size;
@@ -1221,12 +1221,12 @@
ULONG ClusterSize = DeviceExt->FatInfo.BytesPerCluster;
ULONG NewSize = AllocationSize->u.LowPart;
ULONG NCluster;
- BOOLEAN AllocSizeChanged = FALSE;
+ BOOLEAN AllocSizeChanged = FALSE, IsFatX = BooleanFlagOn(Fcb->Flags,
FCB_IS_FATX_ENTRY);
DPRINT("VfatSetAllocationSizeInformation(File <%wZ>, AllocationSize %d
%u)\n",
&Fcb->PathNameU, AllocationSize->HighPart,
AllocationSize->LowPart);
- if (Fcb->Flags & FCB_IS_FATX_ENTRY)
+ if (IsFatX)
OldSize = Fcb->entry.FatX.FileSize;
else
OldSize = Fcb->entry.Fat.FileSize;
@@ -1278,7 +1278,7 @@
return STATUS_DISK_FULL;
}
- if (Fcb->Flags & FCB_IS_FATX_ENTRY)
+ if (IsFatX)
{
Fcb->entry.FatX.FirstCluster = FirstCluster;
}
@@ -1378,7 +1378,7 @@
}
else
{
- if (Fcb->Flags & FCB_IS_FATX_ENTRY)
+ if (IsFatX)
{
Fcb->entry.FatX.FirstCluster = 0;
}
@@ -1454,7 +1454,7 @@
SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer;
BufferLength = IrpContext->Stack->Parameters.QueryFile.Length;
- if (!(FCB->Flags & FCB_IS_PAGE_FILE))
+ if (!BooleanFlagOn(FCB->Flags, FCB_IS_PAGE_FILE))
{
if (!ExAcquireResourceSharedLite(&FCB->MainResource,
BooleanFlagOn(IrpContext->Flags,
IRPCONTEXT_CANWAIT)))
@@ -1532,7 +1532,7 @@
Status = STATUS_INVALID_PARAMETER;
}
- if (!(FCB->Flags & FCB_IS_PAGE_FILE))
+ if (!BooleanFlagOn(FCB->Flags, FCB_IS_PAGE_FILE))
{
ExReleaseResourceLite(&FCB->MainResource);
}
@@ -1607,7 +1607,7 @@
}
}
- if (!(FCB->Flags & FCB_IS_PAGE_FILE))
+ if (!BooleanFlagOn(FCB->Flags, FCB_IS_PAGE_FILE))
{
if (!ExAcquireResourceExclusiveLite(&FCB->MainResource,
BooleanFlagOn(IrpContext->Flags,
IRPCONTEXT_CANWAIT)))
@@ -1662,7 +1662,7 @@
Status = STATUS_NOT_SUPPORTED;
}
- if (!(FCB->Flags & FCB_IS_PAGE_FILE))
+ if (!BooleanFlagOn(FCB->Flags, FCB_IS_PAGE_FILE))
{
ExReleaseResourceLite(&FCB->MainResource);
}
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] Fri Feb 17 11:38:05 2017
@@ -547,7 +547,7 @@
LARGE_INTEGER ByteOffset;
PVOID Buffer;
ULONG BytesPerSector;
- BOOLEAN PagingIo, CanWait;
+ BOOLEAN PagingIo, CanWait, IsVolume;
ASSERT(IrpContext);
@@ -586,6 +586,7 @@
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);
/* fail if file is a directory and no paged read */
if (*Fcb->Attributes & FILE_ATTRIBUTE_DIRECTORY && !PagingIo)
@@ -596,7 +597,7 @@
DPRINT("'%wZ', Offset: %u, Length %u\n", &Fcb->PathNameU,
ByteOffset.u.LowPart, Length);
- if (ByteOffset.u.HighPart && !(Fcb->Flags & FCB_IS_VOLUME))
+ if (ByteOffset.u.HighPart && !IsVolume)
{
Status = STATUS_INVALID_PARAMETER;
goto ByeBye;
@@ -616,7 +617,7 @@
goto ByeBye;
}
- if (IrpContext->Irp->Flags & (IRP_PAGING_IO | IRP_NOCACHE) ||
(Fcb->Flags & FCB_IS_VOLUME))
+ if (IrpContext->Irp->Flags & (IRP_PAGING_IO | IRP_NOCACHE) || IsVolume)
{
if (ByteOffset.u.LowPart % BytesPerSector != 0 || Length % BytesPerSector != 0)
{
@@ -627,7 +628,7 @@
}
}
- if (Fcb->Flags & FCB_IS_VOLUME)
+ if (IsVolume)
{
Resource = &IrpContext->DeviceExt->DirResource;
}
@@ -770,7 +771,7 @@
ULONG Length = 0;
PVOID Buffer;
ULONG BytesPerSector;
- BOOLEAN PagingIo, CanWait;
+ BOOLEAN PagingIo, CanWait, IsVolume;
ASSERT(IrpContext);
@@ -806,6 +807,7 @@
PagingIo = BooleanFlagOn(IrpContext->Irp->Flags, IRP_PAGING_IO);
CanWait = BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT);
+ IsVolume = BooleanFlagOn(Fcb->Flags, FCB_IS_VOLUME);
/* fail if file is a directory and no paged read */
if (*Fcb->Attributes & FILE_ATTRIBUTE_DIRECTORY && !PagingIo)
@@ -823,7 +825,7 @@
Length = IrpContext->Stack->Parameters.Write.Length;
BytesPerSector = IrpContext->DeviceExt->FatInfo.BytesPerSector;
- if (ByteOffset.u.HighPart && !(Fcb->Flags & FCB_IS_VOLUME))
+ if (ByteOffset.u.HighPart && !IsVolume)
{
Status = STATUS_INVALID_PARAMETER;
goto ByeBye;
@@ -840,7 +842,7 @@
}
}
- if (IrpContext->Irp->Flags & (IRP_PAGING_IO|IRP_NOCACHE) || (Fcb->Flags
& FCB_IS_VOLUME))
+ if (IrpContext->Irp->Flags & (IRP_PAGING_IO|IRP_NOCACHE) || IsVolume)
{
if (ByteOffset.u.LowPart % BytesPerSector != 0 || Length % BytesPerSector != 0)
{
@@ -874,7 +876,7 @@
}
}
- if (Fcb->Flags & FCB_IS_VOLUME)
+ if (IsVolume)
{
Resource = &IrpContext->DeviceExt->DirResource;
}
@@ -916,7 +918,7 @@
}
}
- if (!CanWait && !(Fcb->Flags & FCB_IS_VOLUME))
+ if (!CanWait && !IsVolume)
{
if (ByteOffset.u.LowPart + Length > Fcb->RFCB.AllocationSize.u.LowPart)
{