VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-14 01:01:00 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-14 10:49:13 +0100
commit07f6793bd25c7f2eab49292d36b2b64f86dfbf2a (patch)
tree804c8b045e9295b96d29916227751f06b0e102e7 /src/Common
parentd3e7ed96f3685d83dcc39a18574be1dd2cc8f2f6 (diff)
downloadVeraCrypt-07f6793bd25c7f2eab49292d36b2b64f86dfbf2a.tar.gz
VeraCrypt-07f6793bd25c7f2eab49292d36b2b64f86dfbf2a.zip
Windows: enhance support of new behavior of favorite service which is now always running in case of system encryption
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/BootEncryption.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp
index 364f0869..9f065615 100644
--- a/src/Common/BootEncryption.cpp
+++ b/src/Common/BootEncryption.cpp
@@ -4599,8 +4599,6 @@ namespace VeraCrypt
{
WriteLocalMachineRegistryString (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal\\" TC_SYSTEM_FAVORITES_SERVICE_NAME, NULL, L"Service", FALSE);
WriteLocalMachineRegistryString (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Network\\" TC_SYSTEM_FAVORITES_SERVICE_NAME, NULL, L"Service", FALSE);
-
- SetDriverConfigurationFlag (TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD_FOR_SYS_FAVORITES, true);
}
catch (...)
{
@@ -4615,14 +4613,15 @@ namespace VeraCrypt
}
else
{
- SetDriverConfigurationFlag (TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD_FOR_SYS_FAVORITES, false);
-
DeleteLocalMachineRegistryKey (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal", TC_SYSTEM_FAVORITES_SERVICE_NAME);
DeleteLocalMachineRegistryKey (L"SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Network", TC_SYSTEM_FAVORITES_SERVICE_NAME);
SC_HANDLE service = OpenService (scm, TC_SYSTEM_FAVORITES_SERVICE_NAME, SERVICE_ALL_ACCESS);
throw_sys_if (!service);
+ SERVICE_STATUS serviceStatus = {0};
+ ControlService (service, SERVICE_CONTROL_STOP, &serviceStatus);
+
throw_sys_if (!DeleteService (service));
CloseServiceHandle (service);
@@ -4940,7 +4939,7 @@ namespace VeraCrypt
try
{
- RegisterSystemFavoritesService (false);
+ RegisterSystemFavoritesService (FALSE);
}
catch (...) { }
@@ -5168,6 +5167,8 @@ namespace VeraCrypt
InstallVolumeHeader ();
RegisterBootDriver (hiddenSystem);
+
+ RegisterSystemFavoritesService (TRUE);
}
catch (Exception &)
{