X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=base%2Fsystem%2Fwinlogon%2Fsetup.c;h=f5ef367318632eab6aa0240e82c402ac34eac8bf;hp=7cec968e0e4c1b6fce51b8936c8d4bc5fd59764f;hb=bcec1fd6c37677d46d6890d270bb1e27d17f8f34;hpb=b1c7fd08e9ec38e97914f31127bc6568a851f77a diff --git a/base/system/winlogon/setup.c b/base/system/winlogon/setup.c index 7cec968e0e4..f5ef3673186 100644 --- a/base/system/winlogon/setup.c +++ b/base/system/winlogon/setup.c @@ -96,7 +96,7 @@ RunSetupThreadProc( /* Expand string (if applicable) */ if (dwType == REG_EXPAND_SZ) - ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH); + ExpandEnvironmentStringsW(Shell, CommandLine, ARRAYSIZE(CommandLine)); else if (dwType == REG_SZ) wcscpy(CommandLine, Shell); else @@ -104,10 +104,12 @@ RunSetupThreadProc( TRACE("Should run '%s' now\n", debugstr_w(CommandLine)); + SwitchDesktop(WLSession->ApplicationDesktop); + /* Start process */ StartupInfo.cb = sizeof(StartupInfo); StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; + StartupInfo.lpDesktop = L"WinSta0\\Default"; StartupInfo.lpTitle = NULL; StartupInfo.dwFlags = 0; StartupInfo.cbReserved2 = 0; @@ -126,6 +128,7 @@ RunSetupThreadProc( if (!Result) { TRACE("Failed to run setup process\n"); + SwitchDesktop(WLSession->WinlogonDesktop); return FALSE; } @@ -138,6 +141,8 @@ RunSetupThreadProc( CloseHandle(ProcessInformation.hThread); CloseHandle(ProcessInformation.hProcess); + SwitchDesktop(WLSession->WinlogonDesktop); + TRACE ("RunSetup() done\n"); return TRUE;