[PATCH] dbghelp: Use correct module name buffer length when doing enumeration

Nikolay Sivov nsivov at codeweavers.com
Wed Jan 31 09:40:44 CST 2018


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---

Manually tested on Windows.

 dlls/dbghelp/dbghelp_private.h | 1 +
 dlls/dbghelp/module.c          | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 684111c86c..f37991dacd 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -353,6 +353,7 @@ struct module
 {
     struct process*             process;
     IMAGEHLP_MODULEW64          module;
+    WCHAR                       modulename[64]; /* used for enumeration */
     struct module*              next;
     enum module_type		type : 16;
     unsigned short              is_virtual : 1;
diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index 6c7f2dcb6d..9f90d5e0ca 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -102,6 +102,7 @@ void module_set_module(struct module* module, const WCHAR* name)
 {
     module_fill_module(name, module->module.ModuleName,
             sizeof(module->module.ModuleName) / sizeof(module->module.ModuleName[0]));
+    module_fill_module(name, module->modulename, sizeof(module->modulename) / sizeof(module->modulename[0]));
 }
 
 const WCHAR *get_wine_loader_name(void)
@@ -812,7 +813,7 @@ BOOL  WINAPI SymEnumerateModulesW64(HANDLE hProcess,
         if (!(dbghelp_options & SYMOPT_WINE_WITH_NATIVE_MODULES) &&
             (module->type == DMT_ELF || module->type == DMT_MACHO))
             continue;
-        if (!EnumModulesCallback(module->module.ModuleName,
+        if (!EnumModulesCallback(module->modulename,
                                  module->module.BaseOfImage, UserContext))
             break;
     }
-- 
2.15.1




More information about the wine-devel mailing list