From dcd495dbe57fac2cf61efa3b104d9c81e32bde17 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 26 Feb 2003 16:25:40 +0000 Subject: [PATCH] Detect disk manager software. svn path=/trunk/; revision=4201 --- reactos/drivers/storage/disk/disk.c | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/storage/disk/disk.c b/reactos/drivers/storage/disk/disk.c index 8be2874bb78..315d099113b 100644 --- a/reactos/drivers/storage/disk/disk.c +++ b/reactos/drivers/storage/disk/disk.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: disk.c,v 1.21 2003/01/30 22:09:15 ekohl Exp $ +/* $Id: disk.c,v 1.22 2003/02/26 16:25:40 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -401,6 +401,7 @@ DiskClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject, PPARTITION_INFORMATION PartitionEntry; PDISK_DATA DiskData; ULONG PartitionNumber; + PVOID MbrBuffer; NTSTATUS Status; DPRINT("DiskClassCreateDeviceObject() called\n"); @@ -540,6 +541,34 @@ DiskClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject, DPRINT("SectorSize: %lu\n", DiskDeviceExtension->DiskGeometry->BytesPerSector); + /* Check disk for presence of a disk manager */ + HalExamineMBR(DiskDeviceObject, + DiskDeviceExtension->DiskGeometry->BytesPerSector, + 0x54, + &MbrBuffer); + if (MbrBuffer != NULL) + { + DPRINT1("Found 'Ontrack Disk Manager'!\n"); + KeBugCheck(0); + + ExFreePool(MbrBuffer); + MbrBuffer = NULL; + } + + HalExamineMBR(DiskDeviceObject, + DiskDeviceExtension->DiskGeometry->BytesPerSector, + 0x55, + &MbrBuffer); + if (MbrBuffer != NULL) + { + DPRINT1("Found 'EZ-Drive' disk manager!\n"); + KeBugCheck(0); + + ExFreePool(MbrBuffer); + MbrBuffer = NULL; + } + + if ((DiskDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) && (DiskDeviceExtension->DiskGeometry->MediaType == RemovableMedia)) {