From d08d31ad435cde71d11566f7dcc2363bcfa9c0fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 13 Jan 2015 20:08:14 +0000 Subject: [PATCH] [FREELDR] Support failing to load some boot drivers In that case, simply skip it and try the next one. svn path=/trunk/; revision=66033 --- reactos/boot/freeldr/freeldr/windows/winldr.c | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/windows/winldr.c b/reactos/boot/freeldr/freeldr/windows/winldr.c index 81c1cbb4f37..408fab20073 100644 --- a/reactos/boot/freeldr/freeldr/windows/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/winldr.c @@ -301,6 +301,7 @@ WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, PLIST_ENTRY NextBd; PBOOT_DRIVER_LIST_ENTRY BootDriver; BOOLEAN Success; + BOOLEAN ret = TRUE; // Walk through the boot drivers list NextBd = LoaderBlock->BootDriverListHead.Flink; @@ -321,24 +322,28 @@ WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, 0, &BootDriver->LdrEntry); - // If loading failed - cry loudly - //FIXME: Maybe remove it from the list and try to continue? - if (!Success) + if (Success) { - ERR("Can't load boot driver '%wZ'!", &BootDriver->FilePath); - UiMessageBox("Can't load boot driver '%wZ'!", &BootDriver->FilePath); - return FALSE; + // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore + BootDriver->RegistryPath.Buffer = PaToVa(BootDriver->RegistryPath.Buffer); + BootDriver->FilePath.Buffer = PaToVa(BootDriver->FilePath.Buffer); + BootDriver->LdrEntry = PaToVa(BootDriver->LdrEntry); } + else + { + // Loading failed - cry loudly + ERR("Can't load boot driver '%wZ'!\n", &BootDriver->FilePath); + UiMessageBox("Can't load boot driver '%wZ'!", &BootDriver->FilePath); + ret = FALSE; - // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore - BootDriver->RegistryPath.Buffer = PaToVa(BootDriver->RegistryPath.Buffer); - BootDriver->FilePath.Buffer = PaToVa(BootDriver->FilePath.Buffer); - BootDriver->LdrEntry = PaToVa(BootDriver->LdrEntry); + // Remove it from the list and try to continue + RemoveEntryList(NextBd); + } NextBd = BootDriver->Link.Flink; } - return TRUE; + return ret; } PVOID -- 2.17.1