From 9f7244a1c6b6fc64328ba59dcb7b892022e48725 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 21 Feb 2018 13:28:40 +1100 Subject: [PATCH] Fixed upstream by 59a7777f8494d909b9366015157d8be4ef1edb46 --- ...ore-full-path-for-ntdll-kernel32-dll.patch | 91 ------------------- patches/patchinstall.sh | 2 - 2 files changed, 93 deletions(-) delete mode 100644 patches/ntdll-NtQueryVirtualMemory/0001-server-Store-full-path-for-ntdll-kernel32-dll.patch diff --git a/patches/ntdll-NtQueryVirtualMemory/0001-server-Store-full-path-for-ntdll-kernel32-dll.patch b/patches/ntdll-NtQueryVirtualMemory/0001-server-Store-full-path-for-ntdll-kernel32-dll.patch deleted file mode 100644 index e248c0a0..00000000 --- a/patches/ntdll-NtQueryVirtualMemory/0001-server-Store-full-path-for-ntdll-kernel32-dll.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 0f9b976bc57a6a43a74a60d97df82b469d8266fb Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 28 May 2017 09:04:10 +0200 -Subject: [PATCH] server: Store full path for ntdll/kernel32 dll. - ---- - dlls/ntdll/loader.c | 8 ++++++++ - server/process.c | 23 +++++++++++++++++++++++ - server/protocol.def | 6 ++++++ - 3 files changed, 37 insertions(+) - -diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 6f4f249..0b2bd4d 100644 ---- a/dlls/ntdll/loader.c -+++ b/dlls/ntdll/loader.c -@@ -3157,6 +3157,14 @@ static void MODULE_DecRefCount( WINE_MODREF *wm ) - - wm->ldr.Flags &= ~LDR_UNLOAD_IN_PROGRESS; - } -+ -+ /* do the same for the wineserver dll list */ -+ SERVER_START_REQ( init_system_dir ) -+ { -+ wine_server_add_data( req, system_dir.Buffer, system_dir.Length ); -+ wine_server_call( req ); -+ } -+ SERVER_END_REQ; - } - - /****************************************************************** -diff --git a/server/process.c b/server/process.c -index 8c40f25..1941082 100644 ---- a/server/process.c -+++ b/server/process.c -@@ -49,6 +49,8 @@ - #include "user.h" - #include "security.h" - -+#include "wine/unicode.h" -+ - /* process structure */ - - static struct list process_list = LIST_INIT(process_list); -@@ -1617,6 +1619,27 @@ DECL_HANDLER(load_dll) - } - } - -+/* prepend the system dir to the name of the already created modules */ -+DECL_HANDLER(init_system_dir) -+{ -+ struct process *process = current->process; -+ struct process_dll *dll; -+ WCHAR *filename, *p; -+ -+ LIST_FOR_EACH_ENTRY( dll, &process->dlls, struct process_dll, entry ) -+ { -+ if (memchrW( dll->filename, '\\', dll->namelen / sizeof(WCHAR) )) continue; -+ if (!(filename = mem_alloc( get_req_data_size() + dll->namelen + sizeof(WCHAR) ))) continue; -+ memcpy( filename, get_req_data(), get_req_data_size() ); -+ p = filename + get_req_data_size() / sizeof(WCHAR); -+ if (p > filename && p[-1] != '\\') *p++ = '\\'; -+ memcpy( p, dll->filename, dll->namelen ); -+ free( dll->filename ); -+ dll->namelen += (p - filename) * sizeof(WCHAR); -+ dll->filename = filename; -+ } -+} -+ - /* notify the server that a dll is being unloaded */ - DECL_HANDLER(unload_dll) - { -diff --git a/server/protocol.def b/server/protocol.def -index 8dfc2ae..372a1a8 100644 ---- a/server/protocol.def -+++ b/server/protocol.def -@@ -965,6 +965,12 @@ struct rawinput_device - @END - - -+/* Prepend the system directory to already loaded modules */ -+@REQ(init_system_dir) -+ VARARG(sysdir,unicode_str); /* system directory */ -+@END -+ -+ - /* Notify the server that a dll is being unloaded */ - @REQ(unload_dll) - mod_handle_t base; /* base address */ --- -1.9.1 - diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b1be26bc..d3474d16 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -6150,7 +6150,6 @@ fi # | dlls/ntdll/virtual.c, dlls/psapi/tests/psapi_main.c, server/mapping.c, server/process.c, server/protocol.def # | if test "$enable_ntdll_NtQueryVirtualMemory" -eq 1; then - patch_apply ntdll-NtQueryVirtualMemory/0001-server-Store-full-path-for-ntdll-kernel32-dll.patch patch_apply ntdll-NtQueryVirtualMemory/0002-ntdll-Split-logic-for-MemoryBasicInformation-into-a-.patch patch_apply ntdll-NtQueryVirtualMemory/0003-ntdll-Implement-NtQueryVirtualMemory-MemorySectionNa.patch patch_apply ntdll-NtQueryVirtualMemory/0004-ntdll-tests-Add-tests-for-NtQueryVirtualMemory-Memor.patch @@ -6160,7 +6159,6 @@ if test "$enable_ntdll_NtQueryVirtualMemory" -eq 1; then patch_apply ntdll-NtQueryVirtualMemory/0008-ntdll-Resolve-drive-symlinks-before-returning-sectio.patch patch_apply ntdll-NtQueryVirtualMemory/0009-ntdll-Fix-error-code-when-querying-too-large-memory-.patch ( - printf '%s\n' '+ { "Sebastian Lackner", "server: Store full path for ntdll/kernel32 dll.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "ntdll: Split logic for MemoryBasicInformation into a separate function.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "ntdll: Implement NtQueryVirtualMemory(MemorySectionName).", 3 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "ntdll/tests: Add tests for NtQueryVirtualMemory(MemorySectionName).", 1 },';