mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Reverted parts of the last changes. Vfat must always check the partition type if it is available.
svn path=/trunk/; revision=13032
This commit is contained in:
parent
3360f1a1ae
commit
1edc02642e
1 changed files with 37 additions and 2 deletions
|
@ -86,6 +86,35 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
PartitionInfoIsValid = TRUE;
|
PartitionInfoIsValid = TRUE;
|
||||||
|
DPRINT("Partition Information:\n");
|
||||||
|
DPRINT("StartingOffset %u\n", PartitionInfo.StartingOffset.QuadPart / 512);
|
||||||
|
DPRINT("PartitionLength %u\n", PartitionInfo.PartitionLength.QuadPart / 512);
|
||||||
|
DPRINT("HiddenSectors %u\n", PartitionInfo.HiddenSectors);
|
||||||
|
DPRINT("PartitionNumber %u\n", PartitionInfo.PartitionNumber);
|
||||||
|
DPRINT("PartitionType %u\n", PartitionInfo.PartitionType);
|
||||||
|
DPRINT("BootIndicator %u\n", PartitionInfo.BootIndicator);
|
||||||
|
DPRINT("RecognizedPartition %u\n", PartitionInfo.RecognizedPartition);
|
||||||
|
DPRINT("RewritePartition %u\n", PartitionInfo.RewritePartition);
|
||||||
|
if (PartitionInfo.PartitionType)
|
||||||
|
{
|
||||||
|
if (PartitionInfo.PartitionType == PARTITION_FAT_12 ||
|
||||||
|
PartitionInfo.PartitionType == PARTITION_FAT_16 ||
|
||||||
|
PartitionInfo.PartitionType == PARTITION_HUGE ||
|
||||||
|
PartitionInfo.PartitionType == PARTITION_FAT32 ||
|
||||||
|
PartitionInfo.PartitionType == PARTITION_FAT32_XINT13 ||
|
||||||
|
PartitionInfo.PartitionType == PARTITION_XINT13)
|
||||||
|
{
|
||||||
|
*RecognizedFS = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (DiskGeometry.MediaType == RemovableMedia &&
|
||||||
|
PartitionInfo.PartitionNumber > 0 &&
|
||||||
|
PartitionInfo.StartingOffset.QuadPart == 0LL &&
|
||||||
|
PartitionInfo.PartitionLength.QuadPart > 0LL)
|
||||||
|
{
|
||||||
|
/* This is possible a removable media formated as super floppy */
|
||||||
|
*RecognizedFS = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (DiskGeometry.MediaType == Unknown)
|
else if (DiskGeometry.MediaType == Unknown)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +126,14 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
*RecognizedFS = TRUE;
|
*RecognizedFS = TRUE;
|
||||||
DiskGeometry.BytesPerSector = 512;
|
DiskGeometry.BytesPerSector = 512;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*RecognizedFS = TRUE;
|
||||||
|
}
|
||||||
|
if (*RecognizedFS == FALSE)
|
||||||
|
{
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
Boot = ExAllocatePool(NonPagedPool, DiskGeometry.BytesPerSector);
|
Boot = ExAllocatePool(NonPagedPool, DiskGeometry.BytesPerSector);
|
||||||
if (Boot == NULL)
|
if (Boot == NULL)
|
||||||
|
@ -110,8 +147,6 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
Status = VfatReadDisk(DeviceToMount, &Offset, DiskGeometry.BytesPerSector, (PUCHAR) Boot, FALSE);
|
Status = VfatReadDisk(DeviceToMount, &Offset, DiskGeometry.BytesPerSector, (PUCHAR) Boot, FALSE);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
*RecognizedFS = TRUE;
|
|
||||||
|
|
||||||
if (Boot->Signatur1 != 0xaa55)
|
if (Boot->Signatur1 != 0xaa55)
|
||||||
{
|
{
|
||||||
*RecognizedFS = FALSE;
|
*RecognizedFS = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue