1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

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).

This commit is contained in:
Mounir IDRASSI
2015-01-31 23:49:01 +01:00
parent b16cfa959d
commit 96b39a5973
4 changed files with 36 additions and 11 deletions

View File

@@ -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;
}
}
}