[USETUP]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 4 Jan 2015 13:53:45 +0000 (13:53 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 4 Jan 2015 13:53:45 +0000 (13:53 +0000)
- Revert partiton code to pre-r65855.

svn path=/trunk/; revision=65969

32 files changed:
reactos/base/setup/usetup/fslist.c
reactos/base/setup/usetup/fslist.h
reactos/base/setup/usetup/host.h
reactos/base/setup/usetup/interface/usetup.c
reactos/base/setup/usetup/lang/bg-BG.h
reactos/base/setup/usetup/lang/bn-BD.h
reactos/base/setup/usetup/lang/cs-CZ.h
reactos/base/setup/usetup/lang/de-DE.h
reactos/base/setup/usetup/lang/el-GR.h
reactos/base/setup/usetup/lang/en-US.h
reactos/base/setup/usetup/lang/es-ES.h
reactos/base/setup/usetup/lang/et-EE.h
reactos/base/setup/usetup/lang/fr-FR.h
reactos/base/setup/usetup/lang/he-IL.h
reactos/base/setup/usetup/lang/it-IT.h
reactos/base/setup/usetup/lang/ja-JP.h
reactos/base/setup/usetup/lang/lt-LT.h
reactos/base/setup/usetup/lang/nl-NL.h
reactos/base/setup/usetup/lang/pl-PL.h
reactos/base/setup/usetup/lang/pt-BR.h
reactos/base/setup/usetup/lang/ro-RO.h
reactos/base/setup/usetup/lang/ru-RU.h
reactos/base/setup/usetup/lang/sk-SK.h
reactos/base/setup/usetup/lang/sq-AL.h
reactos/base/setup/usetup/lang/sv-SE.h
reactos/base/setup/usetup/lang/tr-TR.h
reactos/base/setup/usetup/lang/uk-UA.h
reactos/base/setup/usetup/mui.h
reactos/base/setup/usetup/native/fslist.c
reactos/base/setup/usetup/partlist.c
reactos/base/setup/usetup/partlist.h
reactos/base/setup/usetup/usetup.h

index 0fe7ae1..1aa6609 100644 (file)
@@ -71,8 +71,7 @@ CreateFileSystemList(
     IN SHORT Left,
     IN SHORT Top,
     IN BOOLEAN ForceFormat,
-    IN LPCWSTR ForceFileSystem,
-    IN UCHAR PartitionType)
+    IN LPCWSTR ForceFileSystem)
 {
     PFILE_SYSTEM_LIST List;
     PFILE_SYSTEM_ITEM Item;
@@ -87,7 +86,7 @@ CreateFileSystemList(
     List->Selected = NULL;
     InitializeListHead(&List->ListHead);
 
-    HOST_CreateFileSystemList(List, PartitionType);
+    HOST_CreateFileSystemList(List);
 
     if (!ForceFormat)
     {
index f0a2919..6b28e29 100644 (file)
@@ -57,8 +57,7 @@ CreateFileSystemList(
     IN SHORT Left,
     IN SHORT Top,
     IN BOOLEAN ForceFormat,
-    IN LPCWSTR ForceFileSystem,
-    IN UCHAR PartitionType);
+    IN LPCWSTR ForceFileSystem);
 
 VOID
 DestroyFileSystemList(
index 6a2ead8..6d8a84b 100644 (file)
@@ -22,8 +22,7 @@ HOST_InitMemory(VOID);
 
 BOOLEAN
 HOST_CreateFileSystemList(
-    IN PFILE_SYSTEM_LIST List,
-    IN UCHAR PartitionType);
+    IN PFILE_SYSTEM_LIST List);
 
 BOOLEAN
 HOST_FormatPartition(
index 2e5be07..5789b5b 100644 (file)
@@ -46,7 +46,6 @@ UNICODE_STRING SourceRootPath;
 UNICODE_STRING SourceRootDir;
 UNICODE_STRING SourcePath;
 BOOLEAN IsUnattendedSetup = FALSE;
-BOOLEAN InstallShortcut = FALSE;
 LONG UnattendDestinationDiskNumber;
 LONG UnattendDestinationPartitionNumber;
 LONG UnattendMBRInstallType = -1;
@@ -1602,27 +1601,24 @@ SelectPartitionPage(PINPUT_RECORD Ir)
             if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType))
                 continue; //return SELECT_PARTITION_PAGE;
 
-            if (!IsDiskSizeValid(PartitionList->CurrentPartition))
-            {
-                MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
-                                RequiredPartitionDiskSpace);
-                return SELECT_PARTITION_PAGE; /* let the user select another partition */
-            }
-
             if (PartitionList->CurrentPartition == NULL ||
                 PartitionList->CurrentPartition->IsPartitioned == FALSE)
             {
                 CreatePrimaryPartition(PartitionList,
                                        0ULL,
                                        TRUE);
-                InstallShortcut = TRUE;
+            }
 
-                return SELECT_FILE_SYSTEM_PAGE;
+            if (!IsDiskSizeValid(PartitionList->CurrentPartition))
+            {
+                MUIDisplayError(ERROR_INSUFFICIENT_PARTITION_SIZE, Ir, POPUP_WAIT_ANY_KEY,
+                                RequiredPartitionDiskSpace);
+                return SELECT_PARTITION_PAGE; /* let the user select another partition */
             }
 
             DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter;
 
-            return PRE_INSTALL_SELECT_FORMAT_PAGE;
+            return SELECT_FILE_SYSTEM_PAGE;
         }
         else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'P')  /* P */
         {
@@ -1964,7 +1960,7 @@ CreatePrimaryPartitionPage(PINPUT_RECORD Ir)
                                    SectorCount,
                                    FALSE);
 
