Author: pschweitzer
Date: Sat Feb 18 21:37:56 2017
New Revision: 73831
URL:
http://svn.reactos.org/svn/reactos?rev=73831&view=rev
Log:
[FASTFAT]
Get rid of the ENTRY_DELETED2, ENTRY_VOLUME2 and ENTRY_END2 macros.
Modified:
trunk/reactos/drivers/filesystems/fastfat/create.c
trunk/reactos/drivers/filesystems/fastfat/dirwr.c
trunk/reactos/drivers/filesystems/fastfat/fcb.c
trunk/reactos/drivers/filesystems/fastfat/fsctl.c
trunk/reactos/drivers/filesystems/fastfat/vfat.h
trunk/reactos/drivers/filesystems/fastfat/volume.c
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Sat Feb 18 21:37:56
2017
@@ -115,6 +115,7 @@
UNICODE_STRING PathNameU;
UNICODE_STRING FileToFindUpcase;
BOOLEAN WildCard;
+ BOOLEAN IsFatX = vfatVolumeIsFatX(DeviceExt);
DPRINT("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %u)\n",
Parent, FileToFindU, DirContext->DirIndex);
@@ -151,7 +152,7 @@
if (rcFcb)
{
ULONG startIndex = rcFcb->startIndex;
- if (vfatVolumeIsFatX(DeviceExt) && !vfatFCBIsRoot(Parent))
+ if (IsFatX && !vfatFCBIsRoot(Parent))
{
startIndex += 2;
}
@@ -194,7 +195,7 @@
{
break;
}
- if (ENTRY_VOLUME(DeviceExt, &DirContext->DirEntry))
+ if (ENTRY_VOLUME(IsFatX, &DirContext->DirEntry))
{
DirContext->DirIndex++;
continue;
Modified: trunk/reactos/drivers/filesystems/fastfat/dirwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] Sat Feb 18 21:37:56
2017
@@ -161,9 +161,10 @@
PVOID Context = NULL;
NTSTATUS Status;
ULONG SizeDirEntry;
+ BOOLEAN IsFatX = vfatVolumeIsFatX(DeviceExt);
FileOffset.QuadPart = 0;
- if (vfatVolumeIsFatX(DeviceExt))
+ if (IsFatX)
SizeDirEntry = sizeof(FATX_DIR_ENTRY);
else
SizeDirEntry = sizeof(FAT_DIR_ENTRY);
@@ -190,11 +191,11 @@
FileOffset.u.LowPart += DeviceExt->FatInfo.BytesPerCluster;
}
- if (ENTRY_END(DeviceExt, pFatEntry))
+ if (ENTRY_END(IsFatX, pFatEntry))
{
break;
}
- if (ENTRY_DELETED(DeviceExt, pFatEntry))
+ if (ENTRY_DELETED(IsFatX, pFatEntry))
{
nbFree++;
}
@@ -249,7 +250,7 @@
}
_SEH2_END;
- if (vfatVolumeIsFatX(DeviceExt))
+ if (IsFatX)
memset(pFatEntry, 0xff, DeviceExt->FatInfo.BytesPerCluster);
else
RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster);
@@ -268,7 +269,7 @@
}
_SEH2_END;
- if (vfatVolumeIsFatX(DeviceExt))
+ if (IsFatX)
memset(pFatEntry, 0xff, SizeDirEntry);
else
RtlZeroMemory(pFatEntry, SizeDirEntry);
Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Sat Feb 18 21:37:56 2017
@@ -778,6 +778,7 @@
WCHAR ShortNameBuffer[13];
BOOLEAN FoundLong = FALSE;
BOOLEAN FoundShort = FALSE;
+ BOOLEAN IsFatX = vfatVolumeIsFatX(pDeviceExt);
ASSERT(pDeviceExt);
ASSERT(pDirectoryFCB);
@@ -816,7 +817,7 @@
DPRINT(" Index:%u longName:%wZ\n",
DirContext.DirIndex, &DirContext.LongNameU);
- if (!ENTRY_VOLUME(pDeviceExt, &DirContext.DirEntry))
+ if (!ENTRY_VOLUME(IsFatX, &DirContext.DirEntry))
{
if (DirContext.LongNameU.Length == 0 ||
DirContext.ShortNameU.Length == 0)
Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Sat Feb 18 21:37:56
2017
@@ -431,7 +431,7 @@
{
while (TRUE)
{
- if (ENTRY_VOLUME2(IsFatX, Entry))
+ if (ENTRY_VOLUME(IsFatX, Entry))
{
/* copy volume label */
if (IsFatX)
@@ -446,7 +446,7 @@
}
break;
}
- if (ENTRY_END2(IsFatX, Entry))
+ if (ENTRY_END(IsFatX, Entry))
{
break;
}
Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Sat Feb 18 21:37:56
2017
@@ -197,13 +197,9 @@
#define LONGNAME_MAX_LENGTH 256 // max length for a long filename
-#define ENTRY_DELETED(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ?
FATX_ENTRY_DELETED(&((DirEntry)->FatX)) :
FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
-#define ENTRY_VOLUME(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ?
FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) :
FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
-#define ENTRY_END(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ?
FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
-
-#define ENTRY_DELETED2(IsFatX, DirEntry) (IsFatX ?
FATX_ENTRY_DELETED(&((DirEntry)->FatX)) :
FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
-#define ENTRY_VOLUME2(IsFatX, DirEntry) (IsFatX ?
FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) :
FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
-#define ENTRY_END2(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_END(&((DirEntry)->FatX))
: FAT_ENTRY_END(&((DirEntry)->Fat)))
+#define ENTRY_DELETED(IsFatX, DirEntry) (IsFatX ?
FATX_ENTRY_DELETED(&((DirEntry)->FatX)) :
FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
+#define ENTRY_VOLUME(IsFatX, DirEntry) (IsFatX ?
FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) :
FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
+#define ENTRY_END(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_END(&((DirEntry)->FatX))
: FAT_ENTRY_END(&((DirEntry)->Fat)))
#define FAT_ENTRY_DELETED(DirEntry) ((DirEntry)->Filename[0] == 0xe5)
#define FAT_ENTRY_END(DirEntry) ((DirEntry)->Filename[0] == 0)
Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] Sat Feb 18 21:37:56
2017
@@ -250,17 +250,19 @@
CHAR cString[43];
ULONG SizeDirEntry;
ULONG EntriesPerPage;
+ BOOLEAN IsFatX;
DPRINT("FsdSetFsLabelInformation()\n");
DeviceExt = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ IsFatX = vfatVolumeIsFatX(DeviceExt);
if (sizeof(DeviceObject->Vpb->VolumeLabel) <
FsLabelInfo->VolumeLabelLength)
{
return STATUS_NAME_TOO_LONG;
}
- if (vfatVolumeIsFatX(DeviceExt))
+ if (IsFatX)
{
if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 42)
return STATUS_NAME_TOO_LONG;
@@ -289,7 +291,7 @@
if (!NT_SUCCESS(Status))
return Status;
- if (vfatVolumeIsFatX(DeviceExt))
+ if (IsFatX)
{
RtlCopyMemory(VolumeLabelDirEntry.FatX.Filename, cString, LabelLen);
memset(&VolumeLabelDirEntry.FatX.Filename[LabelLen], ' ', 42 -
LabelLen);
@@ -328,7 +330,7 @@
{
while (TRUE)
{
- if (ENTRY_VOLUME(DeviceExt, Entry))
+ if (ENTRY_VOLUME(IsFatX, Entry))
{
/* Update entry */
LabelFound = TRUE;
@@ -338,7 +340,7 @@
break;
}
- if (ENTRY_END(DeviceExt, Entry))
+ if (ENTRY_END(IsFatX, Entry))
{
break;
}