Author: fireball Date: Sun Nov 19 20:22:18 2006 New Revision: 24777
URL: http://svn.reactos.org/svn/reactos?rev=24777&view=rev Log: - Add a null-check to the IopLoadServiceModule. - Add a DPRINT1 saying about the possible memory-overwrite bug. This is a hack to get a bootable tree, but still have a note when The Bug happens (look for 'weird' in the debug log).
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.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 (original) +++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Sun Nov 19 20:22:18 2006 @@ -390,6 +390,10 @@ NTSTATUS Status;
DPRINT("IopLoadServiceModule(%wZ, 0x%p)\n", ServiceName, ModuleObject); + + /* FIXME: This check may be removed once the bug is fixed */ + if (ServiceName->Buffer == NULL) + return STATUS_UNSUCCESSFUL;
/* * Get information about the service.
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c... ============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Sun Nov 19 20:22:18 2006 @@ -2321,6 +2321,10 @@ PLDR_DATA_TABLE_ENTRY ModuleObject; PDRIVER_OBJECT DriverObject;
+ /* FIXME: Remove this once the bug is fixed */ + if (DeviceNode->ServiceName.Buffer == NULL) + DPRINT1("Weird DeviceNode %p having ServiceName->Buffer==NULL. Probable stack corruption or memory overwrite.\n", DeviceNode); + Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject); if (NT_SUCCESS(Status) || Status == STATUS_IMAGE_ALREADY_LOADED) {