[ros-diffs] [cgutman] 47308: [NTOSKRNL] - Print a warning instead of crashing when a driver provides a NULL pointer in the MajorFunction array

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sat May 22 18:12:59 CEST 2010


Author: cgutman
Date: Sat May 22 18:12:59 2010
New Revision: 47308

URL: http://svn.reactos.org/svn/reactos?rev=47308&view=rev
Log:
[NTOSKRNL]
- Print a warning instead of crashing when a driver provides a NULL pointer in the MajorFunction array

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?rev=47308&r1=47307&r2=47308&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Sat May 22 18:12:59 2010
@@ -1556,11 +1556,14 @@
          * Doing so is illegal; drivers shouldn't touch entry points they
          * do not implement.
          */
-        ASSERT(DriverObject->MajorFunction[i] != NULL);
 
         /* Check if it did so anyway */
-		if (!DriverObject->MajorFunction[i])
+        if (!DriverObject->MajorFunction[i])
         {
+            /* Print a warning in the debug log */
+            DPRINT1("Driver <%wZ> set DriverObject->MajorFunction[%d] to NULL!\n",
+                    &DriverObject->DriverName, i);
+
             /* Fix it up */
             DriverObject->MajorFunction[i] = IopInvalidDeviceRequest;
         }




More information about the Ros-diffs mailing list