VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-12-19 00:38:56 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-12-19 00:41:37 +0100
commit1967bd862eaa5130260a7d7beea9657778718c31 (patch)
treee451e2d899e2b6f0ffb7ca3beaa795d42de9497e /src/Mount
parent6abc59acd204ce59f53b218cafc01ced955695cd (diff)
downloadVeraCrypt-1967bd862eaa5130260a7d7beea9657778718c31.tar.gz
VeraCrypt-1967bd862eaa5130260a7d7beea9657778718c31.zip
Windows: Add mount option that allows mounting a volume without attaching it to the specified drive letter. This is useful in situation where Windows has issue with the filesystem (e.g. ReFS on Windows 10 1809) and we need to use third party software to be able to use the filesystem under Windows through low level VeraCrypt virtual device (e.g. \Device\VeraCryptVolumeX).
Diffstat (limited to 'src/Mount')
-rw-r--r--src/Mount/Mount.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index ebae35f8..5a5b877a 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -3537,6 +3537,8 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
mountOptions->Removable ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage (hwndDlg, IDC_PROTECT_HIDDEN_VOL, BM_SETCHECK,
mountOptions->ProtectHiddenVolume ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendDlgItemMessage (hwndDlg, IDC_PROTECT_HIDDEN_VOL, BM_SETCHECK,
+ mountOptions->DisableMountManager ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage (hwndDlg, IDC_PROTECT_HIDDEN_VOL, BM_SETCHECK,
mountOptions->ProtectHiddenVolume ? BST_CHECKED : BST_UNCHECKED, 0);
@@ -3554,6 +3556,10 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
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
+ protect = IsButtonChecked (GetDlgItem (hwndDlg, IDC_DISABLE_MOUNT_MANAGER));
+ EnableWindow (GetDlgItem (hwndDlg, IDC_VOLUME_LABEL), !protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_VOLUME_LABEL), !protect);
+
/* Add PRF algorithm list for hidden volume password */
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
SendMessage (hComboBox, CB_RESETCONTENT, 0, 0);
@@ -3700,6 +3706,7 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
mountOptions->ReadOnly = IsButtonChecked (GetDlgItem (hwndDlg, IDC_MOUNT_READONLY));
mountOptions->Removable = IsButtonChecked (GetDlgItem (hwndDlg, IDC_MOUNT_REMOVABLE));
+ mountOptions->DisableMountManager = IsButtonChecked (GetDlgItem (hwndDlg, IDC_DISABLE_MOUNT_MANAGER));
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));
@@ -3736,7 +3743,7 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return 1;
}
- if (lw == IDC_MOUNT_READONLY || lw == IDC_PROTECT_HIDDEN_VOL)
+ if (lw == IDC_MOUNT_READONLY || lw == IDC_PROTECT_HIDDEN_VOL || lw == IDC_DISABLE_MOUNT_MANAGER)
{
BOOL protect;
@@ -3747,6 +3754,12 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow (GetDlgItem (hwndDlg, IDT_HIDDEN_VOL_PROTECTION), !IsButtonChecked (GetDlgItem (hwndDlg, IDC_MOUNT_READONLY)));
}
+ if (lw == IDC_DISABLE_MOUNT_MANAGER)
+ {
+ EnableWindow (GetDlgItem (hwndDlg, IDC_VOLUME_LABEL), !IsButtonChecked (GetDlgItem (hwndDlg, IDC_DISABLE_MOUNT_MANAGER)));
+ EnableWindow (GetDlgItem (hwndDlg, IDT_VOLUME_LABEL), !IsButtonChecked (GetDlgItem (hwndDlg, IDC_DISABLE_MOUNT_MANAGER)));
+ }
+
protect = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PROTECT_HIDDEN_VOL));
EnableWindow (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), protect);
@@ -4000,6 +4013,14 @@ BOOL CALLBACK VolumePropertiesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
else
ListSubItemSet (list, i++, 1, (wchar_t *) (prop.wszVolume[1] != L'?' ? prop.wszVolume : prop.wszVolume + 4));
+ if (!bSysEnc && prop.mountDisabled)
+ {
+ // Virtual Device
+ StringCbPrintfW (szTmp, sizeof(szTmp), L"\\Device\\VeraCryptVolume%c", (wchar_t) prop.driveNo + L'A');
+ ListItemAdd (list, i, GetString ("VIRTUAL_DEVICE"));
+ ListSubItemSet (list, i++, 1, szTmp);
+ }
+
if (!bSysEnc && IsVolumeDeviceHosted ((wchar_t *) (prop.wszVolume[1] != L'?' ? prop.wszVolume : prop.wszVolume + 4)))
{
// Volume ID
@@ -7742,10 +7763,26 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nSelectedDriveIndex = ((LPNMITEMACTIVATE)lParam)->iItem;
if (LOWORD(state) == TC_MLIST_ITEM_NONSYS_VOL || LOWORD(state) == TC_MLIST_ITEM_SYS_PARTITION)
{
- // Open explorer window for mounted volume
- WaitCursor ();
- OpenVolumeExplorerWindow (HIWORD(state) - L'A');
- NormalCursor ();
+ VOLUME_PROPERTIES_STRUCT prop;
+ DWORD dwResult;
+
+ memset (&prop, 0, sizeof(prop));
+ prop.driveNo = HIWORD (state) - L'A';
+
+ if (DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &prop, sizeof (prop), &prop, sizeof (prop), &dwResult, NULL)
+ && dwResult
+ && prop.mountDisabled
+ )
+ {
+ Warning ("MOUNTED_VOLUME_NOT_ASSOCIATED", hwndDlg);
+ }
+ else
+ {
+ // Open explorer window for mounted volume
+ WaitCursor ();
+ OpenVolumeExplorerWindow (HIWORD(state) - L'A');
+ NormalCursor ();
+ }
}
else if (LOWORD (GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST))) == TC_MLIST_ITEM_FREE)
{