Skip to content

Commit

Permalink
plugins: allow getModuleAddr() to enumerate 32-bit modules in WoW64 m…
Browse files Browse the repository at this point in the history
…ode.

Include TH32CS_SNAPMODULE32 in call to CreateToolhelp32Snapshot.

This fixes module enumeration in getModuleAddr().

Without this flag, if called from a WoW64 process, we'll only see the
64-bit DLLs of the process (i.e., WoW64 specific DLLs) such as:

  ntdll.dll
  wow64.dll
  wow64win.dll
  wow64cpu.dll

and nothing else.

With this flag, we get everything.

Fixes #2437
  • Loading branch information
mkrautz committed Jul 18, 2016
1 parent af38fdb commit bb72d91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/mumble_plugin_win32_ptr_type.h
Expand Up @@ -51,7 +51,7 @@ static inline PTR_TYPE_CONCRETE getModuleAddr(DWORD pid, const wchar_t *modname)
MODULEENTRY32 me;
PTR_TYPE_CONCRETE addr = NULL;
me.dwSize = sizeof(me);
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE|TH32CS_SNAPMODULE32, pid);
if (hSnap != INVALID_HANDLE_VALUE) {
BOOL ok = Module32First(hSnap, &me);

Expand Down

0 comments on commit bb72d91

Please sign in to comment.