VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-01-31 23:49:01 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-08 10:07:44 +0100
commit96b39a5973d354bf759fefc13e551fb75e1c25c7 (patch)
treeeff49cc60f967517f998418dfc06a7ce0b7cae0d /src/Format/Tcformat.c
parentb16cfa959da8836028a74194ce4f1d33a1dbef46 (diff)
downloadVeraCrypt-96b39a5973d354bf759fefc13e551fb75e1c25c7.tar.gz
VeraCrypt-96b39a5973d354bf759fefc13e551fb75e1c25c7.zip
Windows: retry UAC prompt operation in case of failure. This avoids cancel the whole operation if the user is not in front of the machine during UAC prompt (this happens ofter during in-place encryption of big NTFS partitions).
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r--src/Format/Tcformat.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index d55cc064..4984e6cc 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -266,14 +266,18 @@ static BOOL ElevateWholeWizardProcess (string arguments)
GetModuleFileName (NULL, modPath, sizeof (modPath));
- if ((int)ShellExecute (MainDlg, "runas", modPath, (string("/q UAC ") + arguments).c_str(), NULL, SW_SHOWNORMAL) > 32)
- {
- exit (0);
- }
- else
+ while (true)
{
- Error ("UAC_INIT_ERROR", MainDlg);
- return FALSE;
+ if ((int)ShellExecute (MainDlg, "runas", modPath, (string("/q UAC ") + arguments).c_str(), NULL, SW_SHOWNORMAL) > 32)
+ {
+ exit (0);
+ }
+ else
+ {
+ if (IDRETRY == ErrorRetryCancel ("UAC_INIT_ERROR", MainDlg))
+ continue;
+ return FALSE;
+ }
}
}