https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f308fa857b45f6d9c7314…
commit f308fa857b45f6d9c7314d8dac9e02b04da3be1f
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Fri Sep 11 17:15:29 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Sep 16 10:35:49 2020 +0200
[WINESYNC] dbghelp: Use loader_ops for load_module.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 5ae3f969d4ec525a14a8109a5ee4c5a2e2238405 by Jacek Caban
<jacek(a)codeweavers.com>
---
dll/win32/dbghelp/dbghelp_private.h | 5 +----
dll/win32/dbghelp/elf_module.c | 8 ++------
dll/win32/dbghelp/macho_module.c | 8 ++------
dll/win32/dbghelp/module.c | 21 +++++++--------------
sdk/tools/winesync/dbghelp.cfg | 2 +-
5 files changed, 13 insertions(+), 31 deletions(-)
diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h
index 472b05a1b9d..a232547a514 100644
--- a/dll/win32/dbghelp/dbghelp_private.h
+++ b/dll/win32/dbghelp/dbghelp_private.h
@@ -423,6 +423,7 @@ typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr,
void* user);
struct loader_ops
{
BOOL (*synchronize_module_list)(struct process* process);
+ struct module* (*load_module)(struct process* process, const WCHAR* name, ULONG_PTR
addr);
BOOL (*enum_modules)(struct process* process, enum_modules_cb callback, void* user);
BOOL (*fetch_file_info)(struct process* process, const WCHAR* name, ULONG_PTR
load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum);
};
@@ -634,16 +635,12 @@ extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN;
/* elf_module.c */
extern BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN;
-extern struct module*
- elf_load_module(struct process* pcs, const WCHAR* name, unsigned
long) DECLSPEC_HIDDEN;
extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN;
struct elf_thunk_area;
extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area*
thunks) DECLSPEC_HIDDEN;
/* macho_module.c */
extern BOOL macho_load_debug_info(struct process *pcs, struct module* module)
DECLSPEC_HIDDEN;
-extern struct module*
- macho_load_module(struct process* pcs, const WCHAR* name, unsigned
long) DECLSPEC_HIDDEN;
extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs)
DECLSPEC_HIDDEN;
/* minidump.c */
diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c
index 64c550a67bd..038a552e429 100644
--- a/dll/win32/dbghelp/elf_module.c
+++ b/dll/win32/dbghelp/elf_module.c
@@ -1583,7 +1583,7 @@ static BOOL elf_load_cb(const WCHAR* name, unsigned long load_addr,
* Also, find module real name and load address from
* the real loaded modules list in pcs address space
*/
-struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long
addr)
+static struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned
long addr)
{
struct elf_load el;
@@ -1706,6 +1706,7 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info*
elf_info)
static const struct loader_ops elf_loader_ops =
{
elf_synchronize_module_list,
+ elf_load_module,
elf_enum_modules,
elf_fetch_file_info,
};
@@ -1740,11 +1741,6 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs)
return FALSE;
}
-struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long
addr)
-{
- return NULL;
-}
-
BOOL elf_load_debug_info(struct module* module)
{
return FALSE;
diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index df38129e12c..c55443905b0 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -1782,7 +1782,7 @@ static BOOL macho_load_cb(const WCHAR* name, unsigned long addr,
void* user)
* Also, find module real name and load address from
* the real loaded modules list in pcs address space.
*/
-struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long
addr)
+static struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned
long addr)
{
struct macho_load ml;
@@ -1906,6 +1906,7 @@ static BOOL macho_search_loader(struct process* pcs, struct
macho_info* macho_in
static const struct loader_ops macho_loader_ops =
{
macho_synchronize_module_list,
+ macho_load_module,
macho_enum_modules,
macho_fetch_file_info,
};
@@ -1936,11 +1937,6 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs)
return FALSE;
}
-struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long
addr)
-{
- return NULL;
-}
-
BOOL macho_load_debug_info(struct process *pcs, struct module* module)
{
return FALSE;
diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c
index 61a069ec75b..4634893eb82 100644
--- a/dll/win32/dbghelp/module.c
+++ b/dll/win32/dbghelp/module.c
@@ -919,20 +919,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile,
PCWSTR wImageNam
wImageName)
{
/* and finally an ELF or Mach-O module */
-#ifndef DBGHELP_STATIC_LIB
- switch (module_get_type_by_name(wImageName))
- {
- case DMT_ELF:
- module = elf_load_module(pcs, wImageName, BaseOfDll);
- break;
- case DMT_MACHO:
- module = macho_load_module(pcs, wImageName, BaseOfDll);
- break;
- default:
- /* Ignored */
- break;
- }
-#endif
+ module = pcs->loader->load_module(pcs, wImageName, BaseOfDll);
}
}
if (!module)
@@ -1465,6 +1452,11 @@ static BOOL native_synchronize_module_list(struct process* pcs)
return FALSE;
}
+static struct module* native_load_module(struct process* pcs, const WCHAR* name, unsigned
long addr)
+{
+ return NULL;
+}
+
static BOOL native_enum_modules(struct process *process, enum_modules_cb cb, void* user)
{
return FALSE;
@@ -1479,6 +1471,7 @@ static BOOL native_fetch_file_info(struct process* process, const
WCHAR* name, U
const struct loader_ops no_loader_ops =
{
native_synchronize_module_list,
+ native_load_module,
native_enum_modules,
native_fetch_file_info,
};
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index 06702ac9f61..7a4f813471b 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: 16a3481bd22243183281c60ff375d4e61d5c4198
+ wine: 5ae3f969d4ec525a14a8109a5ee4c5a2e2238405