Module: wine Branch: master Commit: 5c7c954658ff330a43bbe53cd8d5dad423b75de6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5c7c954658ff330a43bbe53cd8...
Author: Huw Davies huw@codeweavers.com Date: Fri Sep 27 11:14:42 2013 +0100
dbghelp: Skip the dllprefix when matching PE with ELF modules.
---
dlls/dbghelp/Makefile.in | 2 +- dlls/dbghelp/module.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in index 3fb7b52..a9bf073 100644 --- a/dlls/dbghelp/Makefile.in +++ b/dlls/dbghelp/Makefile.in @@ -1,6 +1,6 @@ MODULE = dbghelp.dll IMPORTLIB = dbghelp -EXTRADEFS = -D_IMAGEHLP_SOURCE_ +EXTRADEFS = -D_IMAGEHLP_SOURCE_ -DDLLPREFIX='"$(DLLPREFIX)"' IMPORTS = psapi DELAYIMPORTS = version EXTRALIBS = @ZLIB@ diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 6bea436..521cdb3f 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -422,6 +422,16 @@ static BOOL module_is_container_loaded(const struct process* pcs, size_t len; struct module* module; PCWSTR filename, modname; + static WCHAR* dll_prefix; + static int dll_prefix_len; + + if (!dll_prefix) + { + dll_prefix_len = MultiByteToWideChar( CP_UNIXCP, 0, DLLPREFIX, -1, NULL, 0 ); + dll_prefix = HeapAlloc( GetProcessHeap(), 0, dll_prefix_len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_UNIXCP, 0, DLLPREFIX, -1, dll_prefix, dll_prefix_len ); + dll_prefix_len--; + }
if (!base) return FALSE; filename = get_filename(ImageName, NULL); @@ -434,6 +444,7 @@ static BOOL module_is_container_loaded(const struct process* pcs, base < module->module.BaseOfImage + module->module.ImageSize) { modname = get_filename(module->module.LoadedImageName, NULL); + if (dll_prefix_len && !strncmpW( modname, dll_prefix, dll_prefix_len )) modname += dll_prefix_len; if (!strncmpiW(modname, filename, len) && !memcmp(modname + len, S_DotSoW, 3 * sizeof(WCHAR))) {