Author: cgutman
Date: Thu Feb 23 01:23:30 2012
New Revision: 55827
URL: http://svn.reactos.org/svn/reactos?rev=55827&view=rev
Log:
[NTOSKRNL]
- Reenable and fix the correct reset code
[HIDCLASS]
- Disable removal of PDOs due to IRP cancellation issues
[USBEHCI][USBOHCI][USBUHCI]
- Disable removal of FDOs due to reinitialization issues
Modified:
trunk/reactos/drivers/hid/hidclass/pdo.c
trunk/reactos/drivers/usb/usbehci/hcd_controller.cpp
trunk/reactos/drivers/usb/usbohci/hcd_controller.cpp
trunk/reactos/drivers/usb/usbuhci/hcd_controller.cpp
trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c
Modified: trunk/reactos/drivers/hid/hidclass/pdo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/pdo.c…
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/pdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/pdo.c [iso-8859-1] Thu Feb 23 01:23:30 2012
@@ -580,7 +580,12 @@
//
// no/op
//
+#if 0
Status = STATUS_SUCCESS;
+#else
+ DPRINT1("Denying removal of HID device due to IRP cancellation bugs\n");
+ Status = STATUS_UNSUCCESSFUL;
+#endif
break;
}
default:
Modified: trunk/reactos/drivers/usb/usbehci/hcd_controller.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/hcd_co…
==============================================================================
--- trunk/reactos/drivers/usb/usbehci/hcd_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbehci/hcd_controller.cpp [iso-8859-1] Thu Feb 23 01:23:30 2012
@@ -537,6 +537,7 @@
case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE:
{
+#if 0
//
// sure
//
@@ -547,6 +548,12 @@
//
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp);
+#else
+ DPRINT1("Denying controller removal due to reinitialization bugs\n");
+ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_UNSUCCESSFUL;
+#endif
}
case IRP_MN_REMOVE_DEVICE:
{
Modified: trunk/reactos/drivers/usb/usbohci/hcd_controller.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbohci/hcd_co…
==============================================================================
--- trunk/reactos/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] Thu Feb 23 01:23:30 2012
@@ -537,6 +537,7 @@
case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE:
{
+#if 0
//
// sure
//
@@ -547,6 +548,12 @@
//
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp);
+#else
+ DPRINT1("Denying controller removal due to reinitialization bugs\n");
+ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_UNSUCCESSFUL;
+#endif
}
case IRP_MN_REMOVE_DEVICE:
{
Modified: trunk/reactos/drivers/usb/usbuhci/hcd_controller.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbuhci/hcd_co…
==============================================================================
--- trunk/reactos/drivers/usb/usbuhci/hcd_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbuhci/hcd_controller.cpp [iso-8859-1] Thu Feb 23 01:23:30 2012
@@ -537,6 +537,7 @@
case IRP_MN_QUERY_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE:
{
+#if 0
//
// sure
//
@@ -547,6 +548,12 @@
//
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp);
+#else
+ DPRINT1("Denying controller removal due to reinitialization bugs\n");
+ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_UNSUCCESSFUL;
+#endif
}
case IRP_MN_REMOVE_DEVICE:
{
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/plugpla…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] Thu Feb 23 01:23:30 2012
@@ -555,38 +555,37 @@
ASSERT(DeviceNode->Flags & DNF_ENUMERATED);
ASSERT(DeviceNode->Flags & DNF_PROCESSED);
-#if 0
- /* Remove the device node */
- Status = IopRemoveDevice(DeviceNode);
- if (NT_SUCCESS(Status))
- {
- /* Invalidate device relations for the parent to reenumerate the device */
- Status = IoSynchronousInvalidateDeviceRelations(DeviceNode->Parent->PhysicalDeviceObject, BusRelations);
- DPRINT1("A new driver has been loaded for '%wZ'\n", &DeviceInstance);
- }
-#else
- /* FIXME: We might clear some important flags */
- DeviceNode->Flags &= ~DNF_DISABLED;
-
- /* Load service data from the registry */
- Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
-
- if (NT_SUCCESS(Status))
- {
- /* Start the service and begin PnP initialization of the device again */
- Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
- DPRINT1("HACK: A new driver has been loaded for '%wZ' WITHOUT removing the old one\n", &DeviceInstance);
- }
-#endif
- else if (DeviceNode->Flags & DNF_ADDED)
- {
- /* A driver has already been loaded for this device */
- DPRINT1("A reboot is required for the current driver for '%wZ' to be replaced\n", &DeviceInstance);
+ /* Check if there's already a driver loaded for this device */
+ if (DeviceNode->Flags & DNF_ADDED)
+ {
+ /* Remove the device node */
+ Status = IopRemoveDevice(DeviceNode);
+ if (NT_SUCCESS(Status))
+ {
+ /* Invalidate device relations for the parent to reenumerate the device */
+ Status = IoSynchronousInvalidateDeviceRelations(DeviceNode->Parent->PhysicalDeviceObject, BusRelations);
+ DPRINT1("A new driver has been loaded for '%wZ' (FDO above removed)\n", &DeviceNode->InstancePath);
+ }
+ else
+ {
+ /* A driver has already been loaded for this device */
+ DPRINT1("A reboot is required for the current driver for '%wZ' to be replaced\n", &DeviceNode->InstancePath);
+ }
}
else
{
- /* This device needs a driver */
- DPRINT1("A reboot is required for the new driver for '%wZ' to load\n", &DeviceInstance);
+ /* FIXME: What if the device really is disabled? */
+ DeviceNode->Flags &= ~DNF_DISABLED;
+
+ /* Load service data from the registry */
+ Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* Start the service and begin PnP initialization of the device again */
+ Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
+ DPRINT1("A new driver will be loaded for '%wZ' (no FDO above)\n", &DeviceNode->InstancePath);
+ }
}
ObDereferenceObject(DeviceObject);
Author: cgutman
Date: Wed Feb 22 23:08:52 2012
New Revision: 55819
URL: http://svn.reactos.org/svn/reactos?rev=55819&view=rev
Log:
[NTOSKRNL]
- Add back the reset hack of doom to circumvent broken removal code in just about every driver
Modified:
trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/plugpla…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] Wed Feb 22 23:08:52 2012
@@ -552,38 +552,40 @@
/* Get the device node */
DeviceNode = IopGetDeviceNode(DeviceObject);
- /* Check if an FDO has been added to the stack */
- if (DeviceNode->Flags & DNF_ADDED)
- {
- /* Remove the device node */
- Status = IopRemoveDevice(DeviceNode);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("WARNING: Ignoring failed IopRemoveDevice() for %wZ (likely a driver bug)\n", &DeviceNode->InstancePath);
- }
-
+#if 0
+ /* Remove the device node */
+ Status = IopRemoveDevice(DeviceNode);
+ if (NT_SUCCESS(Status))
+ {
/* Invalidate device relations for the parent to reenumerate the device */
Status = IoSynchronousInvalidateDeviceRelations(DeviceNode->Parent->PhysicalDeviceObject, BusRelations);
-
- DPRINT1("Reset PDO with FDO present: 0x%x\n", Status);
+ DPRINT1("A new driver has been loaded for '%wZ'\n", &DeviceInstance);
+ }
+#else
+ /* FIXME: We might clear some important flags */
+ ASSERT(DeviceNode->Flags & DNF_ENUMERATED);
+ ASSERT(DeviceNode->Flags & DNF_PROCESSED);
+ DeviceNode->Flags = DNF_ENUMERATED | DNF_PROCESSED;
+
+ /* Load service data from the registry */
+ Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* Start the service and begin PnP initialization of the device again */
+ Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
+ DPRINT1("HACK: A new driver has been loaded for '%wZ' WITHOUT removing the old one\n", &DeviceInstance);
+ }
+#endif
+ else if (DeviceNode->Flags & DNF_ADDED)
+ {
+ /* A driver has already been loaded for this device */
+ DPRINT1("A reboot is required for the current driver for '%wZ' to be replaced\n", &DeviceInstance);
}
else
{
- /* FIXME: We might clear some important flags */
- ASSERT(DeviceNode->Flags & DNF_ENUMERATED);
- ASSERT(DeviceNode->Flags & DNF_PROCESSED);
- DeviceNode->Flags = DNF_ENUMERATED | DNF_PROCESSED;
-
- /* Load service data from the registry */
- Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
-
- if (NT_SUCCESS(Status))
- {
- /* Start the service and begin PnP initialization of the device again */
- Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
- }
-
- DPRINT1("Reset PDO with no FDO present: 0x%x\n", Status);
+ /* This device needs a driver */
+ DPRINT1("A reboot is required for the new driver for '%wZ' to load\n", &DeviceInstance);
}
ObDereferenceObject(DeviceObject);