Fail start of the serial port currently used for debugging, according to http://blogs.msdn.com/doronh/archive/2006/06/07/621604.aspx

svn path=/trunk/; revision=22516
This commit is contained in:
Hervé Poussineau 2006-06-22 22:14:51 +00:00
parent 6c6b0189cf
commit e57648e8e2
3 changed files with 9 additions and 16 deletions

View file

@ -193,6 +193,13 @@ SerialPnpStartDevice(
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
ComPortBase = (PUCHAR)DeviceExtension->BaseAddress; 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) if (DeviceExtension->UartType == UartUnknown)
DeviceExtension->UartType = SerialDetectUartType(ComPortBase); DeviceExtension->UartType = SerialDetectUartType(ComPortBase);
@ -329,7 +336,6 @@ SerialPnp(
*/ */
case IRP_MN_START_DEVICE: /* 0x0 */ case IRP_MN_START_DEVICE: /* 0x0 */
{ {
BOOLEAN ConflictDetected;
DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
ASSERT(((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PnpState == dsStopped); ASSERT(((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PnpState == dsStopped);
@ -344,20 +350,6 @@ SerialPnp(
Status = STATUS_INSUFFICIENT_RESOURCES; Status = STATUS_INSUFFICIENT_RESOURCES;
break; 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 */ /* Call lower driver */
Status = ForwardIrpAndWait(DeviceObject, Irp); Status = ForwardIrpAndWait(DeviceObject, Irp);

View file

@ -8,6 +8,7 @@
*/ */
#include <ntddk.h> #include <ntddk.h>
#include <ndk/haltypes.h>
#include <ntddser.h> #include <ntddser.h>
#include <stdio.h> #include <stdio.h>

View file

@ -144,7 +144,7 @@ extern HAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
// HAL Exports // HAL Exports
// //
#ifndef _NTHAL_ #ifndef _NTHAL_
extern PUCHAR *KdComPortInUse; extern PUCHAR NTSYSAPI *KdComPortInUse;
#endif #endif
#endif #endif