Fixed bootable partition bug

svn path=/trunk/; revision=1895
This commit is contained in:
Eric Kohl 2001-05-06 22:32:34 +00:00
parent cbcc365a25
commit 7398918d11

View file

@ -1,4 +1,4 @@
/* $Id: xhaldrv.c,v 1.7 2000/08/25 15:55:02 ekohl Exp $
/* $Id: xhaldrv.c,v 1.8 2001/05/06 22:32:34 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -27,10 +27,20 @@
#define SIGNATURE_OFFSET 0x01b8
#define PARTITION_TBL_SIZE 4
/*
#define IsUsablePartition(P) \
((P) != PTEmpty && \
(P) != PTDosExtended && \
(P) != PTWin95ExtendedLBA)
(P) < PTWin95ExtendedLBA)
*/
#define IsUsablePartition(P) \
((P) == PTDOS3xPrimary || \
(P) == PTOLDDOS16Bit || \
(P) == PTDos5xPrimary || \
(P) == PTWin95FAT32 || \
(P) == PTWin95FAT32LBA || \
(P) == PTWin95FAT16LBA)
typedef struct _PARTITION
@ -277,14 +287,11 @@ HalpAssignDrive (
}
VOID
FASTCALL
xHalIoAssignDriveLetters (
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
VOID FASTCALL
xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString
)
OUT PSTRING NtSystemPathString)
{
PDRIVE_LAYOUT_INFORMATION LayoutInfo;
PCONFIGURATION_INFORMATION ConfigInfo;
@ -385,7 +392,8 @@ xHalIoAssignDriveLetters (
LayoutInfo->PartitionEntry[j].StartingOffset.u.LowPart,
LayoutInfo->PartitionEntry[j].PartitionLength.u.LowPart);
if (LayoutInfo->PartitionEntry[j].BootIndicator)
if ((LayoutInfo->PartitionEntry[j].BootIndicator == TRUE) &&
IsUsablePartition(LayoutInfo->PartitionEntry[j].PartitionType))
{
swprintf(Buffer2,
L"\\Device\\Harddisk%d\\Partition%d",
@ -420,7 +428,8 @@ xHalIoAssignDriveLetters (
&LayoutInfo);
if (!NT_SUCCESS(Status))
{
DbgPrint("xHalpQueryDriveLayout() failed (Status = 0x%lx)\n",
DbgPrint("xHalpQueryDriveLayout(%wZ) failed (Status = 0x%lx)\n",
&UnicodeString1,
Status);
continue;
}
@ -450,8 +459,11 @@ xHalIoAssignDriveLetters (
Buffer2);
/* assign it */
DPRINT(" %wZ\n", &UnicodeString2);
HalpAssignDrive (&UnicodeString2, &DriveMap, AUTO_DRIVE);
DPRINT(" %wZ\n",
&UnicodeString2);
HalpAssignDrive(&UnicodeString2,
&DriveMap,
AUTO_DRIVE);
}
}
@ -502,8 +514,11 @@ xHalIoAssignDriveLetters (
Buffer2);
/* assign it */
DPRINT(" %wZ\n", &UnicodeString2);
HalpAssignDrive (&UnicodeString2, &DriveMap, AUTO_DRIVE);
DPRINT(" %wZ\n",
&UnicodeString2);
HalpAssignDrive(&UnicodeString2,
&DriveMap,
AUTO_DRIVE);
}
}
@ -521,7 +536,8 @@ xHalIoAssignDriveLetters (
Buffer1);
/* assign drive letters A: or B: or first free drive letter */
DPRINT(" %wZ\n", &UnicodeString1);
DPRINT(" %wZ\n",
&UnicodeString1);
HalpAssignDrive(&UnicodeString1,
&DriveMap,
(i < 2) ? i : AUTO_DRIVE);