mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[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. svn path=/trunk/; revision=73733
This commit is contained in:
parent
1566f90e46
commit
6e89272bef
2 changed files with 5 additions and 1 deletions
|
@ -220,6 +220,7 @@ VfatHasFileSystem(
|
|||
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 @@ VfatHasFileSystem(
|
|||
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 @@ VfatVerify(
|
|||
* 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;
|
||||
}
|
||||
|
|
|
@ -241,6 +241,7 @@ typedef union _DIR_ENTRY DIR_ENTRY, *PDIR_ENTRY;
|
|||
typedef struct
|
||||
{
|
||||
ULONG VolumeID;
|
||||
CHAR VolumeLabel[11];
|
||||
ULONG FATStart;
|
||||
ULONG FATCount;
|
||||
ULONG FATSectors;
|
||||
|
|
Loading…
Reference in a new issue