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

dbghelp: Make the module enumeration process compatible with 64bit platforms.

parent 8fe8a100
...@@ -211,16 +211,16 @@ BOOL WINAPI SymGetSearchPath(HANDLE hProcess, PSTR szSearchPath, ...@@ -211,16 +211,16 @@ BOOL WINAPI SymGetSearchPath(HANDLE hProcess, PSTR szSearchPath,
* SymInitialize helper: loads in dbghelp all known (and loaded modules) * SymInitialize helper: loads in dbghelp all known (and loaded modules)
* this assumes that hProcess is a handle on a valid process * this assumes that hProcess is a handle on a valid process
*/ */
static BOOL WINAPI process_invade_cb(PCSTR name, ULONG base, ULONG size, PVOID user) static BOOL WINAPI process_invade_cb(PCWSTR name, ULONG64 base, ULONG size, PVOID user)
{ {
char tmp[MAX_PATH]; WCHAR tmp[MAX_PATH];
HANDLE hProcess = user; HANDLE hProcess = user;
if (!GetModuleFileNameExA(hProcess, (HMODULE)base, if (!GetModuleFileNameExW(hProcess, (HMODULE)(DWORD_PTR)base,
tmp, sizeof(tmp))) tmp, sizeof(tmp) / sizeof(WCHAR)))
lstrcpynA(tmp, name, sizeof(tmp)); lstrcpynW(tmp, name, sizeof(tmp) / sizeof(WCHAR));
SymLoadModule(hProcess, 0, tmp, name, base, size); SymLoadModuleExW(hProcess, 0, tmp, name, base, size, NULL, 0);
return TRUE; return TRUE;
} }
...@@ -326,7 +326,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP ...@@ -326,7 +326,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP
if (check_live_target(pcs)) if (check_live_target(pcs))
{ {
if (fInvadeProcess) if (fInvadeProcess)
EnumerateLoadedModules(hProcess, process_invade_cb, hProcess); EnumerateLoadedModulesW64(hProcess, process_invade_cb, hProcess);
elf_synchronize_module_list(pcs); elf_synchronize_module_list(pcs);
macho_synchronize_module_list(pcs); macho_synchronize_module_list(pcs);
} }
......
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