- Check for a valid layout buffer entry in xHalIoAssignDriveLetters.

svn path=/trunk/; revision=10634
This commit is contained in:
Hartmut Birr 2004-08-21 19:13:22 +00:00
parent fca2504ae6
commit 0ebfb773cb

View file

@ -1,4 +1,4 @@
/* $Id: xhaldrv.c,v 1.47 2004/08/18 02:20:00 navaraf Exp $
/* $Id: xhaldrv.c,v 1.48 2004/08/21 19:13:22 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -529,6 +529,8 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
/* Assign bootable partition on first harddisk */
DPRINT("Assigning bootable primary partition on first harddisk:\n");
if (ConfigInfo->DiskCount > 0)
{
if (LayoutArray[0])
{
/* Search for bootable partition */
for (j = 0; j < LayoutArray[0]->PartitionCount; j++)
@ -550,10 +552,13 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
}
}
}
}
/* Assign remaining primary partitions */
DPRINT("Assigning remaining primary partitions:\n");
for (i = 0; i < ConfigInfo->DiskCount; i++)
{
if (LayoutArray[i])
{
/* Search for primary partitions */
for (j = 0; (j < PARTITION_TBL_SIZE) && (j < LayoutArray[i]->PartitionCount); j++)
@ -579,6 +584,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
}
}
}
}
/* Assign extended (logical) partitions */
DPRINT("Assigning extended (logical) partitions:\n");
@ -613,6 +619,8 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
/* Assign removable disk drives */
DPRINT("Assigning removable disk drives:\n");
for (i = 0; i < ConfigInfo->DiskCount; i++)
{
if (LayoutArray[i])
{
/* Search for virtual partitions */
if (LayoutArray[i]->PartitionCount == 1 &&
@ -632,6 +640,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
DOSDEVICE_DRIVE_REMOVABLE);
}
}
}
/* Free layout array */
for (i = 0; i < ConfigInfo->DiskCount; i++)
@ -977,7 +986,7 @@ xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
xHalExamineMBR (DeviceObject,
SectorSize,
0x54,
(PVOID*) &PartitionSector);
(PVOID*)(PVOID)&PartitionSector);
if (PartitionSector != NULL)
{
DPRINT ("Found 'Ontrack Disk Manager'\n");
@ -989,7 +998,7 @@ xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
xHalExamineMBR (DeviceObject,
SectorSize,
0x55,
(PVOID*) &PartitionSector);
(PVOID*)(PVOID)&PartitionSector);
if (PartitionSector != NULL)
{
DPRINT ("Found 'EZ-Drive'\n");
@ -1189,7 +1198,7 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
xHalExamineMBR (DeviceObject,
SectorSize,
0x54,
(PVOID *) &PartitionSector);
(PVOID*)(PVOID)&PartitionSector);
if (PartitionSector != NULL)
{
DPRINT ("Found 'Ontrack Disk Manager'\n");
@ -1201,7 +1210,7 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
xHalExamineMBR (DeviceObject,
SectorSize,
0x55,
(PVOID *) &PartitionSector);
(PVOID*)(PVOID)&PartitionSector);
if (PartitionSector != NULL)
{
DPRINT ("Found 'EZ-Drive'\n");