[PATCH] winetest: Create processes with DETACHED_PROCESS flag.

Rémi Bernon rbernon at codeweavers.com
Wed Mar 30 08:19:54 CDT 2022


So that it doesn't automatically create a console window when there is
not one already.

Fixing a regression from f034084d49b354811096524d472ae5172ac1cebf.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

Same as for the TestLauncher patch, I'm not completely sure what
DETACHED_PROCESS does, but as it uses STARTF_USESTDHANDLES too I think
the kernelbase create_process_params path taken should mostly be the
same, except that it will never force CONSOLE_HANDLE_ALLOC.

 programs/winetest/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index eb86770afbf..4ff2995714f 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -619,7 +619,7 @@ run_ex (char *cmd, HANDLE out_file, const char *tempdir, DWORD ms, BOOL nocritic
 {
     STARTUPINFOA si;
     PROCESS_INFORMATION pi;
-    DWORD wait, status, flags;
+    DWORD wait, status, flags = DETACHED_PROCESS;
     UINT old_errmode;
 
     /* Flush to disk so we know which test caused Windows to crash if it does */
@@ -635,10 +635,9 @@ run_ex (char *cmd, HANDLE out_file, const char *tempdir, DWORD ms, BOOL nocritic
     {
         old_errmode = SetErrorMode(0);
         SetErrorMode(old_errmode | SEM_FAILCRITICALERRORS);
-        flags = 0;
     }
     else
-        flags = CREATE_DEFAULT_ERROR_MODE;
+        flags |= CREATE_DEFAULT_ERROR_MODE;
 
     if (!CreateProcessA (NULL, cmd, NULL, NULL, TRUE, flags,
                          NULL, tempdir, &si, &pi))
-- 
2.35.1




More information about the wine-devel mailing list