VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-22 17:04:32 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-22 17:27:59 +0200
commit587e6db4f16291d8b6f22d0937a4bff87bc8ffc0 (patch)
treec60a12b021182324b9d741981bf8b45b621ee742 /src/Format/Tcformat.c
parent1c3e4fd0ee235ac2cf7cee2c2f6db2ac74ba21c8 (diff)
downloadVeraCrypt-587e6db4f16291d8b6f22d0937a4bff87bc8ffc0.tar.gz
VeraCrypt-587e6db4f16291d8b6f22d0937a4bff87bc8ffc0.zip
Windows: Warn about Fast Startup if it is enabled during system encryption or volume creation and propose to disable it
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r--src/Format/Tcformat.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 6a31883c..69118669 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -8453,6 +8453,7 @@ retryCDDriveCheck:
else if (nCurPageNo == FORMAT_PAGE)
{
/* Format start (the 'Next' button has been clicked on the Format page) */
+ static BOOL g_bFastStartupCheckDone = FALSE;
if (bVolTransformThreadRunning || bVolTransformThreadToRun)
return 1;
@@ -8461,6 +8462,23 @@ retryCDDriveCheck:
bVolTransformThreadToRun = TRUE;
+ // check if Fast Startup is enabled and if yes then offer to disable it
+ if (!g_bFastStartupCheckDone)
+ {
+ BOOL bHibernateEnabled = FALSE, bHiberbootEnabled = FALSE;
+ if (GetHibernateStatus (bHibernateEnabled, bHiberbootEnabled) && bHiberbootEnabled)
+ {
+ if (AskWarnYesNo ("CONFIRM_DISABLE_FAST_STARTUP", hwndDlg) == IDYES)
+ {
+ if (!IsAdmin () && IsUacSupported ())
+ UacWriteLocalMachineRegistryDword (hwndDlg, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", L"HiberbootEnabled", 0);
+ else
+ WriteLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", L"HiberbootEnabled", 0);
+ }
+ }
+ g_bFastStartupCheckDone = true;
+ }
+
fileSystem = (int) SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETITEMDATA,
SendMessage (GetDlgItem (hCurPage, IDC_FILESYS), CB_GETCURSEL, 0, 0) , 0);