-            return SELECT_FILE_SYSTEM_PAGE;
+            return SELECT_PARTITION_PAGE;
         }
     }
 
@@ -1985,7 +1981,6 @@ CreateExtendedPartitionPage(PINPUT_RECORD Ir)
     ULONGLONG DiskSize;
     ULONGLONG SectorCount;
     PCHAR Unit;
-    NTSTATUS Status;
 
     if (PartitionList == NULL ||
         PartitionList->CurrentDisk == NULL ||
@@ -2111,14 +2106,6 @@ CreateExtendedPartitionPage(PINPUT_RECORD Ir)
             CreateExtendedPartition(PartitionList,
                                     SectorCount);
 
-            Status = WriteDirtyPartitions(PartitionList);
-            if (!NT_SUCCESS(Status))
-            {
-                DPRINT("WriteDirtyPartitions() failed\n");
-                MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
-                return QUIT_PAGE;
-            }
-
             return SELECT_PARTITION_PAGE;
         }
     }
@@ -2265,7 +2252,7 @@ CreateLogicalPartitionPage(PINPUT_RECORD Ir)
             CreateLogicalPartition(PartitionList,
                                    SectorCount);
 
-            return SELECT_FILE_SYSTEM_PAGE;
+            return SELECT_PARTITION_PAGE;
         }
     }
 
@@ -2281,8 +2268,7 @@ DeletePartitionPage(PINPUT_RECORD Ir)
     ULONGLONG DiskSize;
     ULONGLONG PartSize;
     PCHAR Unit;
-    PCHAR PartType = NULL;
-    NTSTATUS Status;
+    PCHAR PartType;
 
     if (PartitionList == NULL ||
         PartitionList->CurrentDisk == NULL ||
@@ -2298,29 +2284,37 @@ DeletePartitionPage(PINPUT_RECORD Ir)
     MUIDisplayPage(DELETE_PARTITION_PAGE);
 
     /* Determine partition type */
-    if ((PartEntry->PartitionType == PARTITION_FAT_12) ||
-        (PartEntry->PartitionType == PARTITION_FAT_16) ||
-        (PartEntry->PartitionType == PARTITION_HUGE) ||
-        (PartEntry->PartitionType == PARTITION_XINT13))
-    {
-        PartType = "FAT";
-    }
-    else if ((PartEntry->PartitionType == PARTITION_FAT32) ||
-             (PartEntry->PartitionType == PARTITION_FAT32_XINT13))
-    {
-        PartType = "FAT32";
-    }
-    else if (PartEntry->PartitionType == PARTITION_EXT2)
-    {
-        PartType = "EXT2";
-    }
-    else if (PartEntry->PartitionType == PARTITION_IFS)
+    PartType = NULL;
+    if (PartEntry->New == TRUE)
     {
-        PartType = "NTFS"; /* FIXME: Not quite correct! */
+        PartType = MUIGetString(STRING_UNFORMATTED);
     }
-    else if (IsContainerPartition(PartEntry->PartitionType))
+    else if (PartEntry->IsPartitioned == TRUE)
     {
-        PartType = MUIGetString(STRING_EXTENDED_PARTITION);
+        if ((PartEntry->PartitionType == PARTITION_FAT_12) ||
+            (PartEntry->PartitionType == PARTITION_FAT_16) ||
+            (PartEntry->PartitionType == PARTITION_HUGE) ||
+            (PartEntry->PartitionType == PARTITION_XINT13))
+        {
+            PartType = "FAT";
+        }
+        else if ((PartEntry->PartitionType == PARTITION_FAT32) ||
+                 (PartEntry->PartitionType == PARTITION_FAT32_XINT13))
+        {
+            PartType = "FAT32";
+        }
+        else if (PartEntry->PartitionType == PARTITION_EXT2)
+        {
+            PartType = "EXT2";
+        }
+        else if (PartEntry->PartitionType == PARTITION_IFS)
+        {
+            PartType = "NTFS"; /* FIXME: Not quite correct! */
+        }
+        else if (IsContainerPartition(PartEntry->PartitionType))
+        {
+            PartType = MUIGetString(STRING_EXTENDED_PARTITION);
+        }
     }
 
     PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
@@ -2427,14 +2421,6 @@ DeletePartitionPage(PINPUT_RECORD Ir)
         {
             DeleteCurrentPartition(PartitionList);
 
-            Status = WriteDirtyPartitions(PartitionList);
-            if (!NT_SUCCESS(Status))
-            {
-                DPRINT("WriteDirtyPartitions() failed\n");
-                MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
-                return QUIT_PAGE;
-            }
-
             return SELECT_PARTITION_PAGE;
         }
     }
@@ -2443,67 +2429,6 @@ DeletePartitionPage(PINPUT_RECORD Ir)
 }
 
 
