So that it doesn't automatically create a console window when there is not one already.
Fixing a Wine regression from f034084d49b354811096524d472ae5172ac1cebf.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
I'm not completely sure what DETACHED_PROCESS implies, and hopefully this won't cause more trouble, but forcing the flag like in https://testbot.winehq.org/JobDetails.pl?Key=111584 seems to fix the regression.
testbot/src/TestLauncher/TestLauncher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/src/TestLauncher/TestLauncher.c b/testbot/src/TestLauncher/TestLauncher.c index 41fb904..17da4da 100644 --- a/testbot/src/TestLauncher/TestLauncher.c +++ b/testbot/src/TestLauncher/TestLauncher.c @@ -236,7 +236,7 @@ DWORD RunTest(char *TestExeFileName, char* CommandLine, DWORD TimeOut, DWORD *Pi * whether there are missing dependencies as it could modify the test * results... */ - if (! CreateProcessA(NULL, CommandLine, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartupInfo, &ProcessInformation)) + if (! CreateProcessA(NULL, CommandLine, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE|DETACHED_PROCESS, NULL, NULL, &StartupInfo, &ProcessInformation)) { *Pid = 0; if (GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX)
Fixing a Wine regression from f034084d49b354811096524d472ae5172ac1cebf.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Eric Pouech eric.pouech@gmail.com
V2: don't detach when attached to a console --- testbot/src/TestLauncher/TestLauncher.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/testbot/src/TestLauncher/TestLauncher.c b/testbot/src/TestLauncher/TestLauncher.c index 41fb904..c30ee07 100644 --- a/testbot/src/TestLauncher/TestLauncher.c +++ b/testbot/src/TestLauncher/TestLauncher.c @@ -222,7 +222,7 @@ DWORD RunTest(char *TestExeFileName, char* CommandLine, DWORD TimeOut, DWORD *Pi { STARTUPINFOA StartupInfo; PROCESS_INFORMATION ProcessInformation; - DWORD ExitCode, WaitTimeOut; + DWORD ExitCode, WaitTimeOut, flags = CREATE_DEFAULT_ERROR_MODE;
StartupInfo.cb = sizeof(STARTUPINFOA); GetStartupInfoA(&StartupInfo); @@ -231,12 +231,14 @@ DWORD RunTest(char *TestExeFileName, char* CommandLine, DWORD TimeOut, DWORD *Pi StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); StartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+ /* don't (potentially) create a console when not attached to one */ + if (!GetConsoleCP()) flags |= DETACHED_PROCESS; /* Unlike WineTest we do not have the luxury of first running the test with * a --list argument. This means we cannot use SetErrorMode() to check * whether there are missing dependencies as it could modify the test * results... */ - if (! CreateProcessA(NULL, CommandLine, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartupInfo, &ProcessInformation)) + if (! CreateProcessA(NULL, CommandLine, NULL, NULL, TRUE, flags, NULL, NULL, &StartupInfo, &ProcessInformation)) { *Pid = 0; if (GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX)