From 8e6707cc22846e48c62e4730980cfe17595f8c2c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 2 Mar 2015 00:14:25 +0100 Subject: [PATCH] Windows: if TrueCrypt volume created with a version prior to 6.0, display this version in the error message to help users understand why it is not working. --- src/Common/Dlgcode.c | 5 +++-- src/Common/Language.xml | 2 +- src/Common/Volumes.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 6503c599..6ae4062f 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -3978,7 +3978,7 @@ void handleError (HWND hwndDlg, int code) if (Silent) return; - switch (code) + switch (code & 0x0000FFFF) { case ERR_OS_ERROR: handleWin32Error (hwndDlg); @@ -4072,7 +4072,8 @@ void handleError (HWND hwndDlg, int code) break; case ERR_UNSUPPORTED_TRUECRYPT_FORMAT: - MessageBoxW (hwndDlg, GetString ("UNSUPPORTED_TRUECRYPT_FORMAT"), lpszTitle, ICON_HAND); + StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("UNSUPPORTED_TRUECRYPT_FORMAT"), (code >> 24), (code >> 16) & 0x000000FF); + MessageBoxW (hwndDlg, szTmp, lpszTitle, ICON_HAND); break; default: diff --git a/src/Common/Language.xml b/src/Common/Language.xml index 36ce2e24..61207f78 100644 --- a/src/Common/Language.xml +++ b/src/Common/Language.xml @@ -1238,7 +1238,7 @@ WARNING: This setting may degrade performance.\n\nAre you sure you want to use this setting? Warning: VeraCrypt volume auto-dismounted Before you physically remove or turn off a device containing a mounted volume, you should always dismount the volume in VeraCrypt first.\n\nUnexpected spontaneous dismount is usually caused by an intermittently failing cable, drive (enclosure), etc. - VeraCrypt supports only TrueCrypt volumes created with TrueCrypt 6.x series + This volume was created with TrueCrypt %x.%x but VeraCrypt supports only TrueCrypt volumes created with TrueCrypt 6.x/7.x series Test Keyfile Backspace diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c index 4acb9296..73598c64 100644 --- a/src/Common/Volumes.c +++ b/src/Common/Volumes.c @@ -425,7 +425,7 @@ KeyReady: ; { if (cryptoInfo->RequiredProgramVersion < 0x600 || cryptoInfo->RequiredProgramVersion > 0x71a) { - status = ERR_UNSUPPORTED_TRUECRYPT_FORMAT; + status = ERR_UNSUPPORTED_TRUECRYPT_FORMAT | (((int)cryptoInfo->RequiredProgramVersion) << 16); goto err; } cryptoInfo->LegacyVolume = FALSE;