From: Alexandre Julliard Subject: Re: [PATCH] kernel32: Launch 32-bit IL-only as 64-bit in WIN64 Message-Id: <87r2caut21.fsf@wine> Date: Thu, 14 Feb 2019 19:24:38 +0100 In-Reply-To: <20190210010043.23101-1-brendan@redmandi.com> (Brendan McGrath's message of "Sun, 10 Feb 2019 12:00:43 +1100") References: <20190210010043.23101-1-brendan@redmandi.com> Brendan McGrath writes: > When using CreateProcessA to execute a 32-bit .NET/Mono application > (which is IL-only) the process is always launched as a 32-bit process > under Wine; but under Windows it is launched as a 64-bit process. > > This patch changes Wine's behaviour to match Windows. > > Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46319 > Signed-off-by: Brendan McGrath > --- > dlls/kernel32/process.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c > index 26c576e4f0..a118d4798d 100644 > --- a/dlls/kernel32/process.c > +++ b/dlls/kernel32/process.c > @@ -2052,6 +2052,9 @@ static pid_t spawn_loader( const RTL_USER_PROCESS_PARAMETERS *params, int socket > argv = build_argv( ¶ms->CommandLine, 1 ); > > if (!is_win64 ^ !is_64bit_arch( pe_info->cpu )) > +#ifdef _WIN64 > + if ( !(pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) ) > +#endif > loader = get_alternate_loader( &wineloader ); > > wine_server_handle_to_fd( params->hStdInput, FILE_READ_DATA, &stdin_fd, NULL ); > @@ -2355,6 +2358,11 @@ static BOOL create_process( HANDLE hFile, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ > req->socket_fd = socketfd[1]; > req->exe_file = wine_server_obj_handle( hFile ); > req->access = PROCESS_ALL_ACCESS; > +#ifdef _WIN64 > + if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) > + req->cpu = CPU_x86_64; You'd need some way to handle ARM64 too. Also you probably want to update pe_info->cpu instead of adding #ifdefs everywhere it's used. -- Alexandre Julliard julliard@winehq.org