#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
ZeroMemory(&m_processInfo, sizeof(PROCESS_INFORMATION));
STARTUPINFO startupInfo;
ZeroMemory(&startupInfo, sizeof(STARTUPINFO));
STARTUPINFO si;
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(
NULL, LPSTR(command.c_str()), NULL, NULL,
FALSE, 0, NULL, NULL, &startupInfo, &m_processInfo);
TRUE, 0, NULL, NULL, &si, &m_processInfo);
}
BOOL