VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-03-08 17:03:51 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-03-12 00:26:11 +0100
commit5e3d756806fd6c5aee7b813a2f059ea7759da477 (patch)
treec1ebb9434b4ac1a9bd3c4e0071835a97eeb625e5
parentc215c5d0b28352d239ae88aa1d621ff8d43a7742 (diff)
downloadVeraCrypt-5e3d756806fd6c5aee7b813a2f059ea7759da477.tar.gz
VeraCrypt-5e3d756806fd6c5aee7b813a2f059ea7759da477.zip
Windows: make TRIM blocking option grayed in System -> Settings UI under hidden OS since TRIM commands are always blocked in this case.
-rw-r--r--src/Mount/Mount.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index ac9ef105..759b6ca7 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -11112,2 +11112,3 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
BOOL bBlockSysEncTrimEnabled = (driverConfig & VC_DRIVER_CONFIG_BLOCK_SYS_TRIM)? TRUE : FALSE;
+ BOOL bIsHiddenOS = IsHiddenOSRunning ();
@@ -11153,3 +11154,10 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
CheckDlgButton (hwndDlg, IDC_BOOT_LOADER_CACHE_PIM, (bPasswordCacheEnabled && bPimCacheEnabled)? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton (hwndDlg, IDC_BLOCK_SYSENC_TRIM, bBlockSysEncTrimEnabled ? BST_CHECKED : BST_UNCHECKED);
+ if (bIsHiddenOS)
+ {
+ // we always block TRIM command on hidden OS regardless of the configuration
+ CheckDlgButton (hwndDlg, IDC_BLOCK_SYSENC_TRIM, BST_CHECKED);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_BLOCK_SYSENC_TRIM), FALSE);
+ }
+ else
+ CheckDlgButton (hwndDlg, IDC_BLOCK_SYSENC_TRIM, bBlockSysEncTrimEnabled ? BST_CHECKED : BST_UNCHECKED);
}
@@ -11270,3 +11278,4 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_DISABLE_EVIL_MAID_ATTACK_DETECTION, IsDlgButtonChecked (hwndDlg, IDC_DISABLE_EVIL_MAID_ATTACK_DETECTION));
- SetDriverConfigurationFlag (VC_DRIVER_CONFIG_BLOCK_SYS_TRIM, bBlockSysEncTrimEnabled);
+ if (!IsHiddenOSRunning ()) /* we don't need to update TRIM config for hidden OS since it's always blocked */
+ SetDriverConfigurationFlag (VC_DRIVER_CONFIG_BLOCK_SYS_TRIM, bBlockSysEncTrimEnabled);
}