From 175ede2f4442d0147f31397c446e231e7f0f9dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Wed, 12 Feb 2020 20:19:33 +0100 Subject: [PATCH] Process [NT]: Fix process creation. The switch to using STARTUPINFOEXW caused CreateProcessW() to fail with ERROR_INVALID_PARAMETER (87) as soon as the EXTENDED_STARTUPINFO_PRESENT flag was set (even with an empty attribute list). This seems to have been caused by GetStartupInfoW() having filled in several reserved fields of the StartupInfo. As none of the information that it filled in seems relevant, the call has now been removed. Starting of processes on NT should now work again. --- src/signal_handler.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/signal_handler.c b/src/signal_handler.c index 40a72ed07e..243feb493c 100644 --- a/src/signal_handler.c +++ b/src/signal_handler.c @@ -2851,7 +2851,7 @@ void f_create_process(INT32 args) HANDLE t3 = DO_NOT_WARN(INVALID_HANDLE_VALUE); STARTUPINFOEXW info; PROCESS_INFORMATION proc; - int ret,err; + int ret = 0, err; WCHAR *filename=NULL, *command_line=NULL, *dir=NULL; WCHAR *env=NULL; @@ -2955,7 +2955,16 @@ void f_create_process(INT32 args) memset(&info,0,sizeof(info)); info.StartupInfo.cb = sizeof(info); +#if 0 + /* CAUTION!!!! + * + * This function fills in several reserved fields in the + * StartupInfo, which in turn cause CreateProcessW() below + * to fail with error ERROR_INVALID_PARAMETER (87) when + * EXTENDED_STARTUPINFO_PRESENT is set. + */ GetStartupInfoW(&info.StartupInfo); +#endif /* Protect inherit status for handles */ LOCK_IMUTEX(&handle_protection_mutex); -- GitLab