Commit bd703632 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Don't update the machine in the image information for ARM64EC modules.

parent ce4636e5
...@@ -404,14 +404,6 @@ struct memory_view *get_exe_view( struct process *process ) ...@@ -404,14 +404,6 @@ struct memory_view *get_exe_view( struct process *process )
return LIST_ENTRY( list_head( &process->views ), struct memory_view, entry ); return LIST_ENTRY( list_head( &process->views ), struct memory_view, entry );
} }
static void set_process_machine( struct process *process, struct memory_view *view )
{
if (view->image.image_flags & IMAGE_FLAGS_ComPlusNativeReady)
process->machine = native_machine;
else
process->machine = view->image.machine;
}
static int generate_dll_event( struct thread *thread, int code, struct memory_view *view ) static int generate_dll_event( struct thread *thread, int code, struct memory_view *view )
{ {
if (!(view->flags & SEC_IMAGE)) return 0; if (!(view->flags & SEC_IMAGE)) return 0;
...@@ -420,7 +412,8 @@ static int generate_dll_event( struct thread *thread, int code, struct memory_vi ...@@ -420,7 +412,8 @@ static int generate_dll_event( struct thread *thread, int code, struct memory_vi
} }
/* add a view to the process list */ /* add a view to the process list */
static void add_process_view( struct thread *thread, struct memory_view *view ) /* return 1 if this is the main exe view */
static int add_process_view( struct thread *thread, struct memory_view *view )
{ {
struct process *process = thread->process; struct process *process = thread->process;
struct unicode_str name; struct unicode_str name;
...@@ -434,18 +427,17 @@ static void add_process_view( struct thread *thread, struct memory_view *view ) ...@@ -434,18 +427,17 @@ static void add_process_view( struct thread *thread, struct memory_view *view )
else if (!(view->image.image_charact & IMAGE_FILE_DLL)) else if (!(view->image.image_charact & IMAGE_FILE_DLL))
{ {
/* main exe */ /* main exe */
set_process_machine( process, view );
list_add_head( &process->views, &view->entry );
free( process->image ); free( process->image );
process->image = NULL; process->image = NULL;
if (get_view_nt_name( view, &name ) && (process->image = memdup( name.str, name.len ))) if (get_view_nt_name( view, &name ) && (process->image = memdup( name.str, name.len )))
process->imagelen = name.len; process->imagelen = name.len;
process->image_info = view->image; process->image_info = view->image;
return; list_add_head( &process->views, &view->entry );
return 1;
} }
} }
list_add_tail( &process->views, &view->entry ); list_add_tail( &process->views, &view->entry );
return 0;
} }
static void free_memory_view( struct memory_view *view ) static void free_memory_view( struct memory_view *view )
...@@ -1401,16 +1393,19 @@ DECL_HANDLER(map_image_view) ...@@ -1401,16 +1393,19 @@ DECL_HANDLER(map_image_view)
view->committed = NULL; view->committed = NULL;
view->shared = mapping->shared ? (struct shared_map *)grab_object( mapping->shared ) : NULL; view->shared = mapping->shared ? (struct shared_map *)grab_object( mapping->shared ) : NULL;
view->image = mapping->image; view->image = mapping->image;
view->image.machine = req->machine;
view->image.entry_point = req->entry; view->image.entry_point = req->entry;
add_process_view( current, view ); if (add_process_view( current, view ))
{
current->process->machine = (view->image.image_flags & IMAGE_FLAGS_ComPlusNativeReady) ?
native_machine : req->machine;
}
if (view->base != (mapping->image.map_addr ? mapping->image.map_addr : mapping->image.base)) if (view->base != (mapping->image.map_addr ? mapping->image.map_addr : mapping->image.base))
set_error( STATUS_IMAGE_NOT_AT_BASE ); set_error( STATUS_IMAGE_NOT_AT_BASE );
if (view->image.machine != current->process->machine) if (req->machine != current->process->machine)
{ {
/* on 32-bit, the native 64-bit machine is allowed */ /* on 32-bit, the native 64-bit machine is allowed */
if (is_machine_64bit( current->process->machine ) || view->image.machine != native_machine) if (is_machine_64bit( current->process->machine ) || req->machine != native_machine)
set_error( STATUS_IMAGE_MACHINE_TYPE_MISMATCH ); set_error( STATUS_IMAGE_MACHINE_TYPE_MISMATCH );
} }
} }
...@@ -1443,7 +1438,7 @@ DECL_HANDLER(map_builtin_view) ...@@ -1443,7 +1438,7 @@ DECL_HANDLER(map_builtin_view)
view->image = *image; view->image = *image;
view->namelen = namelen; view->namelen = namelen;
memcpy( view->name, image + 1, namelen ); memcpy( view->name, image + 1, namelen );
add_process_view( current, view ); if (add_process_view( current, view )) current->process->machine = image->machine;
} }
} }
......
...@@ -253,6 +253,7 @@ static inline int is_machine_supported( unsigned short machine ) ...@@ -253,6 +253,7 @@ static inline int is_machine_supported( unsigned short machine )
{ {
unsigned int i; unsigned int i;
for (i = 0; i < supported_machines_count; i++) if (supported_machines[i] == machine) return 1; for (i = 0; i < supported_machines_count; i++) if (supported_machines[i] == machine) return 1;
if (native_machine == IMAGE_FILE_MACHINE_ARM64) return machine == IMAGE_FILE_MACHINE_AMD64;
return 0; return 0;
} }
......
...@@ -656,6 +656,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla ...@@ -656,6 +656,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
process->msg_fd = NULL; process->msg_fd = NULL;
process->sigkill_timeout = NULL; process->sigkill_timeout = NULL;
process->sigkill_delay = TICKS_PER_SEC / 64; process->sigkill_delay = TICKS_PER_SEC / 64;
process->machine = native_machine;
process->unix_pid = -1; process->unix_pid = -1;
process->exit_code = STILL_ACTIVE; process->exit_code = STILL_ACTIVE;
process->running_threads = 0; process->running_threads = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment