Author: hpoussin
Date: Fri Jun 23 02:14:51 2006
New Revision: 22516
URL:
http://svn.reactos.ru/svn/reactos?rev=22516&view=rev
Log:
Fail start of the serial port currently used for debugging, according to
http://blogs.msdn.com/doronh/archive/2006/06/07/621604.aspx
Modified:
trunk/reactos/drivers/base/serial/pnp.c
trunk/reactos/drivers/base/serial/serial.h
trunk/reactos/drivers/base/serial/serial.rc (props changed)
trunk/reactos/include/ndk/haltypes.h
Modified: trunk/reactos/drivers/base/serial/pnp.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/base/serial/pnp.c?r…
==============================================================================
--- trunk/reactos/drivers/base/serial/pnp.c (original)
+++ trunk/reactos/drivers/base/serial/pnp.c Fri Jun 23 02:14:51 2006
@@ -193,6 +193,13 @@
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 @@
*/
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);
@@ -343,20 +349,6 @@
((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->ComPort);
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 */
Modified: trunk/reactos/drivers/base/serial/serial.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/base/serial/serial.…
==============================================================================
--- trunk/reactos/drivers/base/serial/serial.h (original)
+++ trunk/reactos/drivers/base/serial/serial.h Fri Jun 23 02:14:51 2006
@@ -8,6 +8,7 @@
*/
#include <ntddk.h>
+#include <ndk/haltypes.h>
#include <ntddser.h>
#include <stdio.h>
Propchange: trunk/reactos/drivers/base/serial/serial.rc
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Modified: trunk/reactos/include/ndk/haltypes.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ndk/haltypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/haltypes.h (original)
+++ trunk/reactos/include/ndk/haltypes.h Fri Jun 23 02:14:51 2006
@@ -144,7 +144,7 @@
// HAL Exports
//
#ifndef _NTHAL_
-extern PUCHAR *KdComPortInUse;
+extern PUCHAR NTSYSAPI *KdComPortInUse;
#endif
#endif