https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5768b7b75c7e0f49b33b2…
commit 5768b7b75c7e0f49b33b240f3b57c55806e7eb47
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Fri Sep 11 17:10:37 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Sep 16 10:35:46 2020 +0200
[WINESYNC] dbghelp: Support PE debug link files.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 2642f43eabe6c61341daee24487372b57723894d by Jacek Caban
<jacek(a)codeweavers.com>
---
dll/win32/dbghelp/CMakeLists.txt | 1 -
dll/win32/dbghelp/elf_module.c | 10 ----------
dll/win32/dbghelp/image_private.h | 1 +
dll/win32/dbghelp/module.c | 12 +++++++++++-
sdk/tools/winesync/dbghelp.cfg | 2 +-
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt
index 59e160b21ee..c4e3929e7b9 100644
--- a/dll/win32/dbghelp/CMakeLists.txt
+++ b/dll/win32/dbghelp/CMakeLists.txt
@@ -15,7 +15,6 @@ if(NOT CMAKE_CROSSCOMPILING)
compat.c
dbghelp.c
dwarf.c
- elf_module.c
module.c
pe_module.c
source.c
diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c
index 7a6d9bed125..142f2f036af 100644
--- a/dll/win32/dbghelp/elf_module.c
+++ b/dll/win32/dbghelp/elf_module.c
@@ -1,12 +1,3 @@
-#ifdef __REACTOS__
-#ifdef DBGHELP_STATIC_LIB
-#undef __ELF__
-#include "compat.h"
-#else
-#endif
-#include "dbghelp_private.h"
-#include "image_private.h"
-#else
/*
* File elf.c - processing of ELF files
*
@@ -50,7 +41,6 @@
#include "wine/library.h"
#include "wine/debug.h"
#include "wine/heap.h"
-#endif /* __REACTOS__ */
#ifdef __ELF__
diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h
index 579d7af37cf..b6f864aa84d 100644
--- a/dll/win32/dbghelp/image_private.h
+++ b/dll/win32/dbghelp/image_private.h
@@ -142,6 +142,7 @@ struct image_section_map
BOOL image_check_alternate(struct image_file_map* fmap, const struct module* module)
DECLSPEC_HIDDEN;
BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap) DECLSPEC_HIDDEN;
+BOOL pe_map_file(HANDLE file, struct image_file_map* fmap, enum module_type mt)
DECLSPEC_HIDDEN;
struct image_file_map_ops
{
diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c
index 16d6670a737..3429f0a2f60 100644
--- a/dll/win32/dbghelp/module.c
+++ b/dll/win32/dbghelp/module.c
@@ -561,10 +561,12 @@ static BOOL refresh_module_list(struct process* pcs)
static BOOL image_check_debug_link(const WCHAR* file, struct image_file_map* fmap, DWORD
link_crc)
{
+ DWORD read_bytes;
HANDLE handle;
#ifndef DBGHELP_STATIC_LIB
WCHAR *path;
#endif
+ WORD magic;
BOOL ret;
#ifndef DBGHELP_STATIC_LIB
@@ -587,7 +589,15 @@ static BOOL image_check_debug_link(const WCHAR* file, struct
image_file_map* fma
}
}
- ret = elf_map_handle(handle, fmap);
+ SetFilePointer(handle, 0, 0, FILE_BEGIN);
+ if (ReadFile(handle, &magic, sizeof(magic), &read_bytes, NULL) &&
magic == IMAGE_DOS_SIGNATURE)
+ ret = pe_map_file(handle, fmap, DMT_PE);
+ else
+#ifndef __REACTOS__
+ ret = elf_map_handle(handle, fmap);
+#else
+ ret = FALSE;
+#endif
CloseHandle(handle);
return ret;
}
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index 6e7eeb08789..008fc706f1e 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: 0dd495868846f30d9bb8f15f389d2b1ff6f383cb
+ wine: 2642f43eabe6c61341daee24487372b57723894d