From: Cameron Gutman Date: Sat, 22 May 2010 16:12:59 +0000 (+0000) Subject: [NTOSKRNL] X-Git-Tag: backups/header-work@57446~11^2~288 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=d7bbeaed19404486112b642de54d754b8370d393;hp=df9115f1d23ff7cccae0a9fe356a0ce9e0bbc09c;ds=sidebyside [NTOSKRNL] - Print a warning instead of crashing when a driver provides a NULL pointer in the MajorFunction array svn path=/trunk/; revision=47308 --- diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index d32957ec7d7..7dcb0354ea1 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -1556,11 +1556,14 @@ try_again: * 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; }