[USETUP]
authorEric Kohl <eric.kohl@reactos.org>
Fri, 11 Jun 2010 04:13:29 +0000 (04:13 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 11 Jun 2010 04:13:29 +0000 (04:13 +0000)
- Set the type of the install partition even if it was not created by usetup.
This fixes bug #4368.

svn path=/trunk/; revision=47751

reactos/base/setup/usetup/interface/usetup.c

index 57b4efc..a845d5d 100644 (file)
@@ -2310,56 +2310,53 @@ FormatPartitionPage (PINPUT_RECORD Ir)
         {
             CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
 
-            if (PartEntry->PartInfo[PartNum].PartitionType == PARTITION_ENTRY_UNUSED)
+            if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") == 0)
             {
-                if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") == 0)
+                if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (4200LL * 1024LL))
+                {
+                    /* FAT12 CHS partition (disk is smaller than 4.1MB) */
+                    PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT_12;
+                }
+                else if (PartEntry->PartInfo[PartNum].StartingOffset.QuadPart < (1024LL * 255LL * 63LL * 512LL))
                 {
-                    if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (4200LL * 1024LL))
+                    /* Partition starts below the 8.4GB boundary ==> CHS partition */
+
+                    if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (32LL * 1024LL * 1024LL))
                     {
-                        /* FAT12 CHS partition (disk is smaller than 4.1MB) */
-                        PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT_12;
+                        /* FAT16 CHS partition (partiton size < 32MB) */
+                        PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT_16;
                     }
-                    else if (PartEntry->PartInfo[PartNum].StartingOffset.QuadPart < (1024LL * 255LL * 63LL * 512LL))
+                    else if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL))
                     {
-                        /* Partition starts below the 8.4GB boundary ==> CHS partition */
-
-                        if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (32LL * 1024LL * 1024LL))
-                        {
-                            /* FAT16 CHS partition (partiton size < 32MB) */
-                            PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT_16;
-                        }
-                        else if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL))
-                        {
-                            /* FAT16 CHS partition (partition size < 512MB) */
-                            PartEntry->PartInfo[PartNum].PartitionType = PARTITION_HUGE;
-                        }
-                        else
-                        {
-                            /* FAT32 CHS partition (partition size >= 512MB) */
-                            PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT32;
-                        }
+                        /* FAT16 CHS partition (partition size < 512MB) */
+                        PartEntry->PartInfo[PartNum].PartitionType = PARTITION_HUGE;
                     }
                     else
                     {
-                        /* Partition starts above the 8.4GB boundary ==> LBA partition */
-
-                        if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL))
-                        {
-                            /* FAT16 LBA partition (partition size < 512MB) */
-                            PartEntry->PartInfo[PartNum].PartitionType = PARTITION_XINT13;
-                        }
-                        else
-                        {
-                            /* FAT32 LBA partition (partition size >= 512MB) */
-                            PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT32_XINT13;
-                        }
+                        /* FAT32 CHS partition (partition size >= 512MB) */
+                        PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT32;
+                    }
+                }
+                else
+                {
+                    /* Partition starts above the 8.4GB boundary ==> LBA partition */
+
+                    if (PartEntry->PartInfo[PartNum].PartitionLength.QuadPart < (512LL * 1024LL * 1024LL))
+                    {
+                        /* FAT16 LBA partition (partition size < 512MB) */
+                        PartEntry->PartInfo[PartNum].PartitionType = PARTITION_XINT13;
+                    }
+                    else
+                    {
+                        /* FAT32 LBA partition (partition size >= 512MB) */
+                        PartEntry->PartInfo[PartNum].PartitionType = PARTITION_FAT32_XINT13;
                     }
                 }
-                else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0)
-                    PartEntry->PartInfo[PartNum].PartitionType = PARTITION_EXT2;
-                else if (!FileSystemList->Selected->FormatFunc)
-                    return QUIT_PAGE;
             }
+            else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0)
+                PartEntry->PartInfo[PartNum].PartitionType = PARTITION_EXT2;
+            else if (!FileSystemList->Selected->FormatFunc)
+                return QUIT_PAGE;
 
             CheckActiveBootPartition (PartitionList);