-static
-VOID
-UpdatePartitionType(
-    PPARTENTRY PartEntry,
-    LPCWSTR FileSystem)
-{
-    if (wcscmp(FileSystem, L"FAT") == 0)
-    {
-        if (PartEntry->SectorCount.QuadPart < 8192)
-        {
-            /* FAT12 CHS partition (disk is smaller than 4.1MB) */
-            PartEntry->PartitionType = PARTITION_FAT_12;
-        }
-        else if (PartEntry->StartSector.QuadPart < 1450560)
-        {
-            /* Partition starts below the 8.4GB boundary ==> CHS partition */
-
-            if (PartEntry->SectorCount.QuadPart < 65536)
-            {
-                /* FAT16 CHS partition (partiton size < 32MB) */
-                PartEntry->PartitionType = PARTITION_FAT_16;
-            }
-            else if (PartEntry->SectorCount.QuadPart < 1048576)
-            {
-                /* FAT16 CHS partition (partition size < 512MB) */
-                PartEntry->PartitionType = PARTITION_HUGE;
-            }
-            else
-            {
-                /* FAT32 CHS partition (partition size >= 512MB) */
-                PartEntry->PartitionType = PARTITION_FAT32;
-            }
-        }
-        else
-        {
-            /* Partition starts above the 8.4GB boundary ==> LBA partition */
-
-            if (PartEntry->SectorCount.QuadPart < 1048576)
-            {
-                /* FAT16 LBA partition (partition size < 512MB) */
-                PartEntry->PartitionType = PARTITION_XINT13;
-            }
-            else
-            {
-                /* FAT32 LBA partition (partition size >= 512MB) */
-                PartEntry->PartitionType = PARTITION_FAT32_XINT13;
-            }
-        }
-
-        PartEntry->DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType;
-    }
-#if 0
-    else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0)
-    {
-        PartEntry->PartitionType = PARTITION_EXT2;
-        PartEntry->DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType;
-    }
-#endif
-}
-
-
 static PAGE_NUMBER
 SelectFileSystemPage(PINPUT_RECORD Ir)
 {
@@ -2514,7 +2439,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
     PCHAR DiskUnit;
     PCHAR PartUnit;
     PCHAR PartType;
-    NTSTATUS Status;
 
     if (PartitionList == NULL ||
         PartitionList->CurrentDisk == NULL ||
@@ -2609,16 +2533,14 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
 
         PartEntry->AutoCreate = FALSE;
     }
-#if 0
     else if (PartEntry->New == TRUE)
     {
         CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NONFORMATTEDPART));
         CONSOLE_SetTextXY(6, 10, MUIGetString(STRING_PARTFORMAT));
     }
-#endif
     else
     {
-        CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_FORMATPART));
+        CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_INSTALLONPART));
 
         if (PartType == NULL)
         {
@@ -2655,12 +2577,14 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
 
     if (FileSystemList == NULL)
     {
-        FileSystemList = CreateFileSystemList(6, 26, TRUE, L"FAT", PARTITION_ENTRY_UNUSED);
+        FileSystemList = CreateFileSystemList(6, 26, PartEntry->New, L"FAT");
         if (FileSystemList == NULL)
         {
             /* FIXME: show an error dialog */
             return QUIT_PAGE;
         }
+
+        /* FIXME: Add file systems to list */
     }
 
     DrawFileSystemList(FileSystemList);
@@ -2675,19 +2599,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
     {
         if (UnattendFormatPartition)
         {
-            UpdatePartitionType(PartEntry,
-                                FileSystemList->Selected->FileSystem);
-
-            Status = WriteDirtyPartitions(PartitionList);
-            if (!NT_SUCCESS(Status))
-            {
-                DPRINT1("WriteDirtyPartitions() failed (Status 0x%08lx)\n", Status);
-                MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
-                DestroyFileSystemList(FileSystemList);
-                FileSystemList = NULL;
-                return QUIT_PAGE;
-            }
-
             return FORMAT_PARTITION_PAGE;
         }
 
@@ -2703,8 +2614,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
         {
             if (ConfirmQuit(Ir) == TRUE)
             {
-                DestroyFileSystemList(FileSystemList);
-                FileSystemList = NULL;
                 return QUIT_PAGE;
             }
 
@@ -2713,8 +2622,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
         else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
                  (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE))  /* ESC */
         {
-            DestroyFileSystemList(FileSystemList);
-            FileSystemList = NULL;
             return SELECT_PARTITION_PAGE;
         }
         else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
@@ -2735,19 +2642,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
             }
             else
             {
-                UpdatePartitionType(PartEntry,
-                                    FileSystemList->Selected->FileSystem);
-
-                CheckActiveBootPartition(PartitionList);
-
-                Status = WriteDirtyPartitions(PartitionList);
-                if (!NT_SUCCESS(Status))
-                {
-                    DPRINT("WriteDirtyPartitions() failed (Status 0x%08lx)\n", Status);
-                    MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
-                    return QUIT_PAGE;
-                }
-
                 return FORMAT_PARTITION_PAGE;
             }
         }
@@ -2761,7 +2655,7 @@ static ULONG
 FormatPartitionPage(PINPUT_RECORD Ir)
 {
     WCHAR PathBuffer[MAX_PATH];
-//    PDISKENTRY DiskEntry;
+    PDISKENTRY DiskEntry;
     PPARTENTRY PartEntry;
     NTSTATUS Status;
 
@@ -2778,12 +2672,10 @@ FormatPartitionPage(PINPUT_RECORD Ir)
         PartitionList->CurrentPartition == NULL)
     {
         /* FIXME: show an error dialog */
-        DestroyFileSystemList(FileSystemList);
-        FileSystemList = NULL;
         return QUIT_PAGE;
     }
 
-//    DiskEntry = PartitionList->CurrentDisk;
+    DiskEntry = PartitionList->CurrentDisk;
     PartEntry = PartitionList->CurrentPartition;
 
     while (TRUE)
