From b6c290e4fd77c5d4ae1f5fb68e69006d49e1ad52 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 21 Jan 2020 00:53:32 +0100 Subject: Windows: Fix failure of Screen Readers (Accessibility support) to reader UI by disabling newly introduced memory protection by default and adding a CLI switch (/protectMemory) to enable it when needed. This fixes issue https://github.com/veracrypt/VeraCrypt/issues/536 --- src/Format/Tcformat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Format') diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 58800aa5..3d394c16 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -6145,6 +6145,12 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa ExtractCommandLine (hwndDlg, (wchar_t *) lParam); + if (EnableMemoryProtection) + { + /* Protect this process memory from being accessed by non-admin users */ + EnableProcessProtection (); + } + if (ComServerMode) { InitDialog (hwndDlg); @@ -9001,6 +9007,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) OptionNoSizeCheck, OptionQuickFormat, OptionFastCreateFile, + OptionEnableMemoryProtection, }; argument args[]= @@ -9024,6 +9031,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) { OptionNoSizeCheck, L"/nosizecheck", NULL, FALSE }, { OptionQuickFormat, L"/quick", NULL, FALSE }, { OptionFastCreateFile, L"/fastcreatefile", NULL, FALSE }, + { OptionEnableMemoryProtection, L"/protectMemory", NULL, FALSE }, // Internal { CommandResumeSysEncLogOn, L"/acsysenc", L"/a", TRUE }, @@ -9384,6 +9392,10 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) CmdFastCreateFile = TRUE; break; + case OptionEnableMemoryProtection: + EnableMemoryProtection = TRUE; + break; + case OptionHistory: { wchar_t szTmp[8] = {0}; -- cgit v1.2.3