diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-09-20 09:39:22 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-09-20 09:39:22 +0200 |
commit | 0f3ae268a4b0dfac7090f4fbf969601a1c35c86f (patch) | |
tree | 7c0a8afeae852abc98f81d402e3889d526a6fe2c /src/Common/Dlgcode.c | |
parent | b1657e88e4f7922cda6795d843b5b7723b27102f (diff) | |
download | VeraCrypt-0f3ae268a4b0dfac7090f4fbf969601a1c35c86f.tar.gz VeraCrypt-0f3ae268a4b0dfac7090f4fbf969601a1c35c86f.zip |
Windows: Add setting in main UI and setup wizard to disable memory protection
This can be useful for users who need Accessibility software that may not work when memory protection is active in VeraCrypt
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r-- | src/Common/Dlgcode.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 8f357208..fb7184b4 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -32,8 +32,8 @@ #include <process.h> #include <Tlhelp32.h> #endif -#ifdef _WIN32_WINNT >= 0x0602 -#include "processthreadsapi.h"" +#if _WIN32_WINNT >= 0x0602 +#include "processthreadsapi.h" #endif #include "Resource.h" @@ -3256,6 +3256,13 @@ BOOL ReadMemoryProtectionConfig () return (config)? TRUE: FALSE; } +BOOL WriteMemoryProtectionConfig (BOOL bEnable) +{ + DWORD config = bEnable? 1: 0; + + return WriteLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Services\\veracrypt", VC_ENABLE_MEMORY_PROTECTION, config); +} + BOOL LoadSysEncSettings () { BOOL status = TRUE; |