VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-26 21:00:07 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-26 21:01:46 (GMT)
commit684259b43833c0579fd03ea0c1a4215df26bb21f (patch)
treef8d5426bf28e8cf5e4ab3e2291176573815d6014 /src/Common
parent0e2be7153fd189272ec2d228bcf94ec682a396bc (diff)
downloadVeraCrypt-684259b43833c0579fd03ea0c1a4215df26bb21f.zip
VeraCrypt-684259b43833c0579fd03ea0c1a4215df26bb21f.tar.gz
Windows: Fix sporadic keyboard issue in Secure Desktop for password dialog by not using the trick to put it reliably in foreground. The trick is based on a emulation of ALT+TAB but sometimes ALT key would remain pressed in case of Secure Desktop making it impossible to type the password (a workaround was to press CTRL key which reset the state of ALT key)
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Dlgcode.c6
-rw-r--r--src/Common/Dlgcode.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 64c1147..63081dd 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -221,6 +221,9 @@ static std::vector<HostDevice> rawHostDeviceList;
/* Critical section used to ensure that only one thread at a time can create a secure desktop */
CRITICAL_SECTION csSecureDesktop;
+/* Boolean that indicates if our Secure Desktop is active and being user of not */
+BOOL bSecureDesktopOngoing = FALSE;
+
HINSTANCE hInst = NULL;
HCURSOR hCursor = NULL;
@@ -13584,7 +13587,8 @@ INT_PTR SecureDesktopDialogBoxParam(
HDESK hInputDesk = NULL;
EnterCriticalSection (&csSecureDesktop);
- finally_do ({ LeaveCriticalSection (&csSecureDesktop); });
+ bSecureDesktopOngoing = TRUE;
+ finally_do ({ bSecureDesktopOngoing = FALSE; LeaveCriticalSection (&csSecureDesktop); });
// wait for the input desktop to be available before switching to
// secure desktop. Under Windows 10, the user session can be started
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 54475cb..5ff97af 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -124,6 +124,7 @@ extern BOOL bHideWaitingDialog;
extern BOOL bCmdHideWaitingDialog;
extern BOOL bCmdHideWaitingDialogValid;
extern BOOL bUseSecureDesktop;
+extern BOOL bSecureDesktopOngoing;
extern BOOL bUseLegacyMaxPasswordLength;
extern BOOL bCmdUseSecureDesktop;
extern BOOL bCmdUseSecureDesktopValid;