Windows: Perform Shutdown instead of Reboot during Pre-Test of UEFI system encryption in order to detect machines where changes to EFI boot don't persist after shutdown.

This commit is contained in:
Mounir IDRASSI 2016-09-28 10:55:53 +02:00
parent 3bad079d75
commit e362d804b0
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC
5 changed files with 8 additions and 8 deletions

View File

@ -4568,8 +4568,8 @@ namespace VeraCrypt
} }
} }
bool BootEncryption::RestartComputer (void) bool BootEncryption::RestartComputer (BOOL bShutdown)
{ {
return (::RestartComputer() != FALSE); return (::RestartComputer(bShutdown) != FALSE);
} }
} }

View File

@ -276,7 +276,7 @@ namespace VeraCrypt
void RegisterSystemFavoritesService (BOOL registerService, BOOL noFileHandling); void RegisterSystemFavoritesService (BOOL registerService, BOOL noFileHandling);
void UpdateSystemFavoritesService (); void UpdateSystemFavoritesService ();
void RenameDeprecatedSystemLoaderBackup (); void RenameDeprecatedSystemLoaderBackup ();
bool RestartComputer (void); bool RestartComputer (BOOL bShutdown = FALSE);
void InitialSecurityChecksForHiddenOS (); void InitialSecurityChecksForHiddenOS ();
void RestrictPagingFilesToSystemPartition (); void RestrictPagingFilesToSystemPartition ();
void SetDriverConfigurationFlag (uint32 flag, bool state); void SetDriverConfigurationFlag (uint32 flag, bool state);

View File

@ -10017,7 +10017,7 @@ BOOL EnableWow64FsRedirection (BOOL enable)
} }
BOOL RestartComputer (void) BOOL RestartComputer (BOOL bShutdown)
{ {
TOKEN_PRIVILEGES tokenPrivil; TOKEN_PRIVILEGES tokenPrivil;
HANDLE hTkn; HANDLE hTkn;
@ -10038,7 +10038,7 @@ BOOL RestartComputer (void)
return false; return false;
} }
if (!ExitWindowsEx (EWX_REBOOT, if (!ExitWindowsEx (bShutdown? EWX_POWEROFF: EWX_REBOOT,
SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED)) SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED))
{ {
CloseHandle(hTkn); CloseHandle(hTkn);

View File

@ -443,7 +443,7 @@ BOOL Is64BitOs ();
BOOL IsServerOS (); BOOL IsServerOS ();
BOOL IsHiddenOSRunning (void); BOOL IsHiddenOSRunning (void);
BOOL EnableWow64FsRedirection (BOOL enable); BOOL EnableWow64FsRedirection (BOOL enable);
BOOL RestartComputer (void); BOOL RestartComputer (BOOL bShutdown);
void Applink (char *dest, BOOL bSendOS, char *extraOutput); void Applink (char *dest, BOOL bSendOS, char *extraOutput);
wchar_t *RelativePath2Absolute (wchar_t *szFileName); wchar_t *RelativePath2Absolute (wchar_t *szFileName);
void HandleDriveNotReadyError (HWND hwnd); void HandleDriveNotReadyError (HWND hwnd);

View File

@ -8157,7 +8157,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
try try
{ {
BootEncObj->RestartComputer (); BootEncObj->RestartComputer (bSystemIsGPT);
} }
catch (Exception &e) catch (Exception &e)
{ {
@ -10112,7 +10112,7 @@ static void AfterWMInitTasks (HWND hwndDlg)
try try
{ {
BootEncObj->RestartComputer (); BootEncObj->RestartComputer (bSystemIsGPT);
} }
catch (Exception &e) catch (Exception &e)
{ {