mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix for error in reading next extended partition when partition contains slack
or more than one non container partition. svn path=/trunk/; revision=2035
This commit is contained in:
parent
eed177f191
commit
df84ec15d8
1 changed files with 14 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: xhaldrv.c,v 1.13 2001/06/29 11:09:48 ekohl Exp $
|
||||
/* $Id: xhaldrv.c,v 1.14 2001/07/04 16:42:37 rex Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -541,6 +541,8 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
|
|||
KEVENT Event;
|
||||
IO_STATUS_BLOCK StatusBlock;
|
||||
ULARGE_INTEGER PartitionOffset;
|
||||
ULARGE_INTEGER nextPartitionOffset;
|
||||
ULARGE_INTEGER containerOffset;
|
||||
PUCHAR SectorBuffer;
|
||||
PIRP Irp;
|
||||
NTSTATUS Status;
|
||||
|
@ -578,6 +580,7 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
|
|||
0x1000);
|
||||
|
||||
PartitionOffset.QuadPart = 0;
|
||||
containerOffset.QuadPart = 0;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -710,18 +713,28 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
|
|||
LayoutBuffer->PartitionCount++;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (IsNormalPartition(PartitionTable->Partition[i].PartitionType))
|
||||
{
|
||||
PartitionOffset.QuadPart = (ULONGLONG)PartitionOffset.QuadPart +
|
||||
(((ULONGLONG)PartitionTable->Partition[i].StartingBlock +
|
||||
(ULONGLONG)PartitionTable->Partition[i].SectorCount)* (ULONGLONG)SectorSize);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (IsExtendedPartition(PartitionTable->Partition[i].PartitionType))
|
||||
{
|
||||
ExtendedFound = TRUE;
|
||||
if ((ULONGLONG) containerOffset.QuadPart == (ULONGLONG) 0)
|
||||
{
|
||||
containerOffset = PartitionOffset;
|
||||
}
|
||||
nextPartitionOffset.QuadPart = (ULONGLONG) containerOffset.QuadPart +
|
||||
(ULONGLONG) PartitionTable->Partition[i].StartingBlock *
|
||||
(ULONGLONG) SectorSize;
|
||||
}
|
||||
}
|
||||
PartitionOffset = nextPartitionOffset;
|
||||
}
|
||||
while (ExtendedFound == TRUE);
|
||||
|
||||
|
@ -731,7 +744,6 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN ULONG SectorSize,
|
||||
|
|
Loading…
Reference in a new issue