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

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
Eric Pouech 2023-12-22 11:08:38 +01:00 committed by Alexandre Julliard
parent 930776022d
commit 8cbf27659b
Notes: Alexandre Julliard 2023-12-22 22:00:00 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/4732

View file

@ -287,7 +287,14 @@ void info_win32_module(DWORD64 base, BOOL multi_machine)
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);
if (multi_machine)