Author: pschweitzer
Date: Mon Feb  6 19:43:48 2017
New Revision: 73733

URL: http://svn.reactos.org/svn/reactos?rev=73733&view=rev
Log:
[FASTFAT]
Take the volume label into account when comparing the FAT volumes in case of a 
verify.
This helps avoiding remounting every removable device on verify. Current hack 
is only kept for FATX volumes for now.

Modified:
    trunk/reactos/drivers/filesystems/fastfat/fsctl.c
    trunk/reactos/drivers/filesystems/fastfat/vfat.h

Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/fsctl.c?rev=73733&r1=73732&r2=73733&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fsctl.c   [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c   [iso-8859-1] Mon Feb  6 
19:43:48 2017
@@ -220,6 +220,7 @@
                     DPRINT("FAT12\n");
                     FatInfo.FatType = FAT12;
                     FatInfo.RootCluster = (FatInfo.rootStart - 1) / 
FatInfo.SectorsPerCluster;
+                    RtlCopyMemory(&FatInfo.VolumeLabel, &Boot->VolumeLabel, 
sizeof(FatInfo.VolumeLabel));
                 }
                 else if (FatInfo.NumberOfClusters >= 65525)
                 {
@@ -228,12 +229,14 @@
                     FatInfo.RootCluster = ((struct _BootSector32*) 
Boot)->RootCluster;
                     FatInfo.rootStart = FatInfo.dataStart + 
((FatInfo.RootCluster - 2) * FatInfo.SectorsPerCluster);
                     FatInfo.VolumeID = ((struct _BootSector32*) 
Boot)->VolumeID;
+                    RtlCopyMemory(&FatInfo.VolumeLabel, &((struct 
_BootSector32*)Boot)->VolumeLabel, sizeof(FatInfo.VolumeLabel));
                 }
                 else
                 {
                     DPRINT("FAT16\n");
                     FatInfo.FatType = FAT16;
                     FatInfo.RootCluster = FatInfo.rootStart / 
FatInfo.SectorsPerCluster;
+                    RtlCopyMemory(&FatInfo.VolumeLabel, &Boot->VolumeLabel, 
sizeof(FatInfo.VolumeLabel));
                 }
 
                 if (PartitionInfoIsValid &&
@@ -653,7 +656,7 @@
              *   Each write to the root directory must update this crc sum.
              */
             /* HACK */
-            if (!FatInfo.FixedMedia)
+            if (!FatInfo.FixedMedia && FatInfo.FatType >= FATX16)
             {
                 Status = STATUS_WRONG_VOLUME;
             }

Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/vfat.h?rev=73733&r1=73732&r2=73733&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/vfat.h    [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/vfat.h    [iso-8859-1] Mon Feb  6 
19:43:48 2017
@@ -241,6 +241,7 @@
 typedef struct
 {
     ULONG VolumeID;
+    CHAR VolumeLabel[11];
     ULONG FATStart;
     ULONG FATCount;
     ULONG FATSectors;


Reply via email to