@@ -2798,8 +2690,6 @@ FormatPartitionPage(PINPUT_RECORD Ir)
         {
             if (ConfirmQuit(Ir) == TRUE)
             {
-                DestroyFileSystemList(FileSystemList);
-                FileSystemList = NULL;
                 return QUIT_PAGE;
             }
 
@@ -2809,12 +2699,60 @@ FormatPartitionPage(PINPUT_RECORD Ir)
         {
             CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
 
-            if (!FileSystemList->Selected->FormatFunc)
+            if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") == 0)
             {
-                DestroyFileSystemList(FileSystemList);
-                FileSystemList = NULL;
-                return QUIT_PAGE;
+                if (PartEntry->SectorCount.QuadPart < 8192)
+                {
+                    /* FAT12 CHS partition (disk is smaller than 4.1MB) */
+                    PartEntry->PartitionType = PARTITION_FAT_12;
+                }
+                else if (PartEntry->StartSector.QuadPart < 1450560)
+                {
+                    /* Partition starts below the 8.4GB boundary ==> CHS partition */
+
+                    if (PartEntry->SectorCount.QuadPart < 65536)
+                    {
+                        /* FAT16 CHS partition (partiton size < 32MB) */
+                        PartEntry->PartitionType = PARTITION_FAT_16;
+                    }
+                    else if (PartEntry->SectorCount.QuadPart < 1048576)
+                    {
+                        /* FAT16 CHS partition (partition size < 512MB) */
+                        PartEntry->PartitionType = PARTITION_HUGE;
+                    }
+                    else
+                    {
+                        /* FAT32 CHS partition (partition size >= 512MB) */
+                        PartEntry->PartitionType = PARTITION_FAT32;
+                    }
+                }
+                else
+                {
+                    /* Partition starts above the 8.4GB boundary ==> LBA partition */
+
+                    if (PartEntry->SectorCount.QuadPart < 1048576)
+                    {
+                        /* FAT16 LBA partition (partition size < 512MB) */
+                        PartEntry->PartitionType = PARTITION_XINT13;
+                    }
+                    else
+                    {
+                        /* FAT32 LBA partition (partition size >= 512MB) */
+                        PartEntry->PartitionType = PARTITION_FAT32_XINT13;
+                    }
+                }
+
+                DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType;
+            }
+#if 0
+            else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0)
+            {
+                PartEntry->PartitionType = PARTITION_EXT2;
+                DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType;
             }
+#endif
+            else if (!FileSystemList->Selected->FormatFunc)
+                return QUIT_PAGE;
 
 #ifndef NDEBUG
             CONSOLE_PrintTextXY(6, 12,
@@ -2852,6 +2790,15 @@ FormatPartitionPage(PINPUT_RECORD Ir)
             PartEntry = PartitionList->CurrentPartition;
 #endif
 
+            CheckActiveBootPartition(PartitionList);
+
+            if (WritePartitionsToDisk(PartitionList) == FALSE)
+            {
+                DPRINT("WritePartitionsToDisk() failed\n");
+                MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
+                return QUIT_PAGE;
+            }
+
             /* Set DestinationRootPath */
             RtlFreeUnicodeString(&DestinationRootPath);
             swprintf(PathBuffer,
@@ -2870,12 +2817,11 @@ FormatPartitionPage(PINPUT_RECORD Ir)
                 {
                     DPRINT1("FormatPartition() failed with status 0x%08lx\n", Status);
                     /* FIXME: show an error dialog */
-                    DestroyFileSystemList(FileSystemList);
-                    FileSystemList = NULL;
                     return QUIT_PAGE;
                 }
 
-                PartEntry->FormatState = Formatted;
+                PartEntry->New = FALSE;
+
             }
 
 #ifndef NDEBUG
@@ -2885,11 +2831,7 @@ FormatPartitionPage(PINPUT_RECORD Ir)
 
             DestroyFileSystemList(FileSystemList);
             FileSystemList = NULL;
-
-            if (IsUnattendedSetup || InstallShortcut)
-                return INSTALL_DIRECTORY_PAGE;
-            else
-                return SELECT_PARTITION_PAGE;
+            return INSTALL_DIRECTORY_PAGE;
         }
     }
 
@@ -2974,347 +2916,6 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
 }
 
 
-
-
-static PAGE_NUMBER
-PreInstallSelectFormatPage(PINPUT_RECORD Ir)
-{
-    PDISKENTRY DiskEntry;
-    PPARTENTRY PartEntry;
-    ULONGLONG DiskSize;
-    ULONGLONG PartSize;
-    PCHAR DiskUnit;
-    PCHAR PartUnit;
-    PCHAR PartType;
-
-    if (PartitionList == NULL ||
-        PartitionList->CurrentDisk == NULL ||
-        PartitionList->CurrentPartition == NULL)
-    {
-        /* FIXME: show an error dialog */
-        return QUIT_PAGE;
-    }
-
-    DiskEntry = PartitionList->CurrentDisk;
-    PartEntry = PartitionList->CurrentPartition;
-
-    if (PartEntry->FormatState == Formatted)
-        return INSTALL_DIRECTORY_PAGE;
-
-    /* adjust disk size */
-    DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
-    if (DiskSize >= 10737418240) /* 10 GB */
-    {
-        DiskSize = DiskSize / 1073741824;
-        DiskUnit = MUIGetString(STRING_GB);
-    }
-    else
-    {
-        DiskSize = DiskSize / 1048576;
-        DiskUnit = MUIGetString(STRING_MB);
-    }
-
-    /* adjust partition size */
-    PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
-    if (PartSize >= 10737418240) /* 10 GB */
-    {
-        PartSize = PartSize / 1073741824;
-        PartUnit = MUIGetString(STRING_GB);
-    }
-    else
-    {
-        PartSize = PartSize / 1048576;
-        PartUnit = MUIGetString(STRING_MB);
-    }
-
-    /* adjust partition type */
-    if ((PartEntry->PartitionType == PARTITION_FAT_12) ||
-        (PartEntry->PartitionType == PARTITION_FAT_16) ||
-        (PartEntry->PartitionType == PARTITION_HUGE) ||
-        (PartEntry->PartitionType == PARTITION_XINT13))
-    {
-        PartType = "FAT";
-    }
-    else if ((PartEntry->PartitionType == PARTITION_FAT32) ||
-             (PartEntry->PartitionType == PARTITION_FAT32_XINT13))
-    {
-        PartType = "FAT32";
-    }
-    else if (PartEntry->PartitionType == PARTITION_EXT2)
-    {
-        PartType = "EXT2";
-    }
-    else if (PartEntry->PartitionType == PARTITION_IFS)
-    {
-        PartType = "NTFS"; /* FIXME: Not quite correct! */
-    }
-    else if (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED)
-    {
-        PartType = MUIGetString(STRING_FORMATUNUSED);
-    }
-    else
-    {
-        PartType = MUIGetString(STRING_FORMATUNKNOWN);
-    }
-
-    if (PartEntry->AutoCreate == TRUE)
-    {
-        CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NEWPARTITION));
-
-#if 0
-        CONSOLE_PrintTextXY(8, 10, "Partition %lu (%I64u %s) %s of",
-                            PartEntry->PartitionNumber,
-                            PartSize,
-                            PartUnit,
-                            PartType);
-#endif
-
-        CONSOLE_PrintTextXY(8, 10, MUIGetString(STRING_HDINFOPARTZEROED),
-                            DiskEntry->DiskNumber,
-                            DiskSize,
-                            DiskUnit,
-                            DiskEntry->Port,
-                            DiskEntry->Bus,
-                            DiskEntry->Id,
-                            &DiskEntry->DriverName);
-
-        CONSOLE_SetTextXY(6, 12, MUIGetString(STRING_PARTFORMAT));
-
-
-        PartEntry->AutoCreate = FALSE;
-    }
-#if 0
-    else if (PartEntry->New == TRUE)
-    {
-        CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NONFORMATTEDPART));
-        CONSOLE_SetTextXY(6, 10, MUIGetString(STRING_PARTFORMAT));
-    }
-#endif
-    else
-    {
-        CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_INSTALLONPART));
-
-        if (PartType == NULL)
-        {
-            CONSOLE_PrintTextXY(8, 10,
-                                MUIGetString(STRING_HDDINFOUNK4),
-                                (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter,
-                                (PartEntry->DriveLetter == 0) ? '-' : ':',
-                                PartEntry->PartitionType,
-                                PartSize,
-                                PartUnit);
-        }
-        else
-        {
-            CONSOLE_PrintTextXY(8, 10,
-                                "%c%c  %s    %I64u %s",
-                                (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter,
-                                (PartEntry->DriveLetter == 0) ? '-' : ':',
-                                PartType,
-                                PartSize,
-                                PartUnit);
-        }
-
-        CONSOLE_PrintTextXY(6, 12, MUIGetString(STRING_HDINFOPARTEXISTS),
-                            DiskEntry->DiskNumber,
-                            DiskSize,
-                            DiskUnit,
-                            DiskEntry->Port,
-                            DiskEntry->Bus,
-                            DiskEntry->Id,
-                            &DiskEntry->DriverName);
-    }
-
-    MUIDisplayPage(SELECT_FILE_SYSTEM_PAGE);
-
-    if (FileSystemList != NULL)
-    {
-        DestroyFileSystemList(FileSystemList);
-        FileSystemList = NULL;
-    }
-
-    FileSystemList = CreateFileSystemList(6, 26, FALSE, L"FAT",
-                                          PartEntry->PartitionType);
-    if (FileSystemList == NULL)
-    {
-        /* FIXME: show an error dialog */
-        return QUIT_PAGE;
-    }
-
-    DrawFileSystemList(FileSystemList);
-
-    while (TRUE)
-    {
-        CONSOLE_ConInKey(Ir);
-
-        if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-            (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))  /* F3 */
-        {
-            if (ConfirmQuit(Ir) == TRUE)
-            {
-                return QUIT_PAGE;
-            }
-
-            break;
-        }
-        else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-                 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE))  /* ESC */
-        {
-            return SELECT_PARTITION_PAGE;
-        }
-        else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-                 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN))  /* DOWN */
-        {
-            ScrollDownFileSystemList(FileSystemList);
-        }
-        else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-                 (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP))  /* UP */
-        {
-            ScrollUpFileSystemList(FileSystemList);
-        }
-        else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
-        {
-            if (FileSystemList->Selected->FormatFunc)
-            {
-                return PRE_INSTALL_FORMAT_PAGE;
-            }
-        }
-    }
-
-    return PRE_INSTALL_SELECT_FORMAT_PAGE;
-}
-
-
-static ULONG
-PreInstallFormatPage(PINPUT_RECORD Ir)
-{
-    WCHAR PathBuffer[MAX_PATH];
-//    PDISKENTRY DiskEntry;
-    PPARTENTRY PartEntry;
-    NTSTATUS Status;
-
-#ifndef NDEBUG
-    ULONG Line;
-    ULONG i;
-    PLIST_ENTRY Entry;
-#endif
-
-    MUIDisplayPage(FORMAT_PARTITION_PAGE);
-
-    if (PartitionList == NULL ||
-        PartitionList->CurrentDisk == NULL ||
-        PartitionList->CurrentPartition == NULL)
-    {
-        /* FIXME: show an error dialog */
-        return QUIT_PAGE;
-    }
-
-//    DiskEntry = PartitionList->CurrentDisk;
-    PartEntry = PartitionList->CurrentPartition;
-
-    while (TRUE)
-    {
-        if (!IsUnattendedSetup)
-        {
-            CONSOLE_ConInKey(Ir);
-        }
-
-        if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
-            (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3))  /* F3 */
-        {
-            if (ConfirmQuit(Ir) == TRUE)
-            {
-                return QUIT_PAGE;
-            }
-
-            break;
-        }
-        else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN || IsUnattendedSetup) /* ENTER */
-        {
-            CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
-
-            if (!FileSystemList->Selected->FormatFunc)
-                return QUIT_PAGE;
-
-#ifndef NDEBUG
-            CONSOLE_PrintTextXY(6, 12,
-                                "Disk: %I64u  Cylinder: %I64u  Track: %I64u",
-                                DiskEntry->DiskSize,
-                                DiskEntry->CylinderSize,
-                                DiskEntry->TrackSize);
-
-            Line = 13;
-            DiskEntry = PartitionList->CurrentDisk;
-            Entry = DiskEntry->PartListHead.Flink;
-
-            while (Entry != &DiskEntry->PrimaryPartListHead)
-            {
-                PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry);
-
-                if (PartEntry->IsPartitioned == TRUE)
-                {
-                    CONSOLE_PrintTextXY(6, Line,
-                                        "%2u:  %2u  %c  %12I64u  %12I64u  %2u  %c",
-                                        i,
-                                        PartEntry->PartitionNumber,
-                                        PartEntry->BootIndicator ? 'A' : '-',
-                                        PartEntry->StartSector.QuadPart,
-                                        PartEntry->SectorCount.QuadPart,
-                                        PartEntry->PartitionType,
-                                        PartEntry->Dirty ? '*' : ' ');
-                    Line++;
-                }
-
-                Entry = Entry->Flink;
-            }
-
-            /* Restore the old entry */
-            PartEntry = PartitionList->CurrentPartition;
-#endif
-
-            /* Set DestinationRootPath */
-            RtlFreeUnicodeString(&DestinationRootPath);
-            swprintf(PathBuffer,
-                     L"\\Device\\Harddisk%lu\\Partition%lu",
-                     PartitionList->CurrentDisk->DiskNumber,
-                     PartitionList->CurrentPartition->PartitionNumber);
-            RtlCreateUnicodeString(&DestinationRootPath,
-                                   PathBuffer);
-            DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath);
-
-            if (FileSystemList->Selected->FormatFunc)
-            {
-                Status = FormatPartition(&DestinationRootPath,
-                                         FileSystemList->Selected);
-                if (!NT_SUCCESS(Status))
-                {
-                    DPRINT1("FormatPartition() failed with status 0x%08lx\n", Status);
-                    /* FIXME: show an error dialog */
-                    return QUIT_PAGE;
-                }
-
-                PartEntry->FormatState = Formatted;
-            }
-
-#ifndef NDEBUG
-            CONSOLE_SetStatusText("   Done.  Press any key ...");
-            CONSOLE_ConInKey(Ir);
-#endif
-
-            DestroyFileSystemList(FileSystemList);
-            FileSystemList = NULL;
-
-            return INSTALL_DIRECTORY_PAGE;
-        }
-    }
-
-    return PRE_INSTALL_FORMAT_PAGE;
-}
-
-
-
-
-
 static PAGE_NUMBER
 InstallDirectoryPage1(PWCHAR InstallDir,
                       PDISKENTRY DiskEntry,
@@ -3327,16 +2928,6 @@ InstallDirectoryPage1(PWCHAR InstallDir,
     RtlCreateUnicodeString(&InstallPath,
                            InstallDir);
 
-    /* Set DestinationRootPath */
-    RtlFreeUnicodeString(&DestinationRootPath);
-    swprintf(PathBuffer,
-             L"\\Device\\Harddisk%lu\\Partition%lu",
-             DiskEntry->DiskNumber,
-             PartEntry->PartitionNumber);
-    RtlCreateUnicodeString(&DestinationRootPath,
-                           PathBuffer);
-    DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath);
-
     /* Create 'DestinationPath' string */
     RtlFreeUnicodeString(&DestinationPath);
     wcscpy(PathBuffer, DestinationRootPath.Buffer);
@@ -4115,7 +3706,6 @@ BootLoaderPage(PINPUT_RECORD Ir)
     BOOLEAN InstallOnFloppy;
     USHORT Line = 12;
     WCHAR PathBuffer[MAX_PATH];
-    NTSTATUS Status;
 
     CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
 
@@ -4123,10 +3713,9 @@ BootLoaderPage(PINPUT_RECORD Ir)
     CheckActiveBootPartition(PartitionList);
 
     /* Update the partition table because we may have changed the active partition */
-    Status = WriteDirtyPartitions(PartitionList);
-    if (!NT_SUCCESS(Status))
+    if (WritePartitionsToDisk(PartitionList) == FALSE)
     {
-        DPRINT("WriteDirtyPartitions() failed\n");
+        DPRINT("WritePartitionsToDisk() failed\n");
         MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
         return QUIT_PAGE;
     }
@@ -4626,19 +4215,11 @@ RunUSetup(VOID)
                 break;
 
             case FORMAT_PARTITION_PAGE:
-                Page = FormatPartitionPage(&Ir);
+                Page = (PAGE_NUMBER) FormatPartitionPage(&Ir);
                 break;
 
             case CHECK_FILE_SYSTEM_PAGE:
-                Page = CheckFileSystemPage(&Ir);
-                break;
-
-            case PRE_INSTALL_SELECT_FORMAT_PAGE:
-                Page = PreInstallSelectFormatPage(&Ir);
-                break;
-
-            case PRE_INSTALL_FORMAT_PAGE:
-                Page = PreInstallFormatPage(&Ir);
+                Page = (PAGE_NUMBER) CheckFileSystemPage(&Ir);
                 break;
 
             case INSTALL_DIRECTORY_PAGE:
index ac92feb..23dc0bf 100644 (file)
@@ -1753,7 +1753,5 @@ MUI_STRING bgBGStrings[] =
     "\83\81"},
     {STRING_ADDKBLAYOUTS,
     "\84®¡ ¢ï­¥ ­  ª« ¢¨ âãà­¨ ¯®¤à¥¤¡¨"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 94e0974..4218262 100644 (file)
@@ -1737,7 +1737,5 @@ MUI_STRING bnBDStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Adding keyboard layouts"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index eec59fd..f9612b8 100644 (file)
@@ -1746,7 +1746,5 @@ MUI_STRING csCZStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Pýid v m rozlo§en¡ kl ves"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index c0eb41e..7f1e3cc 100644 (file)
@@ -1742,7 +1742,5 @@ MUI_STRING deDEStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Tastaturlayout hinzuf\81gen"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 04c5ca9..52f6c3f 100644 (file)
@@ -1763,7 +1763,5 @@ MUI_STRING elGRStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "\82å¤\9c«\98  §¨¦©\9fã¡\9e «à¤ \9b \98«á¥\9cठ§¢\9e¡«¨¦¢¦\9a妬"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 96acd71..4cdbb45 100644 (file)
@@ -1737,7 +1737,5 @@ MUI_STRING enUSStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Adding keyboard layouts"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 76470d2..c0d0d15 100644 (file)
@@ -1745,7 +1745,5 @@ MUI_STRING esESStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "A¤adiendo distribuci¢n de teclado"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 9a2cbaa..4104224 100644 (file)
@@ -1738,7 +1738,5 @@ MUI_STRING etEEStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Klaviatuuriasetuste lisamine"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 93e95b2..b83f658 100644 (file)
@@ -1751,7 +1751,5 @@ MUI_STRING frFRStrings[] =
     "Go"},
     {STRING_ADDKBLAYOUTS,
     "Ajout des dispositions clavier"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index fa6fee7..8e779f8 100644 (file)
@@ -1739,7 +1739,5 @@ MUI_STRING heILStrings[] =
     "\82\89\82\84\81\89\89\88"},
     {STRING_ADDKBLAYOUTS,
     "Adding keyboard layouts"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 3d7a4c6..185f91d 100644 (file)
@@ -1740,7 +1740,5 @@ MUI_STRING itITStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Aggiunta delle nazionalit\85 di tastiera"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 336ec63..4d11d82 100644 (file)
@@ -1741,7 +1741,5 @@ MUI_STRING jaJPStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "·°ÎÞ°ÄÞ Ú²±³Äɠ²¶ Á­³"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index ae7da24..f24c844 100644 (file)
@@ -1748,7 +1748,5 @@ MUI_STRING ltLTStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Adding keyboard layouts"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 0e49b16..e1e9d45 100644 (file)
@@ -1786,7 +1786,5 @@ MUI_STRING nlNLStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Toevoegen toetsenbordindelingen"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 629fee4..c212ae5 100644 (file)
@@ -1746,7 +1746,5 @@ MUI_STRING plPLStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Dodawanie uk\88ad¢w klawiatury"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 06960e5..9b32c9a 100644 (file)
@@ -1777,7 +1777,5 @@ MUI_STRING ptBRStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Adicionando leiautes de teclado"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 03f9e63..d8049e7 100644 (file)
@@ -1814,7 +1814,5 @@ MUI_STRING roROStrings[] =
     "Go"},
     {STRING_ADDKBLAYOUTS,
     "AdÇugare configuraîii de tastaturÇ"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index faf8554..3c5e824 100644 (file)
@@ -1742,7 +1742,5 @@ MUI_STRING ruRUStrings[] =
     "\83\81"},
     {STRING_ADDKBLAYOUTS,
     "Adding keyboard layouts"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 470c1d5..f030e28 100644 (file)
@@ -1752,7 +1752,5 @@ MUI_STRING skSKStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Prid vam rozlo§enia kl vesnice"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index be0b639..e340841 100644 (file)
@@ -1744,7 +1744,5 @@ MUI_STRING sqALStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "Shtim e p\89rzgjedhjes s\89 tastier\89s"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 20e0494..6f1f2fe 100644 (file)
@@ -1747,7 +1747,5 @@ MUI_STRING svSEStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "L\84gger till tangentbordslayouter"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index ac2293d..7bb8f98 100644 (file)
@@ -1725,7 +1725,5 @@ MUI_STRING trTRStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "D\81§me tak\8dm\8d d\81zenleri ekleniyor..."},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 9b38a6b..e83dd37 100644 (file)
@@ -1747,7 +1747,5 @@ MUI_STRING ukUAStrings[] =
     "GB"},
     {STRING_ADDKBLAYOUTS,
     "\84®¤ ¢ ­­ï à®§ª« ¤®ª ª« ¢i âãà¨"},
-    {STRING_FORMATPART,
-    "Setup formats Partition"},
     {0, 0}
 };
index 6dd6ca2..b950a0e 100644 (file)
@@ -156,5 +156,3 @@ MUIGetString(
 #define STRING_MB                        54
 #define STRING_GB                        55
 #define STRING_ADDKBLAYOUTS              56
-#define STRING_FORMATPART                     62
-
index 67cce11..d00a7c9 100644 (file)
@@ -2,36 +2,12 @@
 
 BOOLEAN
 NATIVE_CreateFileSystemList(
-    IN PFILE_SYSTEM_LIST List,
-    IN UCHAR PartitionType)
+    IN PFILE_SYSTEM_LIST List)
 {
-    if (PartitionType == PARTITION_ENTRY_UNUSED ||
-        PartitionType == PARTITION_FAT_12 ||
-        PartitionType == PARTITION_FAT_16 ||
-        PartitionType == PARTITION_HUGE ||
-        PartitionType == PARTITION_XINT13 ||
-        PartitionType == PARTITION_FAT32 ||
-        PartitionType == PARTITION_FAT32_XINT13)
-    {
-        FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk);
-    }
-
+    FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk);
 #if 0
-    if (PartitionType == PARTITION_ENTRY_UNUSED ||
-        PartitionType == PARTITION_EXT2)
-    {
-        FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk);
-    }
+    FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk);
 #endif
-
-#if 0
-    if (PartitionType == PARTITION_ENTRY_UNUSED ||
-        PartitionType == PARTITION_IFS)
-    {
-        FS_AddProvider(List, L"NTFS", NtfsFormat, NtfsChkdsk);
-    }
-#endif
-
     return TRUE;
 }
 
index 6eb8632..47a6db0 100644 (file)
@@ -558,7 +558,7 @@ AddPartitionToDisk(
 
     if (IsContainerPartition(PartEntry->PartitionType))
     {
-        PartEntry->FormatState = Formatted;
+        PartEntry->FormatState = Unformatted;
 
         if (LogicalPartition == FALSE && DiskEntry->ExtendedPartition == NULL)
             DiskEntry->ExtendedPartition = PartEntry;
@@ -1499,7 +1499,11 @@ PrintPartitionData(
     {
         /* Determine partition type */
         PartType = NULL;
-        if (PartEntry->IsPartitioned == TRUE)
+        if (PartEntry->New == TRUE)
+        {
+            PartType = MUIGetString(STRING_UNFORMATTED);
+        }
+        else if (PartEntry->IsPartitioned == TRUE)
         {
             if ((PartEntry->PartitionType == PARTITION_FAT_12) ||
                 (PartEntry->PartitionType == PARTITION_FAT_16) ||
@@ -2382,6 +2386,7 @@ DPRINT1("Convert existing partition entry\n");
         PartEntry->PartitionType = PARTITION_ENTRY_UNUSED;
         PartEntry->FormatState = Unformatted;
         PartEntry->AutoCreate = AutoCreate;
+        PartEntry->New = TRUE;
         PartEntry->BootIndicator = FALSE;
 
 DPRINT1("First Sector: %I64u\n", PartEntry->StartSector.QuadPart);
@@ -2415,13 +2420,12 @@ DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart);
 DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1);
 DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart);
 
+        NewPartEntry->New = TRUE;
         NewPartEntry->FormatState = Unformatted;
         NewPartEntry->BootIndicator = FALSE;
 
         PartEntry->StartSector.QuadPart = NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart;
         PartEntry->SectorCount.QuadPart -= (PartEntry->StartSector.QuadPart - NewPartEntry->StartSector.QuadPart);
-
-        List->CurrentPartition = NewPartEntry;
     }
 
     UpdateDiskLayout(DiskEntry);
@@ -2499,6 +2503,7 @@ DPRINT1("Convert existing partition entry\n");
         PartEntry->IsPartitioned = TRUE;
         PartEntry->FormatState = Formatted;
         PartEntry->AutoCreate = FALSE;
+        PartEntry->New = FALSE;
         PartEntry->BootIndicator = FALSE;
 
         if (PartEntry->StartSector.QuadPart < 1450560)
@@ -2540,6 +2545,7 @@ DPRINT1("Add new partition entry\n");
         NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) -
                                              NewPartEntry->StartSector.QuadPart;
 
+        NewPartEntry->New = FALSE;
         NewPartEntry->FormatState = Formatted;
         NewPartEntry->BootIndicator = FALSE;
 
@@ -2562,8 +2568,6 @@ DPRINT1("Add new partition entry\n");
 DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart);
 DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1);
 DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart);
