private string GetNextModule(IntPtr snapshot) { GetProcessModule.MODULEENTRY32 entry = GetProcessModule.MODULEENTRY32.NewEntry(); bool returnValue = GetProcessModule.Module32NextW(snapshot, ref entry); return(this.AnalyzeModuleResult(returnValue, entry)); }
private string AnalyzeModuleResult(bool returnValue, GetProcessModule.MODULEENTRY32 entry) { if (returnValue) { return(entry.Path); } if (Marshal.GetLastWin32Error() != 18) { throw new Win32Exception(); } return(null); }
public static GetProcessModule.MODULEENTRY32 NewEntry() { GetProcessModule.MODULEENTRY32 result = default(GetProcessModule.MODULEENTRY32); if (IntPtr.Size == 4) { result.dwSize = 1064; } else { result.dwSize = 1080; } return(result); }
private static extern bool Module32NextW(IntPtr snapshot, [In][Out] ref GetProcessModule.MODULEENTRY32 entry);