VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-15 09:15:31 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-15 23:19:28 (GMT)
commit7818c0e0e332edf8a991757d5cb8c1ad74b97a20 (patch)
tree3cfaf2c8836da849b8f4dadc7253dbf00ef5dcac /src/Mount
parent86529dadde9af8407711d55d0096330429f79742 (diff)
downloadVeraCrypt-7818c0e0e332edf8a991757d5cb8c1ad74b97a20.zip
VeraCrypt-7818c0e0e332edf8a991757d5cb8c1ad74b97a20.tar.gz
Window: add menu entry for launching VeraCryptExpander
Diffstat (limited to 'src/Mount')
-rw-r--r--src/Mount/Mount.c28
-rw-r--r--src/Mount/Mount.rc1
-rw-r--r--src/Mount/Resource.h3
3 files changed, 31 insertions, 1 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index eb14d76..c7835f0 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -1055,6 +1055,28 @@ static void LaunchVolCreationWizard (HWND hwndDlg, const char *arg)
}
}
+static void LaunchVolExpander (HWND hwndDlg)
+{
+ char t[TC_MAX_PATH] = {'"',0};
+ char *tmp;
+
+ GetModuleFileName (NULL, t+1, sizeof(t)-1);
+
+ tmp = strrchr (t, '\\');
+ if (tmp)
+ {
+ *tmp = 0;
+ StringCbCatA (t, sizeof(t), "\\VeraCryptExpander.exe\"");
+
+ if (!FileExists(t))
+ Error ("VOL_EXPANDER_NOT_FOUND", hwndDlg); // Display a user-friendly error message and advise what to do
+ else if (((int)ShellExecuteA (NULL, (!IsAdmin() && IsUacSupported()) ? "runas" : "open", t, NULL, NULL, SW_SHOW)) <= 32)
+ {
+ handleWin32Error (hwndDlg);
+ }
+ }
+}
+
// Fills drive list
// drive>0 = update only the corresponding drive subitems
@@ -6433,6 +6455,12 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
+ if (lw == IDM_VOLUME_EXPANDER)
+ {
+ LaunchVolExpander (hwndDlg);
+ return 1;
+ }
+
if (lw == IDM_ADD_REMOVE_VOL_KEYFILES)
{
if (!VolumeSelected(hwndDlg))
diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc
index 7a498d7..fdc50bc 100644
--- a/src/Mount/Mount.rc
+++ b/src/Mount/Mount.rc
@@ -568,6 +568,7 @@ BEGIN
MENUITEM "Test Vectors...", IDM_TEST_VECTORS
MENUITEM SEPARATOR
MENUITEM "Traveler Disk Setup...", IDM_TRAVELER
+ MENUITEM "Volume Expander", IDM_VOLUME_EXPANDER
MENUITEM "Volume Creation Wizard", IDM_VOLUME_WIZARD
MENUITEM SEPARATOR
MENUITEM "Keyfile Generator", IDM_KEYFILE_GENERATOR
diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h
index e63c59a..ca2bdc8 100644
--- a/src/Mount/Resource.h
+++ b/src/Mount/Resource.h
@@ -225,6 +225,7 @@
#define IDM_PERFORMANCE_SETTINGS 40062
#define IDM_ANALYZE_SYSTEM_CRASH 40063
#define IDM_DONATE 40064
+#define IDM_VOLUME_EXPANDER 40065
// Next default values for new objects
//
@@ -232,7 +233,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 118
-#define _APS_NEXT_COMMAND_VALUE 40065
+#define _APS_NEXT_COMMAND_VALUE 40066
#define _APS_NEXT_CONTROL_VALUE 1141
#define _APS_NEXT_SYMED_VALUE 101
#endif