Commit 8cbf2765 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedbg: Fix main module detection in 'info share' command.

parent 93077602
...@@ -287,7 +287,14 @@ void info_win32_module(DWORD64 base, BOOL multi_machine) ...@@ -287,7 +287,14 @@ void info_win32_module(DWORD64 base, BOOL multi_machine)
if (!im.num_used) return; if (!im.num_used) return;
machine = im.modules[0].mi.MachineType; /* main module is the first PE module in enumeration */
for (i = 0; i < im.num_used; i++)
if (im.modules[i].ext_module_info.type == DMT_PE)
{
machine = im.modules[i].mi.MachineType;
break;
}
if (i == im.num_used) machine = IMAGE_FILE_MACHINE_UNKNOWN;
qsort(im.modules, im.num_used, sizeof(im.modules[0]), module_compare); qsort(im.modules, im.num_used, sizeof(im.modules[0]), module_compare);
if (multi_machine) if (multi_machine)
......
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