ntdll: Avoid closing an invalid handle on process creation failure.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
375278ccb7
commit
4e6c1dff58
|
@ -406,6 +406,7 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, HANDLE *handle, pe_image
|
||||||
OBJECT_ATTRIBUTES attr;
|
OBJECT_ATTRIBUTES attr;
|
||||||
IO_STATUS_BLOCK io;
|
IO_STATUS_BLOCK io;
|
||||||
|
|
||||||
|
*handle = 0;
|
||||||
memset( info, 0, sizeof(*info) );
|
memset( info, 0, sizeof(*info) );
|
||||||
InitializeObjectAttributes( &attr, path, OBJ_CASE_INSENSITIVE, 0, 0 );
|
InitializeObjectAttributes( &attr, path, OBJ_CASE_INSENSITIVE, 0, 0 );
|
||||||
if ((status = NtOpenFile( handle, GENERIC_READ, &attr, &io,
|
if ((status = NtOpenFile( handle, GENERIC_READ, &attr, &io,
|
||||||
|
@ -422,7 +423,6 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, HANDLE *handle, pe_image
|
||||||
#else
|
#else
|
||||||
info->cpu = client_cpu;
|
info->cpu = client_cpu;
|
||||||
#endif
|
#endif
|
||||||
*handle = 0;
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|
Loading…
Reference in New Issue