Commit 838de56e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

dbghelp: Lookup real image paths in image_locate_debug_link.

parent 2642f43e
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment