X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fbase%2Fsetup%2Fusetup%2Finterface%2Fusetup.c;h=9b49f89d3280812f36299c76ad502fc3b5442013;hp=984d287b29948dc2895ba3d144811d1eba882650;hb=022f4b2ce569305456ad2588a78ba88fe7694e1b;hpb=b3c15e9acd21398d97718bc08edbf69747d6b507 diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 984d287b299..9b49f89d328 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -728,19 +728,19 @@ LanguagePage(PINPUT_RECORD Ir) static PAGE_NUMBER SetupStartPage(PINPUT_RECORD Ir) { - SYSTEM_DEVICE_INFORMATION Sdi; + //SYSTEM_DEVICE_INFORMATION Sdi; NTSTATUS Status; WCHAR FileNameBuffer[MAX_PATH]; INFCONTEXT Context; PWCHAR Value; UINT ErrorLine; - ULONG ReturnSize; + //ULONG ReturnSize; PGENERIC_LIST_ENTRY ListEntry; INT IntValue; CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); - +#if 0 /* Check whether a harddisk is available */ Status = NtQuerySystemInformation(SystemDeviceInformation, &Sdi, @@ -759,6 +759,7 @@ SetupStartPage(PINPUT_RECORD Ir) MUIDisplayError(ERROR_NO_HDD, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } +#endif /* Get the source path and source root path */ Status = GetSourcePaths(&SourcePath, @@ -1465,8 +1466,6 @@ SelectPartitionPage(PINPUT_RECORD Ir) } } - CheckActiveBootPartition(PartitionList); - DrawPartitionList(PartitionList); /* Warn about partitions created by Linux Fdisk */ @@ -2381,8 +2380,6 @@ FormatPartitionPage(PINPUT_RECORD Ir) else if (!FileSystemList->Selected->FormatFunc) return QUIT_PAGE; - CheckActiveBootPartition(PartitionList); - #ifndef NDEBUG CONSOLE_PrintTextXY(6, 12, "Disk: %I64u Cylinder: %I64u Track: %I64u", @@ -2442,19 +2439,6 @@ FormatPartitionPage(PINPUT_RECORD Ir) PathBuffer); DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath); - - /* Set SystemRootPath */ - RtlFreeUnicodeString(&SystemRootPath); - swprintf(PathBuffer, - L"\\Device\\Harddisk%lu\\Partition%lu", - PartitionList->ActiveBootDisk->DiskNumber, - PartitionList->ActiveBootPartition-> - PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionNumber); - RtlCreateUnicodeString(&SystemRootPath, - PathBuffer); - DPRINT("SystemRootPath: %wZ\n", &SystemRootPath); - - if (FileSystemList->Selected->FormatFunc) { Status = FormatPartition(&DestinationRootPath, @@ -2505,15 +2489,6 @@ CheckFileSystemPage(PINPUT_RECORD Ir) RtlCreateUnicodeString(&DestinationRootPath, PathBuffer); DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath); - /* Set SystemRootPath */ - RtlFreeUnicodeString(&SystemRootPath); - swprintf(PathBuffer, - L"\\Device\\Harddisk%lu\\Partition%lu", - PartitionList->ActiveBootDisk->DiskNumber, - PartitionList->ActiveBootPartition->PartInfo[PartNum].PartitionNumber); - RtlCreateUnicodeString(&SystemRootPath, PathBuffer); - DPRINT("SystemRootPath: %wZ\n", &SystemRootPath); - CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHECKINGPART)); CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); @@ -3371,9 +3346,31 @@ BootLoaderPage(PINPUT_RECORD Ir) UCHAR PartitionType; BOOLEAN InstallOnFloppy; USHORT Line = 12; + WCHAR PathBuffer[MAX_PATH]; CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); + /* Find or set the active partition */ + CheckActiveBootPartition(PartitionList); + + /* Update the partition table because we may have changed the active partition */ + if (WritePartitionsToDisk(PartitionList) == FALSE) + { + DPRINT("WritePartitionsToDisk() failed\n"); + MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER); + return QUIT_PAGE; + } + + RtlFreeUnicodeString(&SystemRootPath); + swprintf(PathBuffer, + L"\\Device\\Harddisk%lu\\Partition%lu", + PartitionList->ActiveBootDisk->DiskNumber, + PartitionList->ActiveBootPartition-> + PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionNumber); + RtlCreateUnicodeString(&SystemRootPath, + PathBuffer); + DPRINT("SystemRootPath: %wZ\n", &SystemRootPath); + PartitionType = PartitionList->ActiveBootPartition-> PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;