diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-09-24 01:26:02 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-09-24 01:26:02 +0200 |
commit | 76c64d49ea96719bf1a5d185053619001b0aa533 (patch) | |
tree | dfb0d7b9d3f6ad21e6886a2b2ec1b6aab85288d9 /src/Mount/Mount.c | |
parent | 07c827c84979560fbc8eace567ac5a7f9ac3a279 (diff) | |
download | VeraCrypt-76c64d49ea96719bf1a5d185053619001b0aa533.tar.gz VeraCrypt-76c64d49ea96719bf1a5d185053619001b0aa533.zip |
Windows: Add tooltip message and help button for new option to disable memory protection
Also a dedicated page in the documentation was added for it.
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r-- | src/Mount/Mount.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 28418a44..76de34b6 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -11574,6 +11574,7 @@ void NotifyService (DWORD dwNotifyCmd) static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + static HWND hDisableMemProtectionTooltipWnd = NULL; WORD lw = LOWORD (wParam); switch (msg) @@ -11652,9 +11653,24 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_HW_ACCELERATION); ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION); + + hDisableMemProtectionTooltipWnd = CreateToolTip (IDC_DISABLE_MEMORY_PROTECTION, hwndDlg, "DISABLE_MEMORY_PROTECTION_WARNING"); + // make IDC_DISABLE_MEMORY_PROTECTION control fit the text so that the tooltip is shown only when mouse is over the text + AccommodateCheckBoxTextWidth(hwndDlg, IDC_DISABLE_MEMORY_PROTECTION); + // make the help button adjacent to the checkbox + MakeControlsContiguous(hwndDlg, IDC_DISABLE_MEMORY_PROTECTION, IDC_DISABLE_MEMORY_PROTECTION_HELP); } return 0; + // handle message to destroy hDisableMemProtectionTooltipWnd when the dialog is closed + case WM_DESTROY: + if (hDisableMemProtectionTooltipWnd) + { + DestroyWindow (hDisableMemProtectionTooltipWnd); + hDisableMemProtectionTooltipWnd = NULL; + } + break; + case WM_COMMAND: switch (lw) @@ -11852,10 +11868,18 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM BOOL originalDisableMemoryProtection = !ReadMemoryProtectionConfig(); if (disableMemoryProtection != originalDisableMemoryProtection) { + if (disableMemoryProtection) + { + Warning ("DISABLE_MEMORY_PROTECTION_WARNING", hwndDlg); + } + Warning ("SETTING_REQUIRES_REBOOT", hwndDlg); } } return 1; + case IDC_DISABLE_MEMORY_PROTECTION_HELP: + Applink ("memoryprotection"); + return 1; case IDC_BENCHMARK: Benchmark (hwndDlg); return 1; |