Commit 30040cc9 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Also update the entry point address when loading an ARM64X binary.

parent c73684e5
......@@ -2677,7 +2677,9 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena
(!machine && main_image_info.Machine == IMAGE_FILE_MACHINE_AMD64))
{
update_arm64x_mapping( ptr, nt, sections );
image_info->machine = nt->FileHeader.Machine; /* reload changed machine from NT header */
/* reload changed data from NT header */
image_info->machine = nt->FileHeader.Machine;
image_info->entry_point = nt->OptionalHeader.AddressOfEntryPoint;
}
#endif
if (machine && machine != nt->FileHeader.Machine) return STATUS_NOT_SUPPORTED;
......@@ -2810,6 +2812,7 @@ static NTSTATUS virtual_map_image( HANDLE mapping, void **addr_ptr, SIZE_T *size
req->mapping = wine_server_obj_handle( mapping );
req->base = wine_server_client_ptr( view->base );
req->size = size;
req->entry = image_info->entry_point;
req->machine = image_info->machine;
status = wine_server_call( req );
}
......
......@@ -1998,8 +1998,9 @@ struct map_image_view_request
obj_handle_t mapping;
client_ptr_t base;
mem_size_t size;
unsigned int entry;
unsigned short machine;
char __pad_34[6];
char __pad_38[2];
};
struct map_image_view_reply
{
......@@ -6414,7 +6415,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 769
#define SERVER_PROTOCOL_VERSION 770
/* ### protocol_version end ### */
......
......@@ -1270,7 +1270,8 @@ DECL_HANDLER(map_image_view)
view->committed = NULL;
view->shared = mapping->shared ? (struct shared_map *)grab_object( mapping->shared ) : NULL;
view->image = mapping->image;
view->image.machine = req->machine;
view->image.machine = req->machine;
view->image.entry_point = req->entry;
add_process_view( current, view );
if (view->base != mapping->image.base) set_error( STATUS_IMAGE_NOT_AT_BASE );
......
......@@ -1612,6 +1612,7 @@ enum server_fd_type
obj_handle_t mapping; /* file mapping handle */
client_ptr_t base; /* view base address (page-aligned) */
mem_size_t size; /* view size */
unsigned int entry; /* entry point in mapped view */
unsigned short machine; /* machine in the mapped view */
@END
......
......@@ -1126,7 +1126,8 @@ C_ASSERT( sizeof(struct map_view_request) == 48 );
C_ASSERT( FIELD_OFFSET(struct map_image_view_request, mapping) == 12 );
C_ASSERT( FIELD_OFFSET(struct map_image_view_request, base) == 16 );
C_ASSERT( FIELD_OFFSET(struct map_image_view_request, size) == 24 );
C_ASSERT( FIELD_OFFSET(struct map_image_view_request, machine) == 32 );
C_ASSERT( FIELD_OFFSET(struct map_image_view_request, entry) == 32 );
C_ASSERT( FIELD_OFFSET(struct map_image_view_request, machine) == 36 );
C_ASSERT( sizeof(struct map_image_view_request) == 40 );
C_ASSERT( sizeof(struct map_builtin_view_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct unmap_view_request, base) == 16 );
......
......@@ -2185,6 +2185,7 @@ static void dump_map_image_view_request( const struct map_image_view_request *re
fprintf( stderr, " mapping=%04x", req->mapping );
dump_uint64( ", base=", &req->base );
dump_uint64( ", size=", &req->size );
fprintf( stderr, ", entry=%08x", req->entry );
fprintf( stderr, ", machine=%04x", req->machine );
}
......
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