- Fix a couple more assumptions about first primary partition being the active one.

- If no active partitions found, set active primary partition number to 0. This fixes uninitialized variable usage, which revealed itself as a bug with unattended setup.
- Silence a DPRINT1.

svn path=/trunk/; revision=40438
This commit is contained in:
Aleksey Bragin 2009-04-10 13:27:09 +00:00
parent b3c86c2ac0
commit b6f258cefd
2 changed files with 6 additions and 3 deletions

View file

@ -3345,7 +3345,8 @@ BootLoaderPage(PINPUT_RECORD Ir)
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
PartitionType = PartitionList->ActiveBootPartition->PartInfo[0].PartitionType;
PartitionType = PartitionList->ActiveBootPartition->
PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
if (PartitionType == PARTITION_ENTRY_UNUSED)
{
@ -3518,7 +3519,8 @@ BootLoaderHarddiskPage(PINPUT_RECORD Ir)
UCHAR PartitionType;
NTSTATUS Status;
PartitionType = PartitionList->ActiveBootPartition->PartInfo[0].PartitionType;
PartitionType = PartitionList->ActiveBootPartition->
PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
if ((PartitionType == PARTITION_FAT_12) ||
(PartitionType == PARTITION_FAT_16) ||
(PartitionType == PARTITION_HUGE) ||

View file

@ -2361,6 +2361,7 @@ CheckActiveBootPartition (PPARTLIST List)
/* FIXME: Might be incorrect if partitions were created by Linux FDISK */
List->ActiveBootDisk = DiskEntry;
List->ActiveBootPartition = PartEntry;
List->ActiveBootPartitionNumber = 0;
return;
}
@ -2391,7 +2392,7 @@ CheckActiveBootPartition (PPARTLIST List)
List->ActiveBootPartition = PartEntry;
List->ActiveBootPartitionNumber = i;
DPRINT1("Found bootable partition disk %d, drive letter %c\n",
DPRINT("Found bootable partition disk %d, drive letter %c\n",
DiskEntry->BiosDiskNumber, PartEntry->DriveLetter[i]);
break;