diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-04-08 23:51:29 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-04-08 23:53:49 +0200 |
commit | 60575d9a496bd4b796bab73888b69c249a1f8048 (patch) | |
tree | dc242c1029d53807c21c6779d68de7e3e83cd597 /src/Mount/Mount.c | |
parent | 409c0f79be069cd2cf3bdb31ddbbafd938f15791 (diff) | |
download | VeraCrypt-60575d9a496bd4b796bab73888b69c249a1f8048.tar.gz VeraCrypt-60575d9a496bd4b796bab73888b69c249a1f8048.zip |
Windows: start implementation of volume ID mechanism that will be used to identify VeraCrypt disk volumes instead of device name.
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r-- | src/Mount/Mount.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 0acf58dd..dc7d825d 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -7065,7 +7065,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa {
OPEN_TEST_STRUCT ots = {0};
- if (!OpenDevice (vol, &ots, FALSE))
+ if (!OpenDevice (vol, &ots, FALSE, FALSE, NULL))
{
UnmountVolume (hwndDlg, m, TRUE);
WarningBalloon ("HOST_DEVICE_REMOVAL_DISMOUNT_WARN_TITLE", "HOST_DEVICE_REMOVAL_DISMOUNT_WARN", hwndDlg);
@@ -8899,6 +8899,7 @@ static BOOL MountFavoriteVolumeBase (HWND hwnd, const FavoriteVolume &favorite, {
BOOL status = TRUE;
int drive;
+ std::wstring effectiveVolumePath;
drive = towupper (favorite.MountPoint[0]) - L'A';
if ((drive < MIN_MOUNTED_VOLUME_DRIVE_NUMBER) || (drive > MAX_MOUNTED_VOLUME_DRIVE_NUMBER))
@@ -8919,6 +8920,11 @@ static BOOL MountFavoriteVolumeBase (HWND hwnd, const FavoriteVolume &favorite, else
ZeroMemory (mountOptions.Label, sizeof (mountOptions.Label));
+ if (favorite.UseVolumeID && !IsRepeatedByteArray (0, favorite.VolumeID, SHA512_DIGEST_SIZE))
+ effectiveVolumePath = L"ID:" + ArrayToHexWideString (favorite.VolumeID, SHA512_DIGEST_SIZE);
+ else
+ effectiveVolumePath = favorite.Path;
+
if (favorite.SystemEncryption)
{
mountOptions.PartitionInInactiveSysEncScope = TRUE;
@@ -8978,7 +8984,7 @@ static BOOL MountFavoriteVolumeBase (HWND hwnd, const FavoriteVolume &favorite, if (ServiceMode)
SystemFavoritesServiceLogInfo (wstring (L"Mounting system favorite \"") + favorite.Path + L"\"");
- status = Mount (hwnd, drive, (wchar_t *) favorite.Path.c_str(), favorite.Pim);
+ status = Mount (hwnd, drive, (wchar_t *) effectiveVolumePath.c_str(), favorite.Pim);
if (ServiceMode)
{
|