https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df9fadccb36d24b54954365fa331eae2c57833db

commit df9fadccb36d24b54954365fa331eae2c57833db
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 17:15:27 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:49 2020 +0200

    [WINESYNC] dbghelp: Pass process struct to image_uses_split_segs.
    
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 2a5160c4f2eb80dcc8770cd10d702a5d8233314f by Jacek Caban 
<[email protected]>
---
 dll/win32/dbghelp/macho_module.c | 15 +++++++--------
 sdk/tools/winesync/dbghelp.cfg   |  2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index 4847a434fda..73d0575a4b0 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -1255,18 +1255,17 @@ found:
  * The image header has to be loaded from the process's memory
  * because the relevant flag is only set in memory, not in the file.
  */
-static BOOL image_uses_split_segs(HANDLE process, unsigned long load_addr)
+static BOOL image_uses_split_segs(struct process* process, unsigned long 
load_addr)
 {
     BOOL split_segs = FALSE;
 
-    if (process && load_addr)
+    if (load_addr)
     {
-        struct process *pcs = process_find_by_handle(process);
-        cpu_type_t target_cpu = (pcs->is_64bit) ? CPU_TYPE_X86_64 : 
CPU_TYPE_X86;
-        uint32_t target_magic = (pcs->is_64bit) ? MH_MAGIC_64 : MH_MAGIC;
+        cpu_type_t target_cpu = (process->is_64bit) ? CPU_TYPE_X86_64 : 
CPU_TYPE_X86;
+        uint32_t target_magic = (process->is_64bit) ? MH_MAGIC_64 : MH_MAGIC;
         struct mach_header header;
 
-        if (ReadProcessMemory(process, (void*)load_addr, &header, 
sizeof(header), NULL) &&
+        if (ReadProcessMemory(process->handle, (void*)load_addr, &header, 
sizeof(header), NULL) &&
             header.magic == target_magic && header.cputype == target_cpu &&
             header.flags & MACHO_DYLD_IN_SHARED_CACHE)
         {
@@ -1351,7 +1350,7 @@ static BOOL macho_fetch_file_info(struct process* 
process, const WCHAR* name, UL
 
     TRACE("(%s, %p, %p, %p)\n", debugstr_w(name), base, size, checksum);
 
-    split_segs = image_uses_split_segs(process->handle, load_addr);
+    split_segs = image_uses_split_segs(process, load_addr);
     if (!macho_map_file(process, name, split_segs, &fmap)) return FALSE;
     if (base) *base = fmap.u.macho.segs_start;
     *size = fmap.u.macho.segs_size;
@@ -1449,7 +1448,7 @@ static BOOL macho_load_file(struct process* pcs, const 
WCHAR* filename,
     TRACE("(%p/%p, %s, 0x%08lx, %p/0x%08x)\n", pcs, pcs->handle, 
debugstr_w(filename),
             load_addr, macho_info, macho_info->flags);
 
-    split_segs = image_uses_split_segs(pcs->handle, load_addr);
+    split_segs = image_uses_split_segs(pcs, load_addr);
     if (!macho_map_file(pcs, filename, split_segs, &fmap)) return FALSE;
 
     /* Find the dynamic loader's table of images loaded into the process.
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index 44688198f3d..95aa66e766f 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
   include/dbghelp.h: sdk/include/psdk/dbghelp.h
   include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
 tags:
-  wine: 1bbd54409a546c26af8ac2a64f2603114d73a18c
+  wine: 2a5160c4f2eb80dcc8770cd10d702a5d8233314f

Reply via email to