[PATCH v2 2/4] ntdll: Support creating processes with specified parent.

Alexandre Julliard julliard at winehq.org
Thu Dec 12 02:35:23 CST 2019


Paul Gofman <gofmanp at gmail.com> writes:

> @@ -1667,8 +1667,14 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
>  
>      RtlNormalizeProcessParams( params );
>  
> -    TRACE( "%s image %s cmdline %s\n", debugstr_us( path ),
> -           debugstr_us( &params->ImagePathName ), debugstr_us( &params->CommandLine ));
> +    TRACE( "%s image %s cmdline %s, parent %p.\n", debugstr_us( path ),
> +           debugstr_us( &params->ImagePathName ), debugstr_us( &params->CommandLine ), parent);
> +
> +    if (parent == INVALID_HANDLE_VALUE)
> +    {
> +        memset(info, 0, sizeof(*info));
> +        return STATUS_INVALID_HANDLE;
> +    }

You are still using INVALID_HANDLE_VALUE here, I don't think that makes
sense. The check for an invalid handle should use a truly invalid value
like 0xdeadbeef.

It may be interesting to test what happens with GetCurrentProcess(), and
also some other handle pointing to the current process, but that should
be separate from the generic invalid handle test.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list