diff options
author | John Hodge <tpg@mutabah.net> | 2018-09-09 22:19:40 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-09-09 22:20:32 +0800 |
commit | d85ac84278fa0322f1df0b16a45a1cdde83cba57 (patch) | |
tree | 66bad02a3c0bb9144e629d2ac8294b58430ff4ef /tools/testrunner/main.cpp | |
parent | dd4e3c887fa2eef2db6fa2795d4283636a1cc26e (diff) | |
download | mrust-d85ac84278fa0322f1df0b16a45a1cdde83cba57.tar.gz |
Msvc compile fixes
Diffstat (limited to 'tools/testrunner/main.cpp')
-rw-r--r-- | tools/testrunner/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testrunner/main.cpp b/tools/testrunner/main.cpp index 4dafe508..5c21937d 100644 --- a/tools/testrunner/main.cpp +++ b/tools/testrunner/main.cpp @@ -520,9 +520,8 @@ bool run_executable(const ::helpers::path& exe_name, const ::std::vector<const c STARTUPINFO si = { 0 }; si.cb = sizeof(si); - si.dwFlags = STARTF_USESTDHANDLES; + si.dwFlags = STARTF_USESTDHANDLES|STARTF_FORCEOFFFEEDBACK; si.hStdInput = NULL; - si.hStdError = GetStdHandle(STD_ERROR_HANDLE); { SECURITY_ATTRIBUTES sa = { 0 }; sa.nLength = sizeof(sa); @@ -532,8 +531,11 @@ bool run_executable(const ::helpers::path& exe_name, const ::std::vector<const c //WriteFile(si.hStdOutput, cmdline_str.data(), static_cast<DWORD>(cmdline_str.size()), &tmp, NULL); //WriteFile(si.hStdOutput, "\n", 1, &tmp, NULL); } + DuplicateHandle(NULL, si.hStdOutput, NULL, &si.hStdError, GENERIC_WRITE, FALSE, FILE_SHARE_READ); PROCESS_INFORMATION pi = { 0 }; + auto em = SetErrorMode(SEM_NOGPFAULTERRORBOX); CreateProcessA(exe_name.str().c_str(), (LPSTR)cmdline_str.c_str(), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi); + SetErrorMode(em); CloseHandle(si.hStdOutput); WaitForSingleObject(pi.hProcess, INFINITE); DWORD status = 1; |