From e2dd45fd4a5a1104bd2b3d2ef6e2db0a86665011 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 20 Aug 2003 21:58:06 +0000 Subject: [PATCH] Use FAT16 for partitions smaller than 512MB and FAT32 for larger ones. svn path=/trunk/; revision=5716 --- reactos/lib/fslib/vfatlib/vfatlib.c | 8 ++++++++ reactos/subsys/system/usetup/usetup.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/reactos/lib/fslib/vfatlib/vfatlib.c b/reactos/lib/fslib/vfatlib/vfatlib.c index b2a27332d06..d466e581d4c 100755 --- a/reactos/lib/fslib/vfatlib/vfatlib.c +++ b/reactos/lib/fslib/vfatlib/vfatlib.c @@ -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) { diff --git a/reactos/subsys/system/usetup/usetup.c b/reactos/subsys/system/usetup/usetup.c index 42d678cd086..5765eb73af4 100644 --- a/reactos/subsys/system/usetup/usetup.c +++ b/reactos/subsys/system/usetup/usetup.c @@ -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;