VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mount')
-rw-r--r--src/Mount/Favorites.cpp28
-rw-r--r--src/Mount/Favorites.h6
-rw-r--r--src/Mount/Hotkeys.c76
-rw-r--r--src/Mount/Mount.c208
-rw-r--r--src/Mount/Mount.rc39
-rw-r--r--src/Mount/Resource.h4
6 files changed, 232 insertions, 129 deletions
diff --git a/src/Mount/Favorites.cpp b/src/Mount/Favorites.cpp
index 12e744aa..5d56345e 100644
--- a/src/Mount/Favorites.cpp
+++ b/src/Mount/Favorites.cpp
@@ -55,6 +55,12 @@ namespace VeraCrypt
if (favorite.Path.find ("\\??\\") == 0)
favorite.Path = favorite.Path.substr (4);
+ if (wcslen (prop.wszLabel))
+ {
+ favorite.Label = prop.wszLabel;
+ favorite.UseLabelInExplorer = true;
+ }
+
if (IsVolumeDeviceHosted (favorite.Path.c_str()))
{
// Get GUID path
@@ -373,6 +379,9 @@ namespace VeraCrypt
case IDC_FAVORITES_HELP_LINK:
Applink (SystemFavoritesMode ? "sysfavorites" : "favorites", TRUE, "");
return 1;
+ case IDC_SHOW_PIM:
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PIM, IDC_PIM, 0);
+ return 1;
}
return 0;
@@ -472,20 +481,27 @@ namespace VeraCrypt
}
- wstring GetFavoriteVolumeLabel (const string &volumePath)
+ wstring GetFavoriteVolumeLabel (const string &volumePath, bool& useInExplorer)
{
foreach (const FavoriteVolume &favorite, FavoriteVolumes)
{
if (favorite.Path == volumePath)
+ {
+ useInExplorer = favorite.UseLabelInExplorer;
return favorite.Label;
+ }
}
foreach (const FavoriteVolume &favorite, SystemFavoriteVolumes)
{
if (favorite.Path == volumePath)
+ {
+ useInExplorer = favorite.UseLabelInExplorer;
return favorite.Label;
+ }
}
+ useInExplorer = false;
return wstring();
}
@@ -592,6 +608,10 @@ namespace VeraCrypt
if (boolVal[0])
favorite.MountOnLogOn = (boolVal[0] == '1');
+ XmlGetAttributeText (xml, "useLabelInExplorer", boolVal, sizeof (boolVal));
+ if (boolVal[0])
+ favorite.UseLabelInExplorer = (boolVal[0] == '1') && !favorite.ReadOnly;
+
if (favorite.Path.find ("\\\\?\\Volume{") == 0 && favorite.Path.rfind ("}\\") == favorite.Path.size() - 2)
{
string resolvedPath = VolumeGuidPathToDevicePath (favorite.Path);
@@ -716,6 +736,9 @@ namespace VeraCrypt
if (favorite.OpenExplorerWindow)
s += L" openExplorerWindow=\"1\"";
+ if (favorite.UseLabelInExplorer && !favorite.ReadOnly)
+ s += L" useLabelInExplorer=\"1\"";
+
s += L">" + SingleStringToWide (tq) + L"</volume>";
fwprintf (f, L"%ws", s.c_str());
@@ -791,6 +814,7 @@ namespace VeraCrypt
else
SetDlgItemText (hwndDlg, IDC_PIM, "");
SetDlgItemTextW (hwndDlg, IDC_FAVORITE_LABEL, favorite.Label.c_str());
+ SetCheckBox (hwndDlg, IDC_FAVORITE_USE_LABEL_IN_EXPLORER, favorite.UseLabelInExplorer);
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_ON_LOGON, favorite.MountOnLogOn);
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_ON_ARRIVAL, favorite.MountOnArrival);
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_READONLY, favorite.ReadOnly);
@@ -820,6 +844,7 @@ namespace VeraCrypt
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM_HELP), enable);
EnableWindow (GetDlgItem (hwndDlg, IDT_FAVORITE_LABEL), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_LABEL), enable);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_USE_LABEL_IN_EXPLORER), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOUNT_ON_LOGON), enable && !systemFavoritesMode);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOUNT_ON_ARRIVAL), enable && !systemFavoritesMode);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOUNT_READONLY), enable);
@@ -846,6 +871,7 @@ namespace VeraCrypt
favorite.Label.clear();
favorite.Pim = GetPim (hwndDlg, IDC_PIM);
+ favorite.UseLabelInExplorer = (IsDlgButtonChecked (hwndDlg, IDC_FAVORITE_USE_LABEL_IN_EXPLORER) != 0);
favorite.ReadOnly = (IsDlgButtonChecked (hwndDlg, IDC_FAVORITE_MOUNT_READONLY) != 0);
favorite.Removable = (IsDlgButtonChecked (hwndDlg, IDC_FAVORITE_MOUNT_REMOVABLE) != 0);
diff --git a/src/Mount/Favorites.h b/src/Mount/Favorites.h
index b7ffc1e7..f82037c4 100644
--- a/src/Mount/Favorites.h
+++ b/src/Mount/Favorites.h
@@ -29,7 +29,8 @@ namespace VeraCrypt
OpenExplorerWindow (false),
ReadOnly (false),
Removable (false),
- SystemEncryption (false)
+ SystemEncryption (false),
+ UseLabelInExplorer (false)
{
}
@@ -47,6 +48,7 @@ namespace VeraCrypt
bool ReadOnly;
bool Removable;
bool SystemEncryption;
+ bool UseLabelInExplorer;
};
struct FavoriteVolumesDlgProcArguments
@@ -67,7 +69,7 @@ namespace VeraCrypt
static void FillFavoriteVolumesMenu ();
static void FillListControl (HWND favoriteListControl, vector <FavoriteVolume> &favorites);
static void FillListControlSubItems (HWND favoriteListControl, int line, const FavoriteVolume &favorite);
- wstring GetFavoriteVolumeLabel (const string &volumePath);
+ wstring GetFavoriteVolumeLabel (const string &volumePath, bool& useInExplorer);
void LoadFavoriteVolumes ();
void LoadFavoriteVolumes (vector <FavoriteVolume> &favorites, bool systemFavorites, bool noUacElevation = false);
static void OnFavoriteVolumesUpdated ();
diff --git a/src/Mount/Hotkeys.c b/src/Mount/Hotkeys.c
index 140c172e..b9d166a9 100644
--- a/src/Mount/Hotkeys.c
+++ b/src/Mount/Hotkeys.c
@@ -30,6 +30,7 @@ static TCHOTKEY tmpHotkeys [NBR_HOTKEYS];
static int nSelectedHotkeyId;
static UINT currentVKeyCode;
+static BYTE vkeysDown[256];
static void ScanAndProcessKey (UINT *vKeyCode, wchar_t *keyName)
@@ -41,9 +42,15 @@ static void ScanAndProcessKey (UINT *vKeyCode, wchar_t *keyName)
{
if (GetAsyncKeyState (vKey) < 0)
{
- if (GetKeyName (vKey, keyName)) // If the key is allowed and its name has been resolved
- *vKeyCode = vKey;
+ if (!vkeysDown [vKey])
+ {
+ vkeysDown [vKey] = 1;
+ if (GetKeyName (vKey, keyName)) // If the key is allowed and its name has been resolved
+ *vKeyCode = vKey;
+ }
}
+ else
+ vkeysDown [vKey] = 0;
}
}
@@ -62,6 +69,56 @@ BOOL GetKeyName (UINT vKey, wchar_t *keyName)
{
// OEM-specific
StringCbPrintfW (keyName, MAX_KEY_COMB_NAME_LEN, L"OEM-%d", vKey);
+
+ // mapping taken from:
+ // http://www.hotkeynet.com/ref/keynames.html
+ // https://mojoware.googlecode.com/svn-history/r3/trunk/mojo_engine/cKeyboard.cpp
+ // http://www.screenio.com/gui_screenio/gs_htmlhelp_subweb/download/SIMKEYS.cob
+ //
+ // These values seem to come from Nokia/Ericsson mobile device keys
+
+ switch (vKey)
+ {
+ case 0xE9: // OEMReset = 0xE9
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMReset)");
+ break;
+ case 0xEA: // OEMJump = 0xEA
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMJump)");
+ break;
+ case 0xEB: // OEMPA1 = 0xEB
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMPA1)");
+ break;
+ case 0xEC: // OEMPA2 = 0xEC
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMPA2)");
+ break;
+ case 0xED: // OEMPA3 = 0xED
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMPA3)");
+ break;
+ case 0xEE: // OEMWSCtrl = 0xEE
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMWSCtrl)");
+ break;
+ case 0xEF: // OEMCUSel = 0xEF
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMCUSel)");
+ break;
+ case 0xF0: // OEMATTN = 0xF0
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMATTN)");
+ break;
+ case 0xF1: // OEMFinish = 0xF1
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMFinish)");
+ break;
+ case 0xF2: // OEMCopy = 0xF2
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMCopy)");
+ break;
+ case 0xF3: // OEMAuto = 0xF3
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMAuto)");
+ break;
+ case 0xF4: // OEMENLW = 0xF4
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMENLW)");
+ break;
+ case 0xF5: // OEMBackTab = 0xF5
+ StringCbCatW (keyName, MAX_KEY_COMB_NAME_LEN, L" (OEMBackTab)");
+ break;
+ }
}
else if (vKey >= VK_F1 && vKey <= VK_F24)
{
@@ -296,6 +353,7 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
nSelectedHotkeyId = -1;
currentVKeyCode = 0;
memcpy (tmpHotkeys, Hotkeys, sizeof(tmpHotkeys));
+ memset (vkeysDown, 0, sizeof(vkeysDown));
SendMessageW (hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_LABELTIP
@@ -337,7 +395,7 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_TIMER:
{
- if (nSelectedHotkeyId > -1)
+ if ((nSelectedHotkeyId > -1) && (GetFocus () == GetDlgItem (hwndDlg, IDC_HOTKEY_KEY)))
{
wchar_t keyName [MAX_KEY_COMB_NAME_LEN];
UINT tmpVKeyCode;
@@ -352,6 +410,10 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
SetWindowTextW (GetDlgItem (hwndDlg, IDC_HOTKEY_KEY), keyName);
EnableWindow (GetDlgItem (hwndDlg, IDC_HOTKEY_ASSIGN), TRUE);
}
+ else if ((currentVKeyCode != 0) && GetKeyName (currentVKeyCode, keyName))
+ {
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_HOTKEY_KEY), keyName);
+ }
}
return 1;
}
@@ -365,6 +427,8 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
LVITEM item;
memset(&item,0,sizeof(item));
nSelectedHotkeyId = ((LPNMLISTVIEW) lParam)->iItem;
+ currentVKeyCode = 0;
+ memset (vkeysDown, 0, sizeof(vkeysDown));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_HOTKEY_KEY), GetString ("PRESS_A_KEY_TO_ASSIGN"));
EnableWindow (GetDlgItem (hwndDlg, IDC_HOTKEY_REMOVE), (tmpHotkeys[nSelectedHotkeyId].vKeyCode > 0));
@@ -446,6 +510,8 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
EnableWindow (GetDlgItem (hwndDlg, IDC_HOTKEY_REMOVE), FALSE);
nSelectedHotkeyId = -1;
bKeyScanOn = FALSE;
+ currentVKeyCode = 0;
+ memset (vkeysDown, 0, sizeof(vkeysDown));
}
}
DisplayHotkeyList(hwndDlg);
@@ -463,6 +529,8 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
EnableWindow (GetDlgItem (hwndDlg, IDC_HOTKEY_REMOVE), FALSE);
nSelectedHotkeyId = -1;
bKeyScanOn = FALSE;
+ currentVKeyCode = 0;
+ memset (vkeysDown, 0, sizeof(vkeysDown));
DisplayHotkeyList(hwndDlg);
}
return 1;
@@ -482,6 +550,8 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
EnableWindow (GetDlgItem (hwndDlg, IDC_HOTKEY_REMOVE), FALSE);
nSelectedHotkeyId = -1;
bKeyScanOn = FALSE;
+ currentVKeyCode = 0;
+ memset (vkeysDown, 0, sizeof(vkeysDown));
DisplayHotkeyList(hwndDlg);
return 1;
}
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 63f593ed..5e5719c5 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -429,6 +429,12 @@ BOOL VolumeSelected (HWND hwndDlg)
return (GetWindowTextLength (GetDlgItem (hwndDlg, IDC_VOLUME)) > 0);
}
+void GetVolumePath (HWND hwndDlg, LPSTR szPath, int nMaxCount)
+{
+ GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), szPath, nMaxCount);
+ CorrectFileName (szPath);
+}
+
/* Returns TRUE if the last partition/drive selected via the Select Device dialog box was the system
partition/drive and if it is encrypted.
WARNING: This function is very fast but not always reliable (for example, if the user manually types
@@ -447,7 +453,7 @@ BOOL ActiveSysEncDeviceSelected (void)
{
int retCode = 0;
- GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), szFileName, sizeof (szFileName));
+ GetVolumePath (MainDlg, szFileName, sizeof (szFileName));
retCode = IsSystemDevicePath (szFileName, MainDlg, FALSE);
@@ -496,7 +502,7 @@ static string ResolveAmbiguousSelection (HWND hwndDlg, int *driveNoPtr)
if (VolumeSelected (MainDlg))
{
// volPathInputField will contain the volume path (if any) from the input field below the drive list
- GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), volPathInputField, sizeof (volPathInputField));
+ GetVolumePath (MainDlg, volPathInputField, sizeof (volPathInputField));
if (!ambig)
retPath = (string) volPathInputField;
@@ -639,45 +645,6 @@ static string ResolveAmbiguousSelection (HWND hwndDlg, int *driveNoPtr)
return retPath;
}
-static void ConfigReadCompareInt(char *configKey, int defaultValue, int* pOutputValue, BOOL bOnlyCheckModified, BOOL* pbModified)
-{
- int intValue = ConfigReadInt (configKey, defaultValue);
- if (pOutputValue)
- {
- if (pbModified && (*pOutputValue != intValue))
- *pbModified = TRUE;
- if (!bOnlyCheckModified)
- *pOutputValue = intValue;
- }
-}
-
-static void ConfigReadCompareString (char *configKey, char *defaultValue, char *str, int maxLen, BOOL bOnlyCheckModified, BOOL *pbModified)
-{
- char *strValue = (char*) malloc (maxLen);
- if (strValue)
- {
- memcpy (strValue, str, maxLen);
-
- ConfigReadString (configKey, defaultValue, strValue, maxLen);
-
- if (pbModified && strcmp (str, strValue))
- *pbModified = TRUE;
- if (!bOnlyCheckModified)
- memcpy(str, strValue, maxLen);
-
- free (strValue);
- }
- else
- {
- /* allocation failed. Suppose that value changed */
- if (pbModified)
- *pbModified = TRUE;
- if (!bOnlyCheckModified)
- ConfigReadString (configKey, defaultValue, str, maxLen);
-
- }
-}
-
void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL* pbSettingsModified, BOOL* pbHistoryModified)
{
char langid[6] = {0};
@@ -767,7 +734,7 @@ void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL*
if (LOWORD (lLetter) != 0xffff)
StringCbPrintfA (szTmp, sizeof(szTmp), "%c:", (char) HIWORD (lLetter));
- ConfigReadCompareString ("LastSelectedDrive", "", szDriveLetter, sizeof (szDriveLetter), bOnlyCheckModified, pbSettingsModified);
+ ConfigReadCompareString ("LastSelectedDrive", "", szTmp, sizeof (szTmp), bOnlyCheckModified, pbSettingsModified);
}
ConfigReadCompareString ("SecurityTokenLibrary", "", SecurityTokenLibraryPath, sizeof (SecurityTokenLibraryPath) - 1, bOnlyCheckModified, pbSettingsModified);
@@ -1135,7 +1102,7 @@ BOOL CheckSysEncMountWithoutPBA (HWND hwndDlg, const char *devicePath, BOOL quie
if (strlen (devicePath) < 2)
{
- GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), szDevicePath, sizeof (szDevicePath));
+ GetVolumePath (MainDlg, szDevicePath, sizeof (szDevicePath));
CreateFullVolumePath (szDiskFile, sizeof(szDiskFile), szDevicePath, &tmpbDevice);
if (!tmpbDevice)
@@ -1622,7 +1589,11 @@ void LoadDriveLetters (HWND hwndDlg, HWND hTree, int drive)
listItem.iSubItem = 1;
- wstring label = GetFavoriteVolumeLabel (path);
+ // first check label used for mounting. If empty, look for it in favorites.
+ bool useInExplorer = false;
+ wstring label = (wchar_t *) driver.wszLabel[i];
+ if (label.empty())
+ label = GetFavoriteVolumeLabel (path, useInExplorer);
if (!label.empty())
ListSubItemSetW (hTree, listItem.iItem, 1, (wchar_t *) label.c_str());
else
@@ -1898,6 +1869,13 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
PimValueChangedWarning = FALSE;
ZeroMemory (&newKeyFilesParam, sizeof (newKeyFilesParam));
+ if (NewPimValuePtr)
+ {
+ /* we are in the case of a volume. Store its name to use it in the key file dialog
+ * this will help avoid using the current container file as a key file
+ */
+ StringCbCopyA (newKeyFilesParam.VolumeFileName, sizeof (newKeyFilesParam.VolumeFileName), szFileName);
+ }
SetWindowTextW (hwndDlg, GetString ("IDD_PASSWORDCHANGE_DLG"));
LocalizeDialog (hwndDlg, "IDD_PASSWORDCHANGE_DLG");
@@ -1979,7 +1957,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_CONFIRM_PASSWORD), FALSE);
- EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PKCS5_PRF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), FALSE);
break;
@@ -2002,7 +1980,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_CONFIRM_PASSWORD), FALSE);
- EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PKCS5_PRF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), FALSE);
break;
@@ -2340,26 +2318,14 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (lw == IDC_SHOW_PASSWORD_CHPWD_ORI)
{
- SendMessage (GetDlgItem (hwndDlg, IDC_OLD_PASSWORD),
- EM_SETPASSWORDCHAR,
- GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_ORI) ? 0 : '*',
- 0);
- InvalidateRect (GetDlgItem (hwndDlg, IDC_OLD_PASSWORD), NULL, TRUE);
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_ORI, IDC_OLD_PASSWORD, IDC_OLD_PIM);
return 1;
}
if (lw == IDC_SHOW_PASSWORD_CHPWD_NEW)
{
- SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD),
- EM_SETPASSWORDCHAR,
- GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW) ? 0 : '*',
- 0);
- SendMessage (GetDlgItem (hwndDlg, IDC_VERIFY),
- EM_SETPASSWORDCHAR,
- GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW) ? 0 : '*',
- 0);
- InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD), NULL, TRUE);
- InvalidateRect (GetDlgItem (hwndDlg, IDC_VERIFY), NULL, TRUE);
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW, IDC_PASSWORD, IDC_VERIFY);
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW, IDC_PIM, 0);
return 1;
}
@@ -2418,7 +2384,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
return 1;
}
- GetWindowText (GetDlgItem (hParent, IDC_VOLUME), szFileName, sizeof (szFileName));
+ GetVolumePath (hParent, szFileName, sizeof (szFileName));
GetWindowText (GetDlgItem (hwndDlg, IDC_OLD_PASSWORD), (LPSTR) oldPassword.Text, sizeof (oldPassword.Text));
oldPassword.Length = (unsigned __int32) strlen ((char *) oldPassword.Text);
@@ -2441,11 +2407,11 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
WaitCursor ();
if (KeyFilesEnable)
- KeyFilesApply (hwndDlg, &oldPassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &oldPassword, FirstKeyFile, szFileName);
if (newKeyFilesParam.EnableKeyFiles)
{
- if (!KeyFilesApply (hwndDlg, &newPassword, pwdChangeDlgMode == PCDM_CHANGE_PKCS5_PRF ? FirstKeyFile : newKeyFilesParam.FirstKeyFile))
+ if (!KeyFilesApply (hwndDlg, &newPassword, pwdChangeDlgMode == PCDM_CHANGE_PKCS5_PRF ? FirstKeyFile : newKeyFilesParam.FirstKeyFile, szFileName))
{
nStatus = ERR_DONT_REPORT;
goto err;
@@ -2547,10 +2513,13 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
RECT rect;
GetWindowRect (hwndDlg, &rect);
- wstring label = GetFavoriteVolumeLabel (PasswordDlgVolume);
+ bool useInExplorer = false;
+ wstring label = GetFavoriteVolumeLabel (PasswordDlgVolume, useInExplorer);
if (!label.empty())
{
StringCbPrintfW (s, sizeof(s), GetString ("ENTER_PASSWORD_FOR_LABEL"), label.c_str());
+ if (useInExplorer)
+ StringCbCopyW (mountOptions.Label, sizeof (mountOptions.Label), label.c_str());
}
else
{
@@ -2686,10 +2655,13 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
return 1;
}
- SetCheckBox (hwndDlg, IDC_SHOW_PASSWORD, FALSE);
+ if (GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD))
+ {
+ // simulate hiding password
+ SetCheckBox (hwndDlg, IDC_SHOW_PASSWORD, FALSE);
- SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD), EM_SETPASSWORDCHAR, '*', 0);
- InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD), NULL, TRUE);
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_PIM);
+ }
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
@@ -2771,11 +2743,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
if (lw == IDC_SHOW_PASSWORD)
{
- SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD),
- EM_SETPASSWORDCHAR,
- GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD) ? 0 : '*',
- 0);
- InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD), NULL, TRUE);
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_PIM);
return 1;
}
@@ -2820,7 +2788,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
if (lw == IDOK)
{
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
- KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile);
+ KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, strlen (PasswordDlgVolume) > 0 ? PasswordDlgVolume : NULL);
GetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD), (LPSTR) szXPwd->Text, MAX_PASSWORD + 1);
szXPwd->Length = (unsigned __int32) strlen ((char *) szXPwd->Text);
@@ -3199,6 +3167,9 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow (GetDlgItem (hwndDlg, IDC_MOUNT_SYSENC_PART_WITHOUT_PBA), !bPrebootPasswordDlgMode);
+ SetDlgItemTextW (hwndDlg, IDC_VOLUME_LABEL, mountOptions->Label);
+ SendDlgItemMessage (hwndDlg, IDC_VOLUME_LABEL, EM_LIMITTEXT, 32, 0); // 32 is the maximum possible length for a drive label in Windows
+
/* Add PRF algorithm list for hidden volume password */
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
@@ -3300,11 +3271,7 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (lw == IDC_SHOW_PASSWORD_MO)
{
- SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL),
- EM_SETPASSWORDCHAR,
- GetCheckBox (hwndDlg, IDC_SHOW_PASSWORD_MO) ? 0 : '*',
- 0);
- InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), NULL, TRUE);
+ HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD_MO, IDC_PASSWORD_PROT_HIDVOL, IDC_PIM);
return 1;
}
@@ -3344,6 +3311,8 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
mountOptions->ProtectHiddenVolume = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PROTECT_HIDDEN_VOL));
mountOptions->PartitionInInactiveSysEncScope = IsButtonChecked (GetDlgItem (hwndDlg, IDC_MOUNT_SYSENC_PART_WITHOUT_PBA));
mountOptions->UseBackupHeader = IsButtonChecked (GetDlgItem (hwndDlg, IDC_USE_EMBEDDED_HEADER_BAK));
+
+ GetDlgItemTextW (hwndDlg, IDC_VOLUME_LABEL, mountOptions->Label, sizeof (mountOptions->Label) /sizeof (wchar_t));
if (mountOptions->ProtectHiddenVolume)
{
@@ -4241,7 +4210,7 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName, int pim)
if (szFileName == NULL)
{
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), fileName, sizeof (fileName));
+ GetVolumePath (hwndDlg, fileName, sizeof (fileName));
szFileName = fileName;
}
@@ -4284,7 +4253,7 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName, int pim)
Password emptyPassword;
emptyPassword.Length = 0;
- KeyFilesApply (hwndDlg, &emptyPassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &emptyPassword, FirstKeyFile, szFileName);
// try TrueCrypt mode first since it is quick, only if pim = 0
if (EffectiveVolumePim == 0)
mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &emptyPassword, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
@@ -4346,7 +4315,7 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName, int pim)
WaitCursor ();
if (KeyFilesEnable)
- KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile, szFileName);
mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, VolumePkcs5, VolumePim, VolumeTrueCryptMode, bCacheInDriver, bForceMount, &mountOptions, Silent, !Silent);
NormalCursor ();
@@ -4464,7 +4433,7 @@ static BOOL DismountAll (HWND hwndDlg, BOOL forceUnmount, BOOL interact, int dis
DWORD dwResult;
UNMOUNT_STRUCT unmount = {0};
BOOL bResult;
- unsigned __int32 prevMountedDrives = 0;
+ MOUNT_LIST_STRUCT prevMountList = {0};
int i;
retry:
@@ -4480,7 +4449,7 @@ retry:
BroadcastDeviceChange (DBT_DEVICEREMOVEPENDING, 0, mountList.ulMountedDrives);
- prevMountedDrives = mountList.ulMountedDrives;
+ memcpy (&prevMountList, &mountList, sizeof (mountList));
for (i = 0; i < 26; i++)
{
@@ -4541,7 +4510,17 @@ retry:
memset (&mountList, 0, sizeof (mountList));
DeviceIoControl (hDriver, TC_IOCTL_GET_MOUNTED_VOLUMES, &mountList, sizeof (mountList), &mountList, sizeof (mountList), &dwResult, NULL);
- BroadcastDeviceChange (DBT_DEVICEREMOVECOMPLETE, 0, prevMountedDrives & ~mountList.ulMountedDrives);
+
+ // remove any custom label from registry
+ for (i = 0; i < 26; i++)
+ {
+ if ((prevMountList.ulMountedDrives & (1 << i)) && (!(mountList.ulMountedDrives & (1 << i))) && wcslen (prevMountList.wszLabel[i]))
+ {
+ UpdateDriveCustomLabel (i, prevMountList.wszLabel[i], FALSE);
+ }
+ }
+
+ BroadcastDeviceChange (DBT_DEVICEREMOVECOMPLETE, 0, prevMountList.ulMountedDrives & ~mountList.ulMountedDrives);
RefreshMainDlg (hwndDlg);
@@ -4656,9 +4635,9 @@ static BOOL MountAllDevicesThreadCode (HWND hwndDlg, BOOL bPasswordPrompt)
WaitCursor();
if (FirstCmdKeyFile)
- KeyFilesApply (hwndDlg, &VolumePassword, FirstCmdKeyFile);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstCmdKeyFile, NULL);
else if (KeyFilesEnable)
- KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile, NULL);
}
@@ -4871,7 +4850,7 @@ static void ChangePassword (HWND hwndDlg)
INT_PTR result;
int newPimValue = -1;
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), szFileName, sizeof (szFileName));
+ GetVolumePath (hwndDlg, szFileName, sizeof (szFileName));
if (IsMountedVolume (szFileName))
{
Warning (pwdChangeDlgMode == PCDM_CHANGE_PKCS5_PRF ? "MOUNTED_NO_PKCS5_PRF_CHANGE" : "MOUNTED_NOPWCHANGE", hwndDlg);
@@ -5216,7 +5195,7 @@ static void DecryptNonSysDevice (HWND hwndDlg, BOOL bResolveAmbiguousSelection,
char volPath [TC_MAX_PATH];
- GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), volPath, sizeof (volPath));
+ GetVolumePath (MainDlg, volPath, sizeof (volPath));
scPath = volPath;
}
@@ -5895,7 +5874,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
BOOL reportBadPasswd = CmdVolumePassword.Length > 0;
if (FirstCmdKeyFile)
- KeyFilesApply (hwndDlg, &CmdVolumePassword, FirstCmdKeyFile);
+ KeyFilesApply (hwndDlg, &CmdVolumePassword, FirstCmdKeyFile, szFileName);
mounted = MountVolume (hwndDlg, szDriveLetter[0] - 'A',
szFileName, &CmdVolumePassword, EffectiveVolumePkcs5, CmdVolumePim, EffectiveVolumeTrueCryptMode, bCacheInDriver, bForceMount,
@@ -5934,7 +5913,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
WaitCursor ();
if (KeyFilesEnable && FirstKeyFile)
- KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile, szFileName);
mounted = MountVolume (hwndDlg, szDriveLetter[0] - 'A', szFileName, &VolumePassword, VolumePkcs5, VolumePim, VolumeTrueCryptMode, bCacheInDriver, bForceMount, &mountOptions, FALSE, TRUE);
@@ -6438,7 +6417,11 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (wcsstr (vol, L"\\??\\")) vol += 4;
- wstring label = GetFavoriteVolumeLabel (WideToSingleString (vol));
+ // first check label used for mounting. If empty, look for it in favorites.
+ bool useInExplorer = false;
+ wstring label = (wchar_t *) LastKnownMountList.wszLabel[i];
+ if (label.empty())
+ label = GetFavoriteVolumeLabel (WideToSingleString (vol), useInExplorer);
StringCbPrintfW (s, sizeof(s), L"%s %c: (%s)",
GetString (n==0 ? "OPEN" : "DISMOUNT"),
@@ -6668,7 +6651,11 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
- KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile);
+ {
+ char selectedVolume [TC_MAX_PATH + 1];
+ GetVolumePath (hwndDlg, selectedVolume, sizeof (selectedVolume));
+ KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, selectedVolume);
+ }
}
if (CheckMountList (hwndDlg, FALSE))
@@ -7063,7 +7050,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else
{
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), volPath, sizeof (volPath));
+ GetVolumePath (hwndDlg, volPath, sizeof (volPath));
WaitCursor ();
@@ -7086,7 +7073,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else
{
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), volPath, sizeof (volPath));
+ GetVolumePath (hwndDlg, volPath, sizeof (volPath));
WaitCursor ();
@@ -7362,7 +7349,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
wchar_t volPathLowerW[TC_MAX_PATH];
// volPathLower will contain the volume path (if any) from the input field below the drive list
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), volPathLower, sizeof (volPathLower));
+ GetVolumePath (hwndDlg, volPathLower, sizeof (volPathLower));
if (LOWORD (selectedDrive) != TC_MLIST_ITEM_NONSYS_VOL
&& !(VolumeSelected (hwndDlg) && IsMountedVolume (volPathLower)))
@@ -7508,7 +7495,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
char volPath[TC_MAX_PATH]; /* Volume to mount */
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), volPath, sizeof (volPath));
+ GetVolumePath (hwndDlg, volPath, sizeof (volPath));
WaitCursor ();
@@ -7535,7 +7522,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
char volPath[TC_MAX_PATH]; /* Volume to mount */
- GetWindowText (GetDlgItem (hwndDlg, IDC_VOLUME), volPath, sizeof (volPath));
+ GetVolumePath (hwndDlg, volPath, sizeof (volPath));
WaitCursor ();
@@ -7979,7 +7966,7 @@ void ExtractCommandLine (HWND hwndDlg, char *lpszCommandLine)
case OptionMountOption:
{
- char szTmp[16] = {0};
+ char szTmp[64] = {0};
if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs,
&i, nNoCommandLineArgs, szTmp, sizeof (szTmp)))
{
@@ -8000,7 +7987,12 @@ void ExtractCommandLine (HWND hwndDlg, char *lpszCommandLine)
else if (!_stricmp (szTmp, "recovery"))
mountOptions.RecoveryMode = TRUE;
-
+ else if ((strlen(szTmp) > 6) && (strlen(szTmp) <= 38) && !_strnicmp (szTmp, "label=", 6))
+ {
+ // get the label
+ memmove (szTmp, &szTmp[6], (strlen(szTmp) - 6) + 1);
+ MultiByteToWideChar (CP_ACP, 0, szTmp, -1, mountOptions.Label, sizeof (mountOptions.Label) / sizeof(wchar_t));
+ }
else
AbortProcess ("COMMAND_LINE_ERROR");
@@ -8508,6 +8500,10 @@ static BOOL MountFavoriteVolumeBase (const FavoriteVolume &favorite, BOOL& lastb
mountOptions.ReadOnly = favorite.ReadOnly || userForcedReadOnly;
mountOptions.Removable = favorite.Removable;
+ if (favorite.UseLabelInExplorer && !favorite.Label.empty())
+ StringCbCopyW (mountOptions.Label, sizeof (mountOptions.Label), favorite.Label.c_str());
+ else
+ ZeroMemory (mountOptions.Label, sizeof (mountOptions.Label));
if (favorite.SystemEncryption)
{
@@ -9019,7 +9015,7 @@ int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const char *lps
WaitCursor();
if (KeyFilesEnable && FirstKeyFile)
- KeyFilesApply (hwndDlg, askPassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, askPassword, FirstKeyFile, lpszVolume);
nStatus = OpenVolume (askVol, lpszVolume, askPassword, *askPkcs5, *askPim, VolumeTrueCryptMode, FALSE, bPreserveTimestamp, FALSE);
@@ -9290,7 +9286,7 @@ int RestoreVolumeHeader (HWND hwndDlg, const char *lpszVolume)
WaitCursor();
if (KeyFilesEnable && FirstKeyFile)
- KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile, lpszVolume);
nStatus = OpenVolume (&volume, lpszVolume, &VolumePassword, VolumePkcs5, VolumePim, VolumeTrueCryptMode,TRUE, bPreserveTimestamp, TRUE);
@@ -9490,7 +9486,7 @@ int RestoreVolumeHeader (HWND hwndDlg, const char *lpszVolume)
}
if (KeyFilesEnable && FirstKeyFile)
- KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile, bDevice? NULL : lpszVolume);
// Decrypt volume header
headerOffsetBackupFile = 0;
@@ -10172,7 +10168,11 @@ void MountSelectedVolume (HWND hwndDlg, BOOL mountWithOptions)
return;
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
- KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile);
+ {
+ char selectedVolume [TC_MAX_PATH + 1];
+ GetVolumePath (hwndDlg, selectedVolume, sizeof (selectedVolume));
+ KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, selectedVolume);
+ }
}
if (CheckMountList (hwndDlg, FALSE))
diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc
index eb665d47..14283f4e 100644
--- a/src/Mount/Mount.rc
+++ b/src/Mount/Mount.rc
@@ -114,14 +114,14 @@ BEGIN
EDITTEXT IDC_OLD_PASSWORD,89,14,162,13,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_OLD_PRF_ID,89,33,85,90,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,35,78,10
- EDITTEXT IDC_OLD_PIM,89,51,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ EDITTEXT IDC_OLD_PIM,89,51,42,14,ES_RIGHT | ES_PASSWORD | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,59,97,10
CONTROL "Use keyfiles",IDC_ENABLE_KEYFILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,72,98,10
PUSHBUTTON "Keyfiles...",IDC_KEYFILES,192,70,59,14
CONTROL "Display password",IDC_SHOW_PASSWORD_CHPWD_ORI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,85,138,10,WS_EX_TRANSPARENT
EDITTEXT IDC_PASSWORD,89,121,162,13,ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT IDC_VERIFY,89,137,162,13,ES_PASSWORD | ES_AUTOHSCROLL
- EDITTEXT IDC_PIM,89,154,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ EDITTEXT IDC_PIM,89,154,42,14,ES_RIGHT | ES_PASSWORD | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
CONTROL "Use PIM",IDC_NEW_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,161,97,10
CONTROL "Use keyfiles",IDC_ENABLE_NEW_KEYFILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,172,99,11
PUSHBUTTON "Keyfiles...",IDC_NEW_KEYFILES,192,170,59,14
@@ -182,7 +182,7 @@ BEGIN
EDITTEXT IDC_PASSWORD,69,8,166,14,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_PRF_ID,69,26,86,90,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,28,76,10
- EDITTEXT IDC_PIM,69,43,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ EDITTEXT IDC_PIM,69,43,42,14,ES_RIGHT | ES_PASSWORD | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,48,97,10
CONTROL "Cache passwords and keyfil&es in memory",IDC_CACHE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,61,153,10
@@ -315,7 +315,7 @@ BEGIN
LTEXT "",IDT_LIMIT_ENC_THREAD_POOL_NOTE,18,126,334,33
END
-IDD_FAVORITE_VOLUMES DIALOGEX 0, 0, 380, 315
+IDD_FAVORITE_VOLUMES DIALOGEX 0, 0, 380, 339
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt - Favorite Volumes"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
@@ -324,28 +324,31 @@ BEGIN
PUSHBUTTON "Move &Up",IDC_FAVORITE_MOVE_UP,7,104,63,14
PUSHBUTTON "Move &Down",IDC_FAVORITE_MOVE_DOWN,74,104,63,14
PUSHBUTTON "&Remove",IDC_FAVORITE_REMOVE,310,104,63,14
- EDITTEXT IDC_FAVORITE_LABEL,16,173,204,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_FAVORITE_LABEL,18,185,204,13,ES_AUTOHSCROLL
CONTROL "Mount selected volume as read-o&nly",IDC_FAVORITE_MOUNT_READONLY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,193,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,215,349,10
CONTROL "Mount selected volume as remo&vable medium",IDC_FAVORITE_MOUNT_REMOVABLE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,207,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,229,349,10
CONTROL "Mount selected volume upon log&on",IDC_FAVORITE_MOUNT_ON_LOGON,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,221,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,243,349,10
CONTROL "Mount selected volume when its host device gets &connected",IDC_FAVORITE_MOUNT_ON_ARRIVAL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,235,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,257,349,10
CONTROL "Open &Explorer window for selected volume when successfully mounted",IDC_FAVORITE_OPEN_EXPLORER_WIN_ON_MOUNT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,249,349,11
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,271,349,11
CONTROL "Do not mount selected volume when 'Mount Favorite Volumes' &hot key is pressed",IDC_FAVORITE_DISABLE_HOTKEY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,264,349,11
- LTEXT "Help on favorite volumes",IDC_FAVORITES_HELP_LINK,17,298,237,10,SS_NOTIFY
- DEFPUSHBUTTON "OK",IDOK,269,296,50,14
- PUSHBUTTON "Cancel",IDCANCEL,323,296,50,14
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,286,349,11
+ LTEXT "Help on favorite volumes",IDC_FAVORITES_HELP_LINK,17,322,237,10,SS_NOTIFY
+ DEFPUSHBUTTON "OK",IDOK,269,318,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,323,318,50,14
GROUPBOX "",IDC_FAV_VOL_OPTIONS_GROUP_BOX,7,122,366,159
- LTEXT "Label of selected favorite volume:",IDT_FAVORITE_LABEL,18,163,202,8
- GROUPBOX "Global Settings",IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX,7,230,366,57
- EDITTEXT IDC_PIM,16,143,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Label of selected favorite volume:",IDT_FAVORITE_LABEL,18,175,202,8
+ GROUPBOX "Global Settings",IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX,7,252,366,57
+ EDITTEXT IDC_PIM,18,143,42,13,ES_RIGHT | ES_PASSWORD | ES_AUTOHSCROLL | ES_NUMBER
LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,64,145,189,8
LTEXT "Volume PIM:",IDT_PIM,18,133,65,8
+ CONTROL "Display PIM",IDC_SHOW_PIM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,159,150,10
+ CONTROL "Use favorite label as Explorer drive label",IDC_FAVORITE_USE_LABEL_IN_EXPLORER,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,202,203,10
END
IDD_DEFAULT_MOUNT_PARAMETERS DIALOGEX 0, 0, 167, 65
@@ -449,7 +452,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 373
TOPMARGIN, 7
- BOTTOMMARGIN, 308
+ BOTTOMMARGIN, 332
END
IDD_DEFAULT_MOUNT_PARAMETERS, DIALOG
diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h
index 81c64dc0..adc116e0 100644
--- a/src/Mount/Resource.h
+++ b/src/Mount/Resource.h
@@ -167,6 +167,8 @@
#define IDC_OLD_PIM 1143
#define IDC_OLD_PIM_HELP 1144
#define IDC_NEW_PIM_ENABLE 1145
+#define IDC_SHOW_PIM 1146
+#define IDC_FAVORITE_USE_LABEL_IN_EXPLORER 1147
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
@@ -242,7 +244,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 119
#define _APS_NEXT_COMMAND_VALUE 40068
-#define _APS_NEXT_CONTROL_VALUE 1146
+#define _APS_NEXT_CONTROL_VALUE 1148
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif