Jacek Caban : dbghelp: Lookup real image paths in image_locate_debug_link.
Module: wine Branch: master Commit: 838de56e0ac5b91e2ffa27a696d33e0f09179b2e URL: https://source.winehq.org/git/wine.git/?a=commit;h=838de56e0ac5b91e2ffa27a69... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 17 17:22:07 2020 +0100 dbghelp: Lookup real image paths in image_locate_debug_link. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/module.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 9c8fb662f0..0a90595b8c 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -606,6 +606,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; @@ -625,6 +626,16 @@ 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; + 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));
participants (1)
-
Alexandre Julliard