Correctly fix the hack introduced in r25667.

svn path=/trunk/; revision=25734
This commit is contained in:
Hervé Poussineau 2007-02-05 23:58:06 +00:00
parent e6eab028de
commit 9c1b205b00
2 changed files with 15 additions and 8 deletions

View file

@ -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 */

View file

@ -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);