[PATCH] kernel32/tests: Make sure the child process is done running its tests before terminating it.

Alexandre Julliard julliard at winehq.org
Mon Jan 22 13:01:58 CST 2018


Zebediah Figura <z.figura12 at gmail.com> writes:

> Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
> ---
>  dlls/kernel32/tests/pipe.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
> index 922eed9..1708c28 100644
> --- a/dlls/kernel32/tests/pipe.c
> +++ b/dlls/kernel32/tests/pipe.c
> @@ -2962,10 +2962,15 @@ static void child_process_write_pipe(HANDLE pipe)
>  {
>      OVERLAPPED overlapped;
>      char buf[10000];
> +    HANDLE event;
>  
>      memset(buf, 'x', sizeof(buf));
>      overlapped_write_async(pipe, buf, sizeof(buf), &overlapped);
>  
> +    event = OpenEventA(EVENT_MODIFY_STATE, FALSE, "wine_test_pipe_event");
> +    SetEvent(event);
> +    CloseHandle(event);
> +

It would be more robust to pass the event to the child instead of using
a global name. Also as long as we are synchronizing them, having the
parent signal the child to exit would be cleaner than using
TerminateProcess.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list