From: Paul Gofman Subject: Re: [PATCH v3 4/4] kernel32/tests: Test std handle inheritance in test_parent_process_attribute(). Message-Id: <7392776b-686a-1d3c-f7d1-42cd30632a5c@gmail.com> Date: Fri, 13 Dec 2019 15:08:57 +0300 In-Reply-To: <878sng31zw.fsf@wine> References: <20191212111833.672808-1-gofmanp@gmail.com> <20191212111833.672808-4-gofmanp@gmail.com> <878sng31zw.fsf@wine> On 12/13/19 14:21, Alexandre Julliard wrote: > Paul Gofman writes: > >> Signed-off-by: Paul Gofman >> --- >> v2: >> - added test; >> v3: >> - no changes. >> >> dlls/kernel32/tests/process.c | 55 ++++++++++++++++++++++++++++------- >> 1 file changed, 45 insertions(+), 10 deletions(-) > This fails here: > > ../../../tools/runtest -q -P wine -T ../../.. -M kernel32.dll -p kernel32_test.exe process && touch process.ok > process.c:3893: Test failed: Unexpected hstderr 0000005F, creator_hstdhandle 0000005C. > process.c:4027: Test failed: Child test failed, exit_code 0x1. > process.c:4027: Test failed: Child test failed, exit_code 0x1. > make: *** [Makefile:720: process.ok] Error 1 > I guess the handle gets different value in ntdll/env.c:init_user_process_params() in this case: ...         if (!isatty(2))             wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms->hStdError ); ... On Windows I just get always the same value for handle there (or if I get the handle by GetStdHandle()), and if it is a handle of creator process (not the specified parent) it is either invalid or accidentally equals to some other object's handle inherited from the parent process. It looks like std handles management differes in Wine in a few places regardless of the parent substitution. I thought the test is stable in this form but it is apparently isn't. Maybe we can just drop this last patch in the series for now?