diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-03-08 00:56:47 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-03-08 01:03:04 +0100 |
commit | 76c03c23a1f985efebcb76e3b56a2c1b3b01af52 (patch) | |
tree | ca92c9e75a9935615c60152c987860da0a93458b /src/Mount/Mount.c | |
parent | f780011a865bb0b935e104f93b1ba2c2a1bb3a88 (diff) | |
download | VeraCrypt-76c03c23a1f985efebcb76e3b56a2c1b3b01af52.tar.gz VeraCrypt-76c03c23a1f985efebcb76e3b56a2c1b3b01af52.zip |
Windows: inform user that RAM encryption setting requires reboot to take effect
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r-- | src/Mount/Mount.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 467f4962..5f96afba 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -11219,6 +11219,9 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM try { VOLUME_PROPERTIES_STRUCT prop; + bool rebootRequired = false; + uint32 driverConfig = ReadDriverConfigurationFlags(); + try { BootEncStatus = BootEncObj->GetStatus(); @@ -11256,7 +11259,12 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM SetDriverConfigurationFlag (VC_DRIVER_CONFIG_ALLOW_WINDOWS_DEFRAG, allowWindowsDefrag); SetDriverConfigurationFlag (VC_DRIVER_CONFIG_ENABLE_CPU_RNG, enableCpuRng); if (IsOSAtLeast (WIN_7)) + { + BOOL originalRamEncryptionEnabled = (driverConfig & VC_DRIVER_CONFIG_ENABLE_RAM_ENCRYPTION)? TRUE : FALSE; + if (originalRamEncryptionEnabled != enableRamEncryption) + rebootRequired = true; SetDriverConfigurationFlag (VC_DRIVER_CONFIG_ENABLE_RAM_ENCRYPTION, enableRamEncryption); + } DWORD bytesReturned; if (!DeviceIoControl (hDriver, TC_IOCTL_REREAD_DRIVER_CONFIG, NULL, 0, NULL, 0, &bytesReturned, NULL)) @@ -11276,9 +11284,12 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM if (ReadEncryptionThreadPoolFreeCpuCountLimit() != cpuFreeCount) { BootEncObj->WriteLocalMachineRegistryDwordValue (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", TC_ENCRYPTION_FREE_CPU_COUNT_REG_VALUE_NAME, cpuFreeCount); - Warning ("SETTING_REQUIRES_REBOOT", hwndDlg); + rebootRequired = true; } + if (rebootRequired) + Warning ("SETTING_REQUIRES_REBOOT", hwndDlg); + EndDialog (hwndDlg, lw); return 1; } @@ -11320,6 +11331,17 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_ENCRYPTION_FREE_CPU_COUNT), IsDlgButtonChecked (hwndDlg, IDC_LIMIT_ENC_THREAD_POOL)); return 1; + case IDC_ENABLE_RAM_ENCRYPTION: + { + uint32 driverConfig = ReadDriverConfigurationFlags(); + BOOL originalRamEncryptionEnabled = (driverConfig & VC_DRIVER_CONFIG_ENABLE_RAM_ENCRYPTION)? TRUE : FALSE; + BOOL enableRamEncryption = IsDlgButtonChecked (hwndDlg, IDC_ENABLE_RAM_ENCRYPTION); + + if (originalRamEncryptionEnabled != enableRamEncryption) + Warning ("SETTING_REQUIRES_REBOOT", hwndDlg); + } + return 1; + case IDC_BENCHMARK: Benchmark (hwndDlg); return 1; |