VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Favorites.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mount/Favorites.cpp')
-rw-r--r--src/Mount/Favorites.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Mount/Favorites.cpp b/src/Mount/Favorites.cpp
index 06c1aa32..93d9c648 100644
--- a/src/Mount/Favorites.cpp
+++ b/src/Mount/Favorites.cpp
@@ -39,41 +39,41 @@ namespace VeraCrypt
if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &prop, sizeof (prop), &prop, sizeof (prop), &bytesReturned, NULL))
{
handleWin32Error (hwndDlg);
return FALSE;
}
FavoriteVolume favorite;
favorite.MountPoint = "X:\\";
favorite.MountPoint[0] = (char) (prop.driveNo + 'A');
favorite.Path = WideToSingleString ((wchar_t *) prop.wszVolume);
if (favorite.Path.find ("\\??\\") == 0)
favorite.Path = favorite.Path.substr (4);
if (IsVolumeDeviceHosted (favorite.Path.c_str()))
{
// Get GUID path
string volumeDevPath = favorite.Path;
wchar_t resolvedVolumeDevPath[TC_MAX_PATH];
- if (ResolveSymbolicLink (SingleStringToWide (volumeDevPath).c_str(), resolvedVolumeDevPath))
+ if (ResolveSymbolicLink (SingleStringToWide (volumeDevPath).c_str(), resolvedVolumeDevPath, sizeof(resolvedVolumeDevPath)))
volumeDevPath = WideToSingleString (resolvedVolumeDevPath);
char volumeName[TC_MAX_PATH];
HANDLE find = FindFirstVolume (volumeName, sizeof (volumeName));
if (find != INVALID_HANDLE_VALUE)
{
do
{
char findVolumeDevPath[TC_MAX_PATH];
string vn = volumeName;
if (QueryDosDevice (vn.substr (4, vn.size() - 5).c_str(), findVolumeDevPath, sizeof (findVolumeDevPath)) != 0
&& volumeDevPath == findVolumeDevPath)
{
favorite.VolumePathId = volumeName;
break;
}
} while (FindNextVolume (find, volumeName, sizeof (volumeName)));
@@ -397,41 +397,41 @@ namespace VeraCrypt
return 1;
}
break;
case WM_CLOSE:
EndDialog (hwndDlg, IDCLOSE);
return 1;
}
return 0;
}
static void FillFavoriteVolumesMenu ()
{
while (DeleteMenu (FavoriteVolumesMenu, 7, MF_BYPOSITION)) { }
if (FavoriteVolumes.empty())
return;
- AppendMenu (FavoriteVolumesMenu, MF_SEPARATOR, 0, NULL);
+ AppendMenu (FavoriteVolumesMenu, MF_SEPARATOR, 0, "");
int i = 0;
foreach (const FavoriteVolume &favorite, FavoriteVolumes)
{
UINT flags = MF_STRING;
if (favorite.DisconnectedDevice)
flags |= MF_GRAYED;
wstring menuText = SingleStringToWide (favorite.Path);
if (favorite.DisconnectedDevice)
menuText = favorite.Label.empty() ? wstring (L"(") + GetString ("FAVORITE_DISCONNECTED_DEV") + L")" : L"";
if (!favorite.Label.empty())
{
if (favorite.DisconnectedDevice)
menuText = favorite.Label + L" " + menuText;
else
menuText = favorite.Label;
}