mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: make Setup correctly manage option to disable memory protection during upgrade
This commit is contained in:
@@ -75,6 +75,7 @@ BOOL bSystemRestore = TRUE;
|
|||||||
BOOL bDisableSwapFiles = FALSE;
|
BOOL bDisableSwapFiles = FALSE;
|
||||||
BOOL bForAllUsers = TRUE;
|
BOOL bForAllUsers = TRUE;
|
||||||
BOOL bDisableMemoryProtection = FALSE;
|
BOOL bDisableMemoryProtection = FALSE;
|
||||||
|
BOOL bOriginalDisableMemoryProtection = FALSE;
|
||||||
BOOL bRegisterFileExt = TRUE;
|
BOOL bRegisterFileExt = TRUE;
|
||||||
BOOL bAddToStartMenu = TRUE;
|
BOOL bAddToStartMenu = TRUE;
|
||||||
BOOL bDesktopIcon = TRUE;
|
BOOL bDesktopIcon = TRUE;
|
||||||
@@ -2336,9 +2337,10 @@ void DoInstall (void *arg)
|
|||||||
if (bSystemRestore)
|
if (bSystemRestore)
|
||||||
SetSystemRestorePoint (hwndDlg, TRUE);
|
SetSystemRestorePoint (hwndDlg, TRUE);
|
||||||
|
|
||||||
if (bOK && bDisableMemoryProtection)
|
if (bOK && (bDisableMemoryProtection != bOriginalDisableMemoryProtection))
|
||||||
{
|
{
|
||||||
WriteMemoryProtectionConfig(FALSE);
|
WriteMemoryProtectionConfig(bDisableMemoryProtection? FALSE : TRUE);
|
||||||
|
bRestartRequired = TRUE; // Restart is required to apply the new memory protection settings
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bOK)
|
if (bOK)
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ extern BOOL bSystemRestore;
|
|||||||
extern BOOL bDisableSwapFiles;
|
extern BOOL bDisableSwapFiles;
|
||||||
extern BOOL bForAllUsers;
|
extern BOOL bForAllUsers;
|
||||||
extern BOOL bDisableMemoryProtection;
|
extern BOOL bDisableMemoryProtection;
|
||||||
|
extern BOOL bOriginalDisableMemoryProtection;
|
||||||
extern BOOL bRegisterFileExt;
|
extern BOOL bRegisterFileExt;
|
||||||
extern BOOL bAddToStartMenu;
|
extern BOOL bAddToStartMenu;
|
||||||
extern BOOL bDesktopIcon;
|
extern BOOL bDesktopIcon;
|
||||||
|
|||||||
@@ -883,6 +883,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
DonColorSchemeId = GetDonVal (2, 9);
|
DonColorSchemeId = GetDonVal (2, 9);
|
||||||
|
|
||||||
|
// get the initial value of bDisableMemoryProtection by reading the registry
|
||||||
|
bDisableMemoryProtection = bOriginalDisableMemoryProtection = ReadMemoryProtectionConfig()? FALSE : TRUE;
|
||||||
|
|
||||||
if (bDevm)
|
if (bDevm)
|
||||||
{
|
{
|
||||||
InitWizardDestInstallPath ();
|
InitWizardDestInstallPath ();
|
||||||
|
|||||||
Reference in New Issue
Block a user