Commit 4d2cbb41 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

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: 's avatarEric Pouech <eric.pouech@gmail.com>
parent 75fd4462
......@@ -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;
......
......@@ -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);
}
......
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