From e2e7cce46f0c587da93f9bed8fa5dfd8673bd97c Mon Sep 17 00:00:00 2001 From: winesync Date: Fri, 11 Sep 2020 19:00:43 +0200 Subject: [PATCH] [WINESYNC] dbghelp: Don't bother trying to initialize loader backend if we can't get debug base address from PEB. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard wine commit id 3047385437c7ef36996d0418ac378677f3e9d67c by Jacek Caban --- dll/win32/dbghelp/dbghelp.c | 5 +++++ dll/win32/dbghelp/macho_module.c | 3 +-- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp.c b/dll/win32/dbghelp/dbghelp.c index a5acc786606..a92b3dd2893 100644 --- a/dll/win32/dbghelp/dbghelp.c +++ b/dll/win32/dbghelp/dbghelp.c @@ -309,6 +309,11 @@ static BOOL check_live_target(struct process* pcs) base = base32; } else ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], &base, sizeof(base), NULL); +#ifndef __REACTOS__ + /* Wine store their loader base address in peb.reserved[0] and load its symbol from there. + * ReactOS does not care about it */ + if (!base) return FALSE; +#endif TRACE("got debug info address %#lx from PEB %p\n", base, pbi.PebBaseAddress); return elf_read_wine_loader_dbg_info(pcs, base) || macho_read_wine_loader_dbg_info(pcs, base); diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 8aa232e1ed2..413a25c663d 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1845,8 +1845,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in len = sizeof(image_infos.infos64); else len = sizeof(image_infos.infos32); - if (pcs->dbg_hdr_addr && - ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) + if (ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) { if (pcs->is_64bit) len = sizeof(image_info.info64); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 4b2aa38d50d..4018c66b2e1 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: f2b8af7e7e159a5259aaab42169c4f8220b121eb + wine: 3047385437c7ef36996d0418ac378677f3e9d67c