Пример #1
0
 public unsafe List <ProcessInfo> GetAllProcesses()
 {
     lock (sync)
     {
         var result = new List <ProcessInfo>();
         NtUtility.VisitProcesses(buffer, info => FillResult(result, info));
         return(result);
     }
 }
Пример #2
0
 private unsafe Dictionary <int, int> BuildCache()
 {
     lock (sync)
     {
         var cache = new Dictionary <int, int>();
         NtUtility.VisitProcesses(cachedBuffer, info =>
         {
             cache[(int)info->UniqueProcessId] = (int)info->NumberOfThreads;
         });
         return(cache);
     }
 }