Skip to content

Commit

Permalink
Rescue Disk: enhance "Boot Original Windows Loader" by using embedded…
Browse files Browse the repository at this point in the history
… backup of original Windows loader if it is missing from disk
  • Loading branch information
idrassi committed Jan 15, 2022
1 parent 981f24b commit 0daec67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions DcsRe/DcsRe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 0daec67

Please sign in to comment.