return FALSE;
/* Read key */
- dwSize = (sizeof(Shell) / sizeof(Shell[0])) - 1;
+ dwSize = sizeof(Shell);
dwError = RegQueryValueExW(hKey,
L"CmdLine",
NULL,
/* 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
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;
if (!Result)
{
TRACE("Failed to run setup process\n");
+ SwitchDesktop(WLSession->WinlogonDesktop);
return FALSE;
}
CloseHandle(ProcessInformation.hThread);
CloseHandle(ProcessInformation.hProcess);
+ SwitchDesktop(WLSession->WinlogonDesktop);
+
TRACE ("RunSetup() done\n");
return TRUE;
NULL,
0,
NULL);
+ if (hThread != NULL)
+ CloseHandle(hThread);
return hThread != NULL;
}