VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-08-25 18:02:45 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 22:22:46 (GMT)
commit03cf7cc56625a5227686e669693b2519f4a1fc55 (patch)
treeee9c200cdacad4b11b410d109229eb603f9fbd4b /src
parentf158df394ef0220df7e4ee544548497168e370c5 (diff)
downloadVeraCrypt-03cf7cc56625a5227686e669693b2519f4a1fc55.zip
VeraCrypt-03cf7cc56625a5227686e669693b2519f4a1fc55.tar.gz
Correctly handle dialogs from previous versions that used 'TRUE' instead of 'VERA' as a value for GWLP_USERDATA.
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c6
-rw-r--r--src/Format/Tcformat.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index a7c5e78..fc688bb 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -8414,7 +8414,8 @@ void HandleDriveNotReadyError ()
BOOL CALLBACK CloseTCWindowsEnum (HWND hwnd, LPARAM lParam)
{
- if (GetWindowLongPtr (hwnd, GWLP_USERDATA) == (LONG_PTR) 'VERA')
+ LONG_PTR userDataVal = GetWindowLongPtr (hwnd, GWLP_USERDATA);
+ if ((userDataVal == (LONG_PTR) 'VERA') || (userDataVal == (LONG_PTR) 'TRUE')) // Prior to 1.0e, 'TRUE' was used for VeraCrypt dialogs
{
char name[1024] = { 0 };
GetWindowText (hwnd, name, sizeof (name) - 1);
@@ -8439,7 +8440,8 @@ BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam)
if (*(HWND *)lParam == hwnd)
return TRUE;
- if (GetWindowLongPtr (hwnd, GWLP_USERDATA) == (LONG_PTR) 'VERA')
+ LONG_PTR userDataVal = GetWindowLongPtr (hwnd, GWLP_USERDATA);
+ if ((userDataVal == (LONG_PTR) 'VERA') || (userDataVal == (LONG_PTR) 'TRUE')) // Prior to 1.0e, 'TRUE' was used for VeraCrypt dialogs
{
char name[32] = { 0 };
GetWindowText (hwnd, name, sizeof (name) - 1);
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 3fd9ea3..1cf66b5 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -377,7 +377,8 @@ static void localcleanup (void)
static BOOL CALLBACK BroadcastSysEncCfgUpdateCallb (HWND hwnd, LPARAM lParam)
{
- if (GetWindowLongPtr (hwnd, GWLP_USERDATA) == (LONG_PTR) 'VERA')
+ LONG_PTR userDataVal = GetWindowLongPtr (hwnd, GWLP_USERDATA);
+ if ((userDataVal == (LONG_PTR) 'VERA') || (userDataVal == (LONG_PTR) 'TRUE')) // Prior to 1.0e, 'TRUE' was used for VeraCrypt dialogs
{
char name[1024] = { 0 };
GetWindowText (hwnd, name, sizeof (name) - 1);