Author: cgutman
Date: Wed Mar 7 00:14:13 2012
New Revision: 56071
URL: http://svn.reactos.org/svn/reactos?rev=56071&view=rev
Log:
[NTOSKRNL]
- Hack IopDeleteDriver to workaround the boot driver unloading bugs I mailed ros-dev about
- Should fix KVM testbot
Modified:
trunk/reactos/ntoskrnl/io/iomgr/driver.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Wed Mar 7 00:14:13 2012
@@ -73,12 +73,16 @@
DriverExtension = NextDriverExtension;
}
+#if 0
/* Check if the driver image is still loaded */
if (DriverObject->DriverSection)
{
/* Unload it */
MmUnloadSystemImage(DriverObject->DriverSection);
}
+#else
+ DPRINT1("HACK: Not unloading the driver image due to critical bugs!\n");
+#endif
/* Check if it has a name */
if (DriverObject->DriverName.Buffer)
Author: cgutman
Date: Tue Mar 6 22:50:13 2012
New Revision: 56069
URL: http://svn.reactos.org/svn/reactos?rev=56069&view=rev
Log:
[NTOSKRNL]
- Fix the unload path
- This does expose some bugs: 2 cont-able assertions in ARM3 after unplugging a USB storage device (during usbstor unload), HID unload doesn't seem to work correctly (somebody still has references to the devices), other issues may pop up too
Modified:
trunk/reactos/ntoskrnl/io/iomgr/device.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] Tue Mar 6 22:50:13 2012
@@ -377,8 +377,6 @@
/* Check if deletion is pending */
if (ThisExtension->ExtensionFlags & DOE_DELETE_PENDING)
{
- if (!(ThisExtension->ExtensionFlags & DOE_UNLOAD_PENDING)) return;
-
if (DeviceObject->AttachedDevice)
{
DPRINT("Device object is in the middle of a device stack\n");
@@ -415,7 +413,7 @@
*/
if (DeviceObject->ReferenceCount)
{
- DPRINT("Device object still has %d references\n", DeviceObject->ReferenceCount);
+ DPRINT("Device object still has %d references\n", DeviceObject->ReferenceCount);
return;
}
@@ -432,6 +430,17 @@
}
/* Check the next device */
+ DeviceObject = DeviceObject->NextDevice;
+ }
+
+ /* Loop all the device objects */
+ DeviceObject = DriverObject->DeviceObject;
+ while (DeviceObject)
+ {
+ /* Set the unload pending flag */
+ IoGetDevObjExtension(DeviceObject)->ExtensionFlags |= DOE_UNLOAD_PENDING;
+
+ /* Go to the next device */
DeviceObject = DeviceObject->NextDevice;
}