-
-        List->CurrentPartition = NewPartEntry;
     }
 
     AddLogicalDiskSpace(DiskEntry);
@@ -2927,16 +2931,15 @@ WritePartitons(
 }
 
 
-NTSTATUS
-WriteDirtyPartitions(
+BOOLEAN
+WritePartitionsToDisk(
     PPARTLIST List)
 {
     PLIST_ENTRY Entry;
     PDISKENTRY DiskEntry;
-    NTSTATUS Status;
 
     if (List == NULL)
-        return STATUS_SUCCESS;
+        return TRUE;
 
     Entry = List->DiskListHead.Flink;
     while (Entry != &List->DiskListHead)
@@ -2945,17 +2948,13 @@ WriteDirtyPartitions(
 
         if (DiskEntry->Dirty == TRUE)
         {
-            Status = WritePartitons(List, DiskEntry);
-            if (!NT_SUCCESS(Status))
-                return Status;
-
-            DiskEntry->Dirty = FALSE;
+            WritePartitons(List, DiskEntry);
         }
 
         Entry = Entry->Flink;
     }
 
-    return STATUS_SUCCESS;
+    return TRUE;
 }
 
 
index 8b54a90..a4e5871 100644 (file)
@@ -63,7 +63,7 @@ typedef struct _PARTENTRY
     BOOLEAN IsPartitioned;
 
     /* Partition is new. Table does not exist on disk yet */
-//    BOOLEAN New;
+    BOOLEAN New;
 
     /* Partition was created automatically. */
     BOOLEAN AutoCreate;
@@ -247,8 +247,8 @@ BOOLEAN
 CheckForLinuxFdiskPartitions(
     PPARTLIST List);
 
-NTSTATUS
-WriteDirtyPartitions(
+BOOLEAN
+WritePartitionsToDisk(
     PPARTLIST List);
 
 ULONG
index 187d0f0..cc9019f 100644 (file)
@@ -138,11 +138,8 @@ typedef enum _PAGE_NUMBER
     FORMAT_PARTITION_PAGE,
     CHECK_FILE_SYSTEM_PAGE,
 
-    PRE_INSTALL_SELECT_FORMAT_PAGE,
-    PRE_INSTALL_FORMAT_PAGE,
-
-    INSTALL_DIRECTORY_PAGE,
     PREPARE_COPY_PAGE,
+    INSTALL_DIRECTORY_PAGE,
     FILE_COPY_PAGE,
     REGISTRY_PAGE,
     BOOT_LOADER_PAGE,