From 0daec6723195331472cf0a95d345f89c7a322a9b Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 15 Jan 2022 21:14:20 +0100 Subject: Rescue Disk: enhance "Boot Original Windows Loader" by using embedded backup of original Windows loader if it is missing from disk --- DcsRe/DcsRe.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DcsRe/DcsRe.c b/DcsRe/DcsRe.c index 84f1fee..aa6f2ed 100644 --- a/DcsRe/DcsRe.c +++ b/DcsRe/DcsRe.c @@ -154,6 +154,15 @@ ActionWindowsBoot(IN VOID* ctx) { if (bFound) return EfiExec(gFSHandles[EfiBootVolumeIndex], L"EFI\\Microsoft\\Boot\\bootmgfw.efi"); } + + /* copy our backup copy and then boot from it*/ + if (!EFI_ERROR(FileExist(NULL, L"\\EFI\\Boot\\original_boot" ARCHdot L"vc_backup"))) + { + if (!EFI_ERROR(FileCopy(NULL, L"\\EFI\\Boot\\original_boot" ARCHdot L"vc_backup", EfiBootVolume, L"EFI\\Microsoft\\Boot\\bootmgfw_ms.vc", 1024 * 1024))) + { + return EfiExec(gFSHandles[EfiBootVolumeIndex], L"EFI\\Microsoft\\Boot\\bootmgfw_ms.vc"); + } + } ERR_PRINT(L"Could not find the original Windows loader\r\n"); -- cgit v1.2.3