diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-02-15 10:15:31 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-02-16 00:19:28 +0100 |
commit | 7818c0e0e332edf8a991757d5cb8c1ad74b97a20 (patch) | |
tree | 3cfaf2c8836da849b8f4dadc7253dbf00ef5dcac /src/Mount/Mount.c | |
parent | 86529dadde9af8407711d55d0096330429f79742 (diff) | |
download | VeraCrypt-7818c0e0e332edf8a991757d5cb8c1ad74b97a20.tar.gz VeraCrypt-7818c0e0e332edf8a991757d5cb8c1ad74b97a20.zip |
Window: add menu entry for launching VeraCryptExpander
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r-- | src/Mount/Mount.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index eb14d76e..c7835f0e 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))
|