Use FAT16 for partitions smaller than 512MB and FAT32 for larger ones.

svn path=/trunk/; revision=5716
This commit is contained in:
Eric Kohl 2003-08-20 21:58:06 +00:00
parent a5e1765aa6
commit e2dd45fd4a
2 changed files with 11 additions and 3 deletions

View file

@ -426,6 +426,14 @@ VfatFormat(
return Status;
}
if (PartitionInfo.PartitionLength.QuadPart < 512ULL * 1024ULL * 1024ULL)
{
DPRINT1("FIXME: Partition size is smaller than 512MB - use FAT16\n");
NtClose(FileHandle);
return STATUS_UNSUCCESSFUL;
}
/* Calculate cluster size */
if (ClusterSize == 0)
{

View file

@ -1596,16 +1596,16 @@ FormatPartitionPage (PINPUT_RECORD Ir)
PartEntry->PartInfo[0].PartitionType = PARTITION_HUGE;
}
}
else if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (2ULL * 1024ULL * 1024ULL * 1024ULL))
else if (PartEntry->PartInfo[0].PartitionLength.QuadPart < (512ULL * 1024ULL * 1024ULL))
{
/* FAT16 LBA partition (partition is smaller than 2GB) */
/* FAT16 LBA partition (partition size is smaller than 512MB) */
DPRINT1("%x\n", PartEntry->PartInfo[0].PartitionType);
PartEntry->PartInfo[0].PartitionType = PARTITION_XINT13;
}
else
{
DPRINT1("%x\n", PartEntry->PartInfo[0].PartitionType);
/* FAT32 LBA partition (partition is at least 2GB) */
/* FAT32 LBA partition (partition size 512MB or larger) */
PartEntry->PartInfo[0].PartitionType = PARTITION_FAT32_XINT13;
}
break;