dbghelp: Use correct module name buffer length when doing enumeration.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-01-31 18:40:44 +03:00 committed by Alexandre Julliard
parent d9f4390488
commit 6fd9a98f1d
2 changed files with 3 additions and 1 deletions

View File

@ -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;

View File

@ -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;
}