Public feed #601055

hmod gathering

public c v1 · immutable
Raw Edit
·published 2007-07-03 08:11 UTC
rendered paste body
//Enter your process ID and the module name ( DLL NAME ) to search for. Returns the HMODULE for itHMODULE WINAPI getm0dules(DWORD pedi,TCHAR *hmodname){    MODULEENTRY32 me;    me.dwSize=sizeof(MODULEENTRY32);    HANDLE snap=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,pedi);    Module32First(snap,&me);    if(lstrcmpi(me.szModule,hmodname)==0)       return me.hModule;    while(GetLastError()!=ERROR_NO_MORE_FILES)    {        Module32Next(snap,&me);        if(lstrcmpi(me.szModule,hmodname)==0)           return me.hModule;    }    HMODULE failure=NULL;    return failure;}