Added patch with backport for regression caused by virtual memory management changes.

This commit is contained in:
Sebastian Lackner 2017-10-04 00:49:31 +02:00
parent 7131b6ce3c
commit 18a46d576a
3 changed files with 131 additions and 0 deletions

View File

@ -356,6 +356,7 @@ patch_enable_all ()
enable_server_create_ranges="$1"
enable_server_device_manager_destroy="$1"
enable_server_free_async_queue="$1"
enable_server_open_mapping_file="$1"
enable_server_send_hardware_message="$1"
enable_setupapi_DiskSpaceList="$1"
enable_setupapi_Display_Device="$1"
@ -1354,6 +1355,9 @@ patch_enable ()
server-free_async_queue)
enable_server_free_async_queue="$2"
;;
server-open_mapping_file)
enable_server_open_mapping_file="$2"
;;
server-send_hardware_message)
enable_server_send_hardware_message="$2"
;;
@ -8029,6 +8033,21 @@ if test "$enable_server_free_async_queue" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-open_mapping_file
# |
# | This patchset fixes the following Wine bugs:
# | * [#43830] Backport for regression caused by virtual memory management changes
# |
# | Modified files:
# | * server/debugger.c, server/file.h, server/mapping.c
# |
if test "$enable_server_open_mapping_file" -eq 1; then
patch_apply server-open_mapping_file/0001-server-Use-the-correct-process-when-looking-for-a-ma.patch
(
printf '%s\n' '+ { "Alexandre Julliard", "server: Use the correct process when looking for a mapped dll.", 1 },';
) >> "$patchlist"
fi
# Patchset server-send_hardware_message
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,111 @@
From ec824c32fee6c70d993cb245fc8a9f72e54a06ec Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Tue, 3 Oct 2017 11:59:20 +0200
Subject: server: Use the correct process when looking for a mapped dll.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
server/debugger.c | 18 ++++++++++++++----
server/file.h | 4 ++--
server/mapping.c | 15 +++++----------
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/server/debugger.c b/server/debugger.c
index 4d4f0035c2f..d658fc0625f 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -149,6 +149,7 @@ static int fill_create_process_event( struct debug_event *event, const void *arg
struct process *process = thread->process;
struct process_dll *exe_module = get_process_exe_module( process );
const client_ptr_t *entry = arg;
+ struct file *file;
obj_handle_t handle;
/* documented: PROCESS_VM_READ | PROCESS_VM_WRITE */
@@ -172,8 +173,12 @@ static int fill_create_process_event( struct debug_event *event, const void *arg
event->data.create_process.unicode = 1;
/* the doc says write access too, but this doesn't seem a good idea */
- event->data.create_process.file = open_mapping_file( debugger, exe_module->base, GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE );
+ if ((file = get_mapping_file( process, exe_module->base, GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE )))
+ {
+ event->data.create_process.file = alloc_handle( debugger, file, GENERIC_READ, 0 );
+ release_object( file );
+ }
return 1;
}
@@ -193,8 +198,10 @@ static int fill_exit_process_event( struct debug_event *event, const void *arg )
static int fill_load_dll_event( struct debug_event *event, const void *arg )
{
+ struct process *process = event->sender->process;
struct process *debugger = event->debugger->process;
const struct process_dll *dll = arg;
+ struct file *file;
event->data.load_dll.handle = 0;
event->data.load_dll.base = dll->base;
@@ -202,8 +209,11 @@ static int fill_load_dll_event( struct debug_event *event, const void *arg )
event->data.load_dll.dbg_size = dll->dbg_size;
event->data.load_dll.name = dll->name;
event->data.load_dll.unicode = 1;
- event->data.load_dll.handle = open_mapping_file( debugger, dll->base, GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE );
+ if ((file = get_mapping_file( process, dll->base, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE )))
+ {
+ event->data.load_dll.handle = alloc_handle( debugger, file, GENERIC_READ, 0 );
+ release_object( file );
+ }
return 1;
}
diff --git a/server/file.h b/server/file.h
index 27c5d198e81..17bfdda9990 100644
--- a/server/file.h
+++ b/server/file.h
@@ -150,8 +150,8 @@ extern struct security_descriptor *get_file_sd( struct object *obj, struct fd *f
extern struct mapping *get_mapping_obj( struct process *process, obj_handle_t handle,
unsigned int access );
-extern obj_handle_t open_mapping_file( struct process *process, client_ptr_t base,
- unsigned int access, unsigned int sharing );
+extern struct file *get_mapping_file( struct process *process, client_ptr_t base,
+ unsigned int access, unsigned int sharing );
extern void free_mapped_views( struct process *process );
extern int get_page_size(void);
diff --git a/server/mapping.c b/server/mapping.c
index 22cd5c2064d..5db03f8861a 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -815,19 +815,14 @@ struct mapping *get_mapping_obj( struct process *process, obj_handle_t handle, u
return (struct mapping *)get_handle_obj( process, handle, access, &mapping_ops );
}
-/* open a new file handle to the file backing the mapping */
-obj_handle_t open_mapping_file( struct process *process, client_ptr_t base,
- unsigned int access, unsigned int sharing )
+/* open a new file for the file descriptor backing the mapping */
+struct file *get_mapping_file( struct process *process, client_ptr_t base,
+ unsigned int access, unsigned int sharing )
{
- obj_handle_t handle;
struct memory_view *view = find_mapped_view( process, base );
- struct file *file;
- if (!view || !view->fd) return 0;
- if (!(file = create_file_for_fd_obj( view->fd, access, sharing ))) return 0;
- handle = alloc_handle( process, file, access, 0 );
- release_object( file );
- return handle;
+ if (!view || !view->fd) return NULL;
+ return create_file_for_fd_obj( view->fd, access, sharing );
}
static void mapping_dump( struct object *obj, int verbose )
--
2.14.1

View File

@ -0,0 +1 @@
Fixes: [43830] Backport for regression caused by virtual memory management changes