VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Dlgcode.c11
-rw-r--r--src/Common/Dlgcode.h1
-rw-r--r--src/Common/Language.xml1
-rw-r--r--src/Common/Resource.h3
4 files changed, 13 insertions, 3 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;
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 245df6c1..7947fcf9 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -350,6 +350,7 @@ uint32 ReadDriverConfigurationFlags ();
uint32 ReadServiceConfigurationFlags ();
uint32 ReadEncryptionThreadPoolFreeCpuCountLimit ();
BOOL ReadMemoryProtectionConfig ();
+BOOL WriteMemoryProtectionConfig (BOOL bEnable);
BOOL LoadSysEncSettings ();
int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
void RemoveNonSysInPlaceEncNotifications (void);
diff --git a/src/Common/Language.xml b/src/Common/Language.xml
index e819be47..ddb20159 100644
--- a/src/Common/Language.xml
+++ b/src/Common/Language.xml
@@ -1633,6 +1633,7 @@
<entry lang="en" key="EXPANDER_EXTENDING_FILESYSTEM">Extending file system ...\n</entry>
<entry lang="en" key="PARTIAL_SYSENC_MOUNT_READONLY">Warning: The system partition you attempted to mount was not fully encrypted. As a safety measure to prevent potential corruption or unwanted modifications, volume '%s' was mounted as read-only.</entry>
<entry lang="en" key="IDC_LINK_KEYFILES_EXTENSIONS_WARNING">Important information on using third-party file extensions</entry>
+ <entry lang="en" key="IDC_DISABLE_MEMORY_PROTECTION">Disable memory protection in VeraCrypt</entry>
</localization>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="VeraCrypt">
diff --git a/src/Common/Resource.h b/src/Common/Resource.h
index a099c655..b6ad14c0 100644
--- a/src/Common/Resource.h
+++ b/src/Common/Resource.h
@@ -226,6 +226,7 @@
#define IDC_DISABLE_MOUNT_MANAGER 5142
#define IDC_KEYFILES_SIZE_UNIT 5143
#define IDC_LINK_KEYFILES_EXTENSIONS_WARNING 5144
+#define IDC_DISABLE_MEMORY_PROTECTION 5145
// Next default values for new objects
//
@@ -234,7 +235,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 578
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 5145
+#define _APS_NEXT_CONTROL_VALUE 5146
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif