[ros-diffs] [fireball] 30071: - It may happen so, that the driver was loaded by the bootloader, but failed initialization (thus DriverObject == NULL), and later PNP manager tries to install it again, and BSOD due to NULL DriverObject (because really only its image is loaded, but it's not initialized). Prevent this situation by initializing DriverObject in that case.

fireball at svn.reactos.org fireball at svn.reactos.org
Fri Nov 2 17:00:58 CET 2007


Author: fireball
Date: Fri Nov  2 19:00:58 2007
New Revision: 30071

URL: http://svn.reactos.org/svn/reactos?rev=30071&view=rev
Log:
- It may happen so, that the driver was loaded by the bootloader, but failed initialization (thus DriverObject == NULL), and later PNP manager tries to install it again, and BSOD due to NULL DriverObject (because really only its image is loaded, but it's not initialized). Prevent this situation by initializing DriverObject in that case.

Modified:
    trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c?rev=30071&r1=30070&r2=30071&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Fri Nov  2 19:00:58 2007
@@ -2516,7 +2516,8 @@
          {
             /* STATUS_IMAGE_ALREADY_LOADED means this driver
                was loaded by the bootloader */
-            if (Status != STATUS_IMAGE_ALREADY_LOADED)
+            if ((Status != STATUS_IMAGE_ALREADY_LOADED) ||
+                (Status == STATUS_IMAGE_ALREADY_LOADED && !DriverObject))
             {
                /* Initialize the driver */
                Status = IopInitializeDriverModule(DeviceNode, ModuleObject,




More information about the Ros-diffs mailing list