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

commit 429c6cd3aa5cafebe01e98269394c583c2d384f9
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 17:10:37 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:46 2020 +0200

    [WINESYNC] dbghelp: Lookup real image paths in image_locate_debug_link.
    
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 838de56e0ac5b91e2ffa27a696d33e0f09179b2e by Jacek Caban 
<[email protected]>
---
 dll/win32/dbghelp/module.c     | 13 +++++++++++--
 sdk/tools/winesync/dbghelp.cfg |  2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c
index 3429f0a2f60..df2dc178c4e 100644
--- a/dll/win32/dbghelp/module.c
+++ b/dll/win32/dbghelp/module.c
@@ -637,6 +637,7 @@ static BOOL image_locate_debug_link(const struct module* 
module, struct image_fi
 
     filename_len = MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, NULL, 0);
     path_len = strlenW(module->module.LoadedImageName);
+    if (module->real_path) path_len = max(path_len, 
strlenW(module->real_path));
     p = HeapAlloc(GetProcessHeap(), 0,
                   (globalDebugDirLen + path_len + 6 + 1 + filename_len + 1) * 
sizeof(WCHAR));
     if (!p) goto found;
@@ -656,14 +657,22 @@ static BOOL image_locate_debug_link(const struct module* 
module, struct image_fi
     MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash + 
ARRAY_SIZE(dotDebugW), filename_len);
     if (image_check_debug_link(p, fmap_link, crc)) goto found;
 
-#ifndef __REACTOS__
+    if (module->real_path)
+    {
+        strcpyW(p, module->real_path);
+        slash = p;
+        if ((slash2 = strrchrW(slash, '/'))) slash = slash2 + 1;
+        if ((slash2 = strrchrW(slash, '\\'))) slash = slash2 + 1;
+        MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash, filename_len);
+        if (image_check_debug_link(p, fmap_link, crc)) goto found;
+    }
+
     /* testing globaldebugdir/execdir/filename */
     memmove(p + globalDebugDirLen, p, (slash - p) * sizeof(WCHAR));
     memcpy(p, globalDebugDirW, globalDebugDirLen * sizeof(WCHAR));
     slash += globalDebugDirLen;
     MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash, filename_len);
     if (image_check_debug_link(p, fmap_link, crc)) goto found;
-#endif
 
     /* finally testing filename */
     if (image_check_debug_link(slash, fmap_link, crc)) goto found;
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index 008fc706f1e..0c61d2beac1 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: 2642f43eabe6c61341daee24487372b57723894d
+  wine: 838de56e0ac5b91e2ffa27a696d33e0f09179b2e

Reply via email to