dbghelp: Implemented 64 bit versions of EnumerateLoadedModules.

This commit is contained in:
Eric Pouech 2007-01-02 14:24:10 +01:00 committed by Alexandre Julliard
parent b2557f25d9
commit 883732281e
3 changed files with 71 additions and 7 deletions

View file

@ -3,8 +3,8 @@
@ stdcall EnumDirTree(long str str ptr ptr ptr)
@ stub EnumDirTreeW
@ stdcall EnumerateLoadedModules(long ptr ptr)
@ stub EnumerateLoadedModules64
@ stub EnumerateLoadedModulesW64
@ stdcall EnumerateLoadedModules64(long ptr ptr)
@ stdcall EnumerateLoadedModulesW64(long ptr ptr)
@ stdcall ExtensionApiVersion()
@ stdcall FindDebugInfoFile(str str ptr)
@ stdcall FindDebugInfoFileEx(str str ptr ptr ptr)

View file

@ -620,12 +620,12 @@ BOOL WINAPI SymEnumerateModules64(HANDLE hProcess,
}
/******************************************************************
* EnumerateLoadedModules (DBGHELP.@)
* EnumerateLoadedModules64 (DBGHELP.@)
*
*/
BOOL WINAPI EnumerateLoadedModules(HANDLE hProcess,
PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
PVOID UserContext)
BOOL WINAPI EnumerateLoadedModules64(HANDLE hProcess,
PENUMLOADED_MODULES_CALLBACK64 EnumLoadedModulesCallback,
PVOID UserContext)
{
HMODULE* hMods;
char base[256], mod[256];
@ -649,7 +649,7 @@ BOOL WINAPI EnumerateLoadedModules(HANDLE hProcess,
!GetModuleBaseNameA(hProcess, hMods[i], base, sizeof(base)))
continue;
module_fill_module(base, mod, sizeof(mod));
EnumLoadedModulesCallback(mod, (DWORD)mi.lpBaseOfDll, mi.SizeOfImage,
EnumLoadedModulesCallback(mod, (DWORD_PTR)mi.lpBaseOfDll, mi.SizeOfImage,
UserContext);
}
HeapFree(GetProcessHeap(), 0, hMods);
@ -657,6 +657,68 @@ BOOL WINAPI EnumerateLoadedModules(HANDLE hProcess,
return sz != 0 && i == sz;
}
/******************************************************************
* EnumerateLoadedModules (DBGHELP.@)
*
*/
struct enum_load_mod64_32
{
PENUMLOADED_MODULES_CALLBACK cb;
PVOID user;
};
static BOOL CALLBACK enum_load_mod64_32(PSTR name, DWORD64 base, ULONG size,
PVOID user)
{
struct enum_load_mod64_32* x = user;
return x->cb(name, (DWORD)base, size, x->user);
}
BOOL WINAPI EnumerateLoadedModules(HANDLE hProcess,
PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
PVOID UserContext)
{
struct enum_load_mod64_32 x;
x.cb = EnumLoadedModulesCallback;
x.user = UserContext;
return EnumerateLoadedModules64(hProcess, enum_load_mod64_32, &x);
}
/******************************************************************
* EnumerateLoadedModulesW64 (DBGHELP.@)
*
*/
struct enum_load_mod64_W64
{
PENUMLOADED_MODULES_CALLBACKW64 cb;
PVOID user;
WCHAR module[MAX_PATH];
};
static BOOL CALLBACK enum_load_mod64_W64(PSTR name, DWORD64 base, ULONG size,
PVOID user)
{
struct enum_load_mod64_W64* x = user;
MultiByteToWideChar(CP_ACP, 0, name, -1,
x->module, sizeof(x->module) / sizeof(WCHAR));
return x->cb(x->module, base, size, x->user);
}
BOOL WINAPI EnumerateLoadedModulesW64(HANDLE hProcess,
PENUMLOADED_MODULES_CALLBACKW64 EnumLoadedModulesCallback,
PVOID UserContext)
{
struct enum_load_mod64_W64 x;
x.cb = EnumLoadedModulesCallback;
x.user = UserContext;
return EnumerateLoadedModules64(hProcess, enum_load_mod64_W64, &x);
}
/******************************************************************
* SymGetModuleInfo (DBGHELP.@)
*

View file

@ -758,6 +758,8 @@ typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR, ULONG, ULONG, PVOID)
BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PSTR, DWORD64, ULONG, PVOID);
BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PWSTR, DWORD64, ULONG, PVOID);
BOOL WINAPI EnumerateLoadedModulesW64(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR, ULONG, PVOID);
BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PSTR, DWORD64, PVOID);