Author: cgutman
Date: Tue Feb 21 01:26:29 2012
New Revision: 55773
URL:
http://svn.reactos.org/svn/reactos?rev=55773&view=rev
Log:
[NTOSKRNL]
- Add prints to unloading functions because things seem very wonky here
- This exposes some previously unknown behavior of fastfat actually being unloaded in
early boot (with uniata and buslogic failing unload due to missing DriverUnload)
Modified:
trunk/reactos/ntoskrnl/io/iomgr/device.c
trunk/reactos/ntoskrnl/io/iomgr/driver.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 Feb 21 01:26:29 2012
@@ -364,6 +364,13 @@
PDEVICE_NODE DeviceNode;
BOOLEAN SafeToUnload = TRUE;
+ /* We can't unload unless there's an unload handler */
+ if (!DriverObject->DriverUnload)
+ {
+ DPRINT1("No DriverUnload function! '%wZ' will not be
unloaded!\n", &DriverObject->DriverName);
+ return;
+ }
+
/* Check if removal is pending */
ThisExtension = IoGetDevObjExtension(DeviceObject);
if (ThisExtension->ExtensionFlags & DOE_REMOVE_PENDING)
@@ -463,11 +470,13 @@
DeviceObject = DeviceObject->NextDevice;
}
+ DPRINT1("Unloading driver '%wZ' (automatic)\n",
&DriverObject->DriverName);
+
/* Set the unload invoked flag */
DriverObject->Flags |= DRVO_UNLOAD_INVOKED;
/* Unload it */
- if (DriverObject->DriverUnload) DriverObject->DriverUnload(DriverObject);
+ DriverObject->DriverUnload(DriverObject);
/* Make object temporary so it can be deleted */
ObMakeTemporaryObject(DriverObject);
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] Tue Feb 21 01:26:29 2012
@@ -57,6 +57,8 @@
PDRIVER_OBJECT DriverObject = ObjectBody;
PIO_CLIENT_EXTENSION DriverExtension, NextDriverExtension;
PAGED_CODE();
+
+ DPRINT1("Deleting driver object '%wZ'\n",
&DriverObject->DriverName);
/* Get the extension and loop them */
DriverExtension = IoGetDrvObjExtension(DriverObject)->
@@ -1284,6 +1286,8 @@
return STATUS_SUCCESS;
}
+ DPRINT1("Unloading driver '%wZ' (manual)\n",
&DriverObject->DriverName);
+
/* Set the unload invoked flag */
DriverObject->Flags |= DRVO_UNLOAD_INVOKED;
@@ -1323,6 +1327,8 @@
}
else
{
+ DPRINT1("No DriverUnload function! '%wZ' will not be
unloaded!\n", &DriverObject->DriverName);
+
/* Dereference one time (refd inside this function) */
ObDereferenceObject(DriverObject);