From a1bfaadcd9d9a171f2ffa108d989f769b562fde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Mon, 29 Jul 2024 16:37:17 +0200 Subject: [PATCH] SEBWIN-882, SEBWIN-904, #914: Ensured monitoring is terminated before reconfiguration. --- SafeExamBrowser.Client/App.cs | 2 +- SafeExamBrowser.Client/ClientController.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SafeExamBrowser.Client/App.cs b/SafeExamBrowser.Client/App.cs index cf549be0..170b71d1 100644 --- a/SafeExamBrowser.Client/App.cs +++ b/SafeExamBrowser.Client/App.cs @@ -20,7 +20,7 @@ namespace SafeExamBrowser.Client private const int ILMCM_LANGUAGEBAROFF = 0x00002; private static readonly Mutex Mutex = new Mutex(true, AppConfig.CLIENT_MUTEX_NAME); - private CompositionRoot instances = new CompositionRoot(); + private readonly CompositionRoot instances = new CompositionRoot(); [STAThread] public static void Main() diff --git a/SafeExamBrowser.Client/ClientController.cs b/SafeExamBrowser.Client/ClientController.cs index 07389e28..9a66be2d 100644 --- a/SafeExamBrowser.Client/ClientController.cs +++ b/SafeExamBrowser.Client/ClientController.cs @@ -180,7 +180,6 @@ namespace SafeExamBrowser.Client CloseShell(); DeregisterEvents(); UpdateSessionIntegrity(); - TerminateIntegrityVerification(); var success = operations.TryRevert() == OperationResult.Success; @@ -335,6 +334,7 @@ namespace SafeExamBrowser.Client private void PrepareShutdown() { FinalizeProctoring(); + StopMonitoring(); } private void FinalizeProctoring() @@ -388,6 +388,11 @@ namespace SafeExamBrowser.Client } } + private void StopMonitoring() + { + sentinel.StopMonitoring(); + } + private void VerifyApplicationIntegrity() { logger.Info($"Attempting to verify application integrity..."); @@ -451,11 +456,6 @@ namespace SafeExamBrowser.Client } } - private void TerminateIntegrityVerification() - { - sentinel.StopMonitoring(); - } - private void ApplicationMonitor_ExplorerStarted() { logger.Info("Trying to terminate Windows explorer...");