diff --git a/reactos/drivers/base/serial/pnp.c b/reactos/drivers/base/serial/pnp.c index e1a9bcf6c37..a49f0dc0da0 100644 --- a/reactos/drivers/base/serial/pnp.c +++ b/reactos/drivers/base/serial/pnp.c @@ -193,6 +193,13 @@ SerialPnpStartDevice( return STATUS_INSUFFICIENT_RESOURCES; ComPortBase = (PUCHAR)DeviceExtension->BaseAddress; + /* Test if we are trying to start the serial port used for debugging */ + if (KdComPortInUse && *KdComPortInUse == ULongToPtr(DeviceExtension->BaseAddress)) + { + DPRINT("Failing IRP_MN_START_DEVICE as this serial port is used for debugging\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + if (DeviceExtension->UartType == UartUnknown) DeviceExtension->UartType = SerialDetectUartType(ComPortBase); @@ -329,7 +336,6 @@ SerialPnp( */ case IRP_MN_START_DEVICE: /* 0x0 */ { - BOOLEAN ConflictDetected; DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); ASSERT(((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PnpState == dsStopped); @@ -344,20 +350,6 @@ SerialPnp( Status = STATUS_INSUFFICIENT_RESOURCES; break; } - /* FIXME: HACK: verify that we don't have resource conflict, - * because PnP manager doesn't do it automatically - */ - Status = IoReportResourceForDetection( - DeviceObject->DriverObject, Stack->Parameters.StartDevice.AllocatedResources, 0, - NULL, NULL, 0, - &ConflictDetected); - if (!NT_SUCCESS(Status)) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; - } /* Call lower driver */ Status = ForwardIrpAndWait(DeviceObject, Irp); diff --git a/reactos/drivers/base/serial/serial.h b/reactos/drivers/base/serial/serial.h index b3977e20618..f2999488e91 100644 --- a/reactos/drivers/base/serial/serial.h +++ b/reactos/drivers/base/serial/serial.h @@ -8,6 +8,7 @@ */ #include +#include #include #include diff --git a/reactos/include/ndk/haltypes.h b/reactos/include/ndk/haltypes.h index 9da8109662f..e2ac87d8648 100644 --- a/reactos/include/ndk/haltypes.h +++ b/reactos/include/ndk/haltypes.h @@ -144,7 +144,7 @@ extern HAL_PRIVATE_DISPATCH HalPrivateDispatchTable; // HAL Exports // #ifndef _NTHAL_ -extern PUCHAR *KdComPortInUse; +extern PUCHAR NTSYSAPI *KdComPortInUse; #endif #endif