From 5eb89e0c5ab04bf8e5e113ac6cc7e4d203ff83af Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Thu, 28 Jun 2001 02:42:27 +0000 Subject: [PATCH] fixed problem with extended partitions that contain only Linux logical partitions svn path=/trunk/; revision=2014 --- reactos/include/ntos/disk.h | 5 ++++- reactos/ntoskrnl/io/xhaldrv.c | 15 +++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/reactos/include/ntos/disk.h b/reactos/include/ntos/disk.h index 4fa70d49cdc..e5e0d19617a 100644 --- a/reactos/include/ntos/disk.h +++ b/reactos/include/ntos/disk.h @@ -1,4 +1,4 @@ -/* $Id: disk.h,v 1.5 2001/06/07 21:16:17 ekohl Exp $ +/* $Id: disk.h,v 1.6 2001/06/28 02:42:27 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -84,6 +84,9 @@ ((P) == PTDosExtended || \ (P) == PTWin95ExtendedLBA) +#define IsNormalPartition(P) \ + ((P) != PTEmpty && \ + !IsExtendedPartition(P)) typedef enum _MEDIA_TYPE { Unknown, diff --git a/reactos/ntoskrnl/io/xhaldrv.c b/reactos/ntoskrnl/io/xhaldrv.c index 3dfc2d4cf4a..58c01efd090 100644 --- a/reactos/ntoskrnl/io/xhaldrv.c +++ b/reactos/ntoskrnl/io/xhaldrv.c @@ -1,4 +1,4 @@ -/* $Id: xhaldrv.c,v 1.10 2001/06/08 15:11:04 ekohl Exp $ +/* $Id: xhaldrv.c,v 1.11 2001/06/28 02:42:27 rex Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -42,7 +42,6 @@ (P) == PTWin95FAT32LBA || \ (P) == PTWin95FAT16LBA) - typedef struct _PARTITION { unsigned char BootFlags; @@ -618,7 +617,7 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject, NotificationEvent, FALSE); - DPRINT("PartitionOffset: %I64u\n", PartitionOffset.QuadPart / SectorSize); + DPRINT1("PartitionOffset: %I64u\n", PartitionOffset.QuadPart / SectorSize); Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ, DeviceObject, @@ -641,7 +640,7 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject, if (!NT_SUCCESS(Status)) { - DPRINT("xHalIoReadPartitonTable failed (Status = 0x%08lx)\n", + DbgPrint("xHalIoReadPartitonTable failed (Status = 0x%08lx)\n", Status); ExFreePool(SectorBuffer); ExFreePool(LayoutBuffer); @@ -654,16 +653,16 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject, DPRINT("Magic %x\n", PartitionTable->Magic); if (PartitionTable->Magic != PARTITION_MAGIC) { - DPRINT("Invalid partition table magic\n"); + DbgPrint("Invalid partition table magic\n"); ExFreePool(SectorBuffer); *PartitionBuffer = LayoutBuffer; return STATUS_SUCCESS; } -#ifndef NDEBUG +#if 1 /* ndef NDEBUG */ for (i = 0; i < PARTITION_TBL_SIZE; i++) { - DPRINT(" %d: flags:%2x type:%x start:%d:%d:%d end:%d:%d:%d stblk:%d count:%d\n", + DPRINT1(" %d: flags:%2x type:%x start:%d:%d:%d end:%d:%d:%d stblk:%d count:%d\n", i, PartitionTable->Partition[i].BootFlags, PartitionTable->Partition[i].PartitionType, @@ -743,7 +742,7 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject, LayoutBuffer->PartitionCount++; } - if (IsUsablePartition(PartitionTable->Partition[i].PartitionType)) + if (IsNormalPartition(PartitionTable->Partition[i].PartitionType)) { PartitionOffset.QuadPart = (ULONGLONG)PartitionOffset.QuadPart + (((ULONGLONG)PartitionTable->Partition[i].StartingBlock +