Commit c66e8760 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

kernelbase: Let GetModuleFileNameEx succeed on 64bit modules in wow64.

parent 07efff4e
......@@ -1409,7 +1409,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetModuleFileNameExA( HANDLE process, HMODULE mod
DWORD WINAPI DECLSPEC_HOTPATCH GetModuleFileNameExW( HANDLE process, HMODULE module,
WCHAR *name, DWORD size )
{
BOOL wow64;
BOOL wow64, found = FALSE;
DWORD len;
if (!size) return 0;
......@@ -1420,13 +1420,15 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetModuleFileNameExW( HANDLE process, HMODULE mod
{
LDR_DATA_TABLE_ENTRY32 ldr_module32;
if (!get_ldr_module32( process, module, &ldr_module32 )) return 0;
len = ldr_module32.FullDllName.Length / sizeof(WCHAR);
if (!ReadProcessMemory( process, (void *)(DWORD_PTR)ldr_module32.FullDllName.Buffer,
name, min( len, size ) * sizeof(WCHAR), NULL ))
return 0;
if (get_ldr_module32( process, module, &ldr_module32 ))
{
len = ldr_module32.FullDllName.Length / sizeof(WCHAR);
if (ReadProcessMemory( process, (void *)(DWORD_PTR)ldr_module32.FullDllName.Buffer,
name, min( len, size ) * sizeof(WCHAR), NULL ))
found = TRUE;
}
}
else
if (!found)
{
LDR_DATA_TABLE_ENTRY ldr_module;
......
......@@ -243,7 +243,6 @@ static BOOL test_EnumProcessModulesEx_snapshot(HANDLE proc, struct moduleex_snap
ret = GetModuleBaseNameA(proc, mxsnap[i].modules[j], buffer, sizeof(buffer));
ok(ret, "GetModuleBaseName failed: %lu (%u/%lu=%p)\n", GetLastError(), j, mxsnap[i].num_modules, mxsnap[i].modules[j]);
ret = GetModuleFileNameExA(proc, mxsnap[i].modules[j], buffer, sizeof(buffer));
todo_wine_if(fail)
ok(ret, "GetModuleFileNameEx failed: %lu (%u/%lu=%p)\n", GetLastError(), j, mxsnap[i].num_modules, mxsnap[i].modules[j]);
memset(&info, 0, sizeof(info));
ret = GetModuleInformation(proc, mxsnap[i].modules[j], &info, sizeof(info));
......
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