From: Alexandre Julliard Subject: Re: [PATCH v2 2/4] ntdll: Support creating processes with specified parent. Message-Id: <87zhfygcvo.fsf@wine> Date: Thu, 12 Dec 2019 09:35:23 +0100 In-Reply-To: <20191209215114.210057-2-gofmanp@gmail.com> (Paul Gofman's message of "Tue, 10 Dec 2019 00:51:12 +0300") References: <20191209215114.210057-1-gofmanp@gmail.com> <20191209215114.210057-2-gofmanp@gmail.com> Paul Gofman 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( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine )); > + TRACE( "%s image %s cmdline %s, parent %p.\n", debugstr_us( path ), > + debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->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@winehq.org