Skip to content

Commit f7a4964

Browse files
committed
Simplify "advanced_boot" command handling
`SHUTDOWN_RESTART_BOOTOPTIONS` should be supported at least since Win8.1
1 parent 42d8e12 commit f7a4964

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

Src/StartMenu/StartMenuDLL/MenuCommands.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -852,19 +852,8 @@ static bool ExecuteShutdownCommand(TMenuID menuCommand)
852852
flags |= SHUTDOWN_INSTALL_UPDATES;
853853

854854
if (menuCommand == MENU_RESTART_ADVANCED)
855-
{
856-
STARTUPINFO startupInfo = { sizeof(startupInfo) };
857-
PROCESS_INFORMATION processInfo;
858-
memset(&processInfo, 0, sizeof(processInfo));
859-
wchar_t exe[_MAX_PATH] = L"%windir%\\system32\\shutdown.exe";
860-
DoEnvironmentSubst(exe, _countof(exe));
861-
if (CreateProcess(exe, (LPWSTR)L"shutdown.exe /r /o /t 0", NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &processInfo))
862-
{
863-
CloseHandle(processInfo.hThread);
864-
CloseHandle(processInfo.hProcess);
865-
}
866-
return true;
867-
}
855+
flags |= SHUTDOWN_RESTART_BOOTOPTIONS;
856+
868857
break;
869858

870859
case MENU_SHUTDOWN: // shutdown

0 commit comments

Comments
 (0)