From 587e6db4f16291d8b6f22d0937a4bff87bc8ffc0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 22 Jul 2020 17:04:32 +0200 Subject: Windows: Warn about Fast Startup if it is enabled during system encryption or volume creation and propose to disable it --- src/Common/BootEncryption.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Common') diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index 502b4e06..0f415394 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -5673,6 +5673,16 @@ namespace VeraCrypt if (!rescueIsoImagePath.empty()) CreateRescueIsoImage (true, rescueIsoImagePath); + + // check if Fast Startup is enabled and if yes then offer to disable it + BOOL bHibernateEnabled = FALSE, bHiberbootEnabled = FALSE; + if (GetHibernateStatus (bHibernateEnabled, bHiberbootEnabled) && bHiberbootEnabled) + { + if (AskWarnYesNo ("CONFIRM_DISABLE_FAST_STARTUP", ParentWindow) == IDYES) + { + WriteLocalMachineRegistryDwordValue (L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", L"HiberbootEnabled", 0); + } + } } bool BootEncryption::IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly) -- cgit v1.2.3