diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2018-03-04 18:48:16 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2018-03-04 18:50:23 +0100 |
commit | cd59d5364f5b32ac136e4a91b8534f2410059cde (patch) | |
tree | 12bcb56e15befd8adad7f342f32fff378297e946 /src/Mount/Mount.c | |
parent | 5065116e568defd254ea83909d3b6e6c9b0947ed (diff) | |
download | VeraCrypt-cd59d5364f5b32ac136e4a91b8534f2410059cde.tar.gz VeraCrypt-cd59d5364f5b32ac136e4a91b8534f2410059cde.zip |
Windows: Implement TRIM support for non-system SSD partitions/drives and add driver option to enable it (TRIM is disabled by default for non-system SSD partitions/drives)
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r-- | src/Mount/Mount.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 6eb49a1b..61ce4f77 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -10687,6 +10687,7 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM uint32 driverConfig = ReadDriverConfigurationFlags(); CheckDlgButton (hwndDlg, IDC_ENABLE_HARDWARE_ENCRYPTION, (driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION) ? BST_UNCHECKED : BST_CHECKED); CheckDlgButton (hwndDlg, IDC_ENABLE_EXTENDED_IOCTL_SUPPORT, (driverConfig & TC_DRIVER_CONFIG_ENABLE_EXTENDED_IOCTL) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton (hwndDlg, IDC_ALLOW_TRIM_NONSYS_SSD, (driverConfig & VC_DRIVER_CONFIG_ALLOW_NONSYS_TRIM) ? BST_CHECKED : BST_UNCHECKED); SYSTEM_INFO sysInfo; GetSystemInfo (&sysInfo); @@ -10744,6 +10745,7 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM BOOL disableHW = !IsDlgButtonChecked (hwndDlg, IDC_ENABLE_HARDWARE_ENCRYPTION); BOOL enableExtendedIOCTL = IsDlgButtonChecked (hwndDlg, IDC_ENABLE_EXTENDED_IOCTL_SUPPORT); + BOOL allowTrimCommand = IsDlgButtonChecked (hwndDlg, IDC_ALLOW_TRIM_NONSYS_SSD); try { @@ -10780,6 +10782,7 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM SetDriverConfigurationFlag (TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION, disableHW); SetDriverConfigurationFlag (TC_DRIVER_CONFIG_ENABLE_EXTENDED_IOCTL, enableExtendedIOCTL); + SetDriverConfigurationFlag (VC_DRIVER_CONFIG_ALLOW_NONSYS_TRIM, allowTrimCommand); DWORD bytesReturned; if (!DeviceIoControl (hDriver, TC_IOCTL_REREAD_DRIVER_CONFIG, NULL, 0, NULL, 0, &bytesReturned, NULL)) |