From 9c1b205b002965b482e1c39810a2df707d44c2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 5 Feb 2007 23:58:06 +0000 Subject: [PATCH] Correctly fix the hack introduced in r25667. svn path=/trunk/; revision=25734 --- reactos/ntoskrnl/ex/init.c | 5 +---- reactos/ntoskrnl/io/iomgr/driver.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 3c317f99b8b..f747464ec87 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -1186,10 +1186,7 @@ Phase1InitializationDiscard(PVOID Context) InbvUpdateProgressBar(85); /* Make sure nobody touches the loader block again */ - /* FIXME: IopLoadServiceModule() touches KeLoaderBlock->LoadOrderListHead, - and that happens past this point too. So either copy that list to the - Io's allocated space, or properly fix Io. */ - //if (LoaderBlock == KeLoaderBlock) KeLoaderBlock = NULL; + if (LoaderBlock == KeLoaderBlock) KeLoaderBlock = NULL; LoaderBlock = Context = NULL; /* Update progress bar */ diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index fb551ab0787..cc57166add2 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -443,19 +443,29 @@ IopLoadServiceModule( if (*ModuleObject == NULL) { - Status = STATUS_UNSUCCESSFUL; + /* + * Case for disabled drivers + */ + + if (ServiceStart >= 4) + { + /* FIXME: Check if it is the right status code */ + Status = STATUS_PLUGPLAY_NO_DEVICE; + } /* * Special case for boot modules that were loaded by boot loader. */ - if (ServiceStart == 0) + else if (KeLoaderBlock) { WCHAR SearchNameBuffer[256]; UNICODE_STRING SearchName; PLIST_ENTRY ListHead, NextEntry; PLDR_DATA_TABLE_ENTRY LdrEntry; + Status = STATUS_UNSUCCESSFUL; + /* * FIXME: * Improve this searching algorithm by using the image name @@ -499,10 +509,10 @@ IopLoadServiceModule( } /* - * Case for rest of the drivers (except disabled) + * Case for rest of the drivers */ - else if (ServiceStart < 4) + else { DPRINT("Loading module\n"); Status = LdrLoadModule(&ServiceImagePath, ModuleObject);