public unsafe List <ProcessInfo> GetAllProcesses() { lock (sync) { var result = new List <ProcessInfo>(); NtUtility.VisitProcesses(buffer, info => FillResult(result, info)); return(result); } }
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); } }