1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: Warn about Fast Startup if it is enabled during system encryption or volume creation and propose to disable it

This commit is contained in:
Mounir IDRASSI
2020-07-22 17:04:32 +02:00
parent 1c3e4fd0ee
commit 587e6db4f1
4 changed files with 68 additions and 0 deletions

View File

@@ -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);