예제 #1
0
        private string GetNextModule(IntPtr snapshot)
        {
            GetProcessModule.MODULEENTRY32 entry = GetProcessModule.MODULEENTRY32.NewEntry();
            bool returnValue = GetProcessModule.Module32NextW(snapshot, ref entry);

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