@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The Module32First API !!!!C# Signature: [DllImport("kernel32.dll")] static extern bool Module32First(IntPtr hSnapshot, ref MODULEENTRY32 lpme); !!!!User-Defined Types: See struct [MODULEENTRY32] !!!!Notes: None. !!!!Tips & Tricks: http://pastebin.com/BzD1jdmH !!!!Sample Code: For example: ---------------- int procIDDDDDDDDDDDDD = Process.GetCurrentProcess().Id; ---------------- static void EnumProcessModules(int procIDDDDDDDDDDDDD) {//http://pastebin.com/BzD1jdmH var snapshot = CreateToolhelp32Snapshot(SnapshotFlags.Module | SnapshotFlags.Module32, (uint)procIDDDDDDDDDDDDD); MODULEENTRY32 mod = new MODULEENTRY32() { dwSize = (uint)Marshal.SizeOf(typeof(MODULEENTRY32)) }; if (!Module32First(snapshot, ref mod)) return; List<string> modules = new List<string>(); do { modules.Add(mod.szModule); } while (Module32Next(snapshot, ref mod)); Console.WriteLine("OK"); } !!!!Alternative Managed API: System.Diagnostics.Process class contains many module, process, and thread methods. For example: using System.Diagnostics; ... private void DumpModuleInfo(IntPtr hProcess) { uint pid = Process.GetProcessById(hProcess).Id; foreach (Process proc in Process.GetProcesses()) { if (proc.Id == pid) { foreach (ProcessModule pm in proc.Modules) { Console.WriteLine("{0:X8} {1:X8} {2:X8} {3}", (int)pm.BaseAddress, (int)pm.EntryPointAddress, (int)pm.BaseAddress + pm.ModuleMemorySize, pm.ModuleName); } } } } Documentation: Module32First@msdn on MSDN
Edit kernel32.Module32...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.