mirror of
https://github.com/reactos/reactos.git
synced 2025-07-09 14:47:53 +00:00
[WINLOGON] When starting Setup (which runs with SYSTEM credentials), explicitly specify on which window station and desktop we start it, so as to avoid the default choice of the non-interactive Service-0x0-3e7$ window station.
Also, switch to the WinSta0\Default desktop just only before starting Setup, and restore Winlogon setup when it finishes.
This commit is contained in:
parent
b1c7fd08e9
commit
bcec1fd6c3
2 changed files with 10 additions and 5 deletions
|
@ -96,7 +96,7 @@ RunSetupThreadProc(
|
||||||
|
|
||||||
/* Expand string (if applicable) */
|
/* Expand string (if applicable) */
|
||||||
if (dwType == REG_EXPAND_SZ)
|
if (dwType == REG_EXPAND_SZ)
|
||||||
ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH);
|
ExpandEnvironmentStringsW(Shell, CommandLine, ARRAYSIZE(CommandLine));
|
||||||
else if (dwType == REG_SZ)
|
else if (dwType == REG_SZ)
|
||||||
wcscpy(CommandLine, Shell);
|
wcscpy(CommandLine, Shell);
|
||||||
else
|
else
|
||||||
|
@ -104,10 +104,12 @@ RunSetupThreadProc(
|
||||||
|
|
||||||
TRACE("Should run '%s' now\n", debugstr_w(CommandLine));
|
TRACE("Should run '%s' now\n", debugstr_w(CommandLine));
|
||||||
|
|
||||||
|
SwitchDesktop(WLSession->ApplicationDesktop);
|
||||||
|
|
||||||
/* Start process */
|
/* Start process */
|
||||||
StartupInfo.cb = sizeof(StartupInfo);
|
StartupInfo.cb = sizeof(StartupInfo);
|
||||||
StartupInfo.lpReserved = NULL;
|
StartupInfo.lpReserved = NULL;
|
||||||
StartupInfo.lpDesktop = NULL;
|
StartupInfo.lpDesktop = L"WinSta0\\Default";
|
||||||
StartupInfo.lpTitle = NULL;
|
StartupInfo.lpTitle = NULL;
|
||||||
StartupInfo.dwFlags = 0;
|
StartupInfo.dwFlags = 0;
|
||||||
StartupInfo.cbReserved2 = 0;
|
StartupInfo.cbReserved2 = 0;
|
||||||
|
@ -126,6 +128,7 @@ RunSetupThreadProc(
|
||||||
if (!Result)
|
if (!Result)
|
||||||
{
|
{
|
||||||
TRACE("Failed to run setup process\n");
|
TRACE("Failed to run setup process\n");
|
||||||
|
SwitchDesktop(WLSession->WinlogonDesktop);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +141,8 @@ RunSetupThreadProc(
|
||||||
CloseHandle(ProcessInformation.hThread);
|
CloseHandle(ProcessInformation.hThread);
|
||||||
CloseHandle(ProcessInformation.hProcess);
|
CloseHandle(ProcessInformation.hProcess);
|
||||||
|
|
||||||
|
SwitchDesktop(WLSession->WinlogonDesktop);
|
||||||
|
|
||||||
TRACE ("RunSetup() done\n");
|
TRACE ("RunSetup() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -453,14 +453,14 @@ WinMain(
|
||||||
/* Check for pending setup */
|
/* Check for pending setup */
|
||||||
if (GetSetupType() != 0)
|
if (GetSetupType() != 0)
|
||||||
{
|
{
|
||||||
TRACE("WL: Setup mode detected\n");
|
|
||||||
|
|
||||||
/* Run setup and reboot when done */
|
/* Run setup and reboot when done */
|
||||||
SwitchDesktop(WLSession->ApplicationDesktop);
|
TRACE("WL: Setup mode detected\n");
|
||||||
RunSetup();
|
RunSetup();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_CTRL_ALT_DEL, 0);
|
PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_CTRL_ALT_DEL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
(void)LoadLibraryW(L"sfc_os.dll");
|
(void)LoadLibraryW(L"sfc_os.dll");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue