From 9741c9209d0deedcc5d60434e5e7df3c531ff192 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 22 Nov 2019 00:08:41 +0100 Subject: Windows: Add new registry flags for SystemFavoritesService to control updating of EFI BIOS boot menu on shutdown. This will help better manage multi-boot scenarios where we should not mess up with boot order (e.g. grub2 case) --- src/Mount/Mount.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Mount') diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 9ba4ae86..7f677580 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -9436,9 +9436,16 @@ static DWORD WINAPI SystemFavoritesServiceCtrlHandler ( DWORD dwControl, { // re-install our bootloader again in case the update process has removed it. bool bForceSetNextBoot = false; - if (BootEncObj->ReadServiceConfigurationFlags () & VC_SYSTEM_FAVORITES_SERVICE_CONFIG_FORCE_SET_BOOTNEXT) + bool bSetBootentry = true; + bool bForceFirstBootEntry = true; + uint32 flags = BootEncObj->ReadServiceConfigurationFlags (); + if (flags & VC_SYSTEM_FAVORITES_SERVICE_CONFIG_FORCE_SET_BOOTNEXT) bForceSetNextBoot = true; - BootEncryption bootEnc (NULL, true, bForceSetNextBoot); + if (flags & VC_SYSTEM_FAVORITES_SERVICE_CONFIG_DONT_SET_BOOTENTRY) + bSetBootentry = false; + if (flags & VC_SYSTEM_FAVORITES_SERVICE_CONFIG_DONT_FORCE_FIRST_BOOTENTRY) + bForceFirstBootEntry = false; + BootEncryption bootEnc (NULL, true, bSetBootentry, bForceFirstBootEntry, bForceSetNextBoot); bootEnc.InstallBootLoader (true); } } -- cgit v1.2.3