#6383 Capture process output when in foreground mode

This commit is contained in:
Nick Bolton 2018-08-02 17:40:20 +01:00
parent 026b1f0de1
commit aca2605cb8
1 changed files with 8 additions and 3 deletions

View File

@ -357,12 +357,17 @@ MSWindowsWatchdog::startProcessInForeground(String& command)
// clear, as we're reusing process info struct // clear, as we're reusing process info struct
ZeroMemory(&m_processInfo, sizeof(PROCESS_INFORMATION)); ZeroMemory(&m_processInfo, sizeof(PROCESS_INFORMATION));
STARTUPINFO startupInfo; STARTUPINFO si;
ZeroMemory(&startupInfo, sizeof(STARTUPINFO)); ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.lpDesktop = "winsta0\\Default"; // TODO: maybe this should be \winlogon if we have logonui.exe?
si.hStdError = m_stdOutWrite;
si.hStdOutput = m_stdOutWrite;
si.dwFlags |= STARTF_USESTDHANDLES;
return CreateProcess( return CreateProcess(
NULL, LPSTR(command.c_str()), NULL, NULL, NULL, LPSTR(command.c_str()), NULL, NULL,
FALSE, 0, NULL, NULL, &startupInfo, &m_processInfo); TRUE, 0, NULL, NULL, &si, &m_processInfo);
} }
BOOL BOOL