I already asked how to enum 32bit process modules from a 64bit process here. And the answer was EnumProcessModulesEx. All works fine on Windows 7 x64, but what about Windows XP x64? It seems that this api is supported on Vista and up. So what's the way to do it there?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
CreateToolHelp32Snapshot will do it.
回答2:
Probably something like this. Wrote it in notepad so might be wrong. But you get the idea.
HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID );
MODULEENTRY32 me32 = {0};
me32.dwSize = sizeof(MODULEENTRY32);
Module32First( hSnapshot, &me32 );
do {
...
} while( Module32Next( hSnapshot, &me32 ) );
CloseHandle( hSnapshot );