[PATCH v2] kernelbase: Don't pass on StdHandles if they are never to be inherited

Jacek Caban jacek at codeweavers.com
Mon Jun 21 11:40:26 CDT 2021


Hi Brendan,

On 6/15/21 1:17 PM, Brendan McGrath wrote:
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51264
> Signed-off-by: Brendan McGrath <brendan at redmandi.com>
> ---
> Changes since v1:
> - Correct the Wine-Bug reference
>
>   dlls/kernelbase/process.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c
> index e3bd5feb296c..2833e76138bf 100644
> --- a/dlls/kernelbase/process.c
> +++ b/dlls/kernelbase/process.c
> @@ -141,8 +141,8 @@ static WCHAR *get_file_name( WCHAR *cmdline, WCHAR *buffer, DWORD buflen )
>    *           create_process_params
>    */
>   static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename, const WCHAR *cmdline,
> -                                                           const WCHAR *cur_dir, void *env, DWORD flags,
> -                                                           const STARTUPINFOW *startup )
> +                                                           const WCHAR *cur_dir, void *env, BOOL inherit,
> +                                                           DWORD flags, const STARTUPINFOW *startup )
>   {
>       RTL_USER_PROCESS_PARAMETERS *params;
>       UNICODE_STRING imageW, curdirW, cmdlineW, titleW, desktopW, runtimeW, newdirW;
> @@ -199,7 +199,7 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
>           params->hStdOutput = startup->hStdOutput;
>           params->hStdError  = startup->hStdError;
>       }
> -    else if (flags & DETACHED_PROCESS)
> +    else if (flags & DETACHED_PROCESS || ((flags & CREATE_NEW_CONSOLE) && !inherit) )


Is the !inherit condition needed here? If CreateProcess (modern) part of 
[1] is correct, we could probably use that branch for CREATE_NEW_CONSOLE 
regardless of inherit value. It would be great to have a test that 
directly uses CreateProcess() instead of ShellExecuteEx() so that we can 
verify that.


Thanks,

Jacek


[1] https://github.com/rprichard/win32-console-docs/blob/master/README.md




More information about the wine-devel mailing list