dbghelp: Allow loading modules for different machines.

SYMOPT_INCLUDE_32BIT_MODULES option applies when enumerating
loaded modules, but not when actually loading debug information for
a module.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
This commit is contained in:
Eric Pouech 2023-02-01 16:22:55 +01:00 committed by Alexandre Julliard
parent 75fd446272
commit 4d2cbb4104
2 changed files with 2 additions and 7 deletions

View file

@ -269,11 +269,6 @@ BOOL pe_map_file(HANDLE file, struct image_file_map* fmap, enum module_type mt)
switch (nthdr->OptionalHeader.Magic)
{
case IMAGE_NT_OPTIONAL_HDR32_MAGIC:
if (sizeof(void*) == 8 && !(SymGetOptions() & SYMOPT_INCLUDE_32BIT_MODULES))
{
TRACE("Won't load 32bit module in 64bit dbghelp when options don't ask for it\n");
goto error;
}
fmap->addr_size = 32;
memcpy(&fmap->u.pe.opt.header32, &nthdr->OptionalHeader, sizeof(fmap->u.pe.opt.header32));
break;

View file

@ -233,7 +233,6 @@ static void test_modules(void)
/* not always present */
attr = GetFileAttributesA("C:\\windows\\syswow64\\notepad.exe");
todo_wine_if(sizeof(void*) == 8)
if (attr != INVALID_FILE_ATTRIBUTES)
{
ret = SymLoadModule(GetCurrentProcess(), NULL, "C:\\windows\\syswow64\\notepad.exe", NULL, base2, 0);
@ -241,6 +240,7 @@ static void test_modules(void)
ret = SymGetModuleInfoW64(GetCurrentProcess(), base2, &im);
ok(ret, "SymGetModuleInfoW64 failed: %lu\n", GetLastError());
ok(im.BaseOfImage == base2, "Wrong base address\n");
todo_wine_if(sizeof(void*) == 8)
ok(im.MachineType == get_module_machine("C:\\windows\\syswow64\\notepad.exe"),
"Wrong machine %lx\n", im.MachineType);
}
@ -267,12 +267,12 @@ static void test_modules(void)
"Wrong machine %lx\n", im.MachineType);
/* still can access first module after loading second */
todo_wine_if(sizeof(void*) == 8)
if (attr != INVALID_FILE_ATTRIBUTES)
{
ret = SymGetModuleInfoW64(GetCurrentProcess(), base2, &im);
ok(ret, "SymGetModuleInfoW64 failed: %lu\n", GetLastError());
ok(im.BaseOfImage == base2, "Wrong base address\n");
todo_wine_if(sizeof(void*) == 8)
ok(im.MachineType == get_module_machine("C:\\windows\\syswow64\\notepad.exe"),
"Wrong machine %lx\n", im.MachineType);
}