42 ValueId.PoolPagedBytes
45 "Pool Nonpaged Bytes",
46 ValueId.PoolNonpagedBytes
54 ValueId.VirtualBytesPeak
69 "Page File Bytes Peak",
70 ValueId.PageFileBytesPeak
74 ValueId.WorkingSetPeak
94 ValueId.CurrentPriority
102 ValueId.PrivilegedTime
113 "Thread Wait Reason",
114 ValueId.ThreadWaitReason
133 int[]
array =
new int[256];
137 int num = array.Length * 4;
138 if (!global::Interop.Kernel32.EnumProcesses(
array, num,
out needed))
146 array =
new int[array.Length * 2];
170 return global::Interop.Kernel32.GetProcessId(processHandle);
219 ref readonly global::Interop.Advapi32.PERF_DATA_BLOCK
reference =
ref MemoryMarshal.AsRef<global::Interop.Advapi32.PERF_DATA_BLOCK>(data);
221 for (
int i = 0; i <
reference.NumObjectTypes; i++)
223 ref readonly global::Interop.Advapi32.PERF_OBJECT_TYPE
reference2 =
ref MemoryMarshal.AsRef<global::Interop.Advapi32.PERF_OBJECT_TYPE>(data.Slice(num));
224 global::Interop.Advapi32.PERF_COUNTER_DEFINITION[]
array =
new global::Interop.Advapi32.PERF_COUNTER_DEFINITION[
reference2.NumCounters];
228 ref readonly global::Interop.Advapi32.PERF_COUNTER_DEFINITION
reference3 =
ref MemoryMarshal.AsRef<global::Interop.Advapi32.PERF_COUNTER_DEFINITION>(data.Slice(
num2));
244 ref readonly global::Interop.Advapi32.PERF_INSTANCE_DEFINITION
reference4 =
ref MemoryMarshal.AsRef<global::Interop.Advapi32.PERF_INSTANCE_DEFINITION>(data.Slice(
num3));
253 if (
span.Length == 15)
268 processInfo.ProcessName =
span.ToString();
282 num3 +=
MemoryMarshal.AsRef<global::Interop.Advapi32.PERF_COUNTER_BLOCK>(data.Slice(
num3)).ByteLength;
302 for (
int i = 0; i <
counters.Length; i++)
309 threadInfo._processId = (int)num;
312 threadInfo._threadId = (ulong)num;
315 threadInfo._basePriority = (int)num;
318 threadInfo._currentPriority = (int)num;
321 threadInfo._startAddress = (
IntPtr)num;
379 for (
int i = 0; i <
counters.Length; i++)
386 processInfo.ProcessId = (int)num;
389 processInfo.PoolPagedBytes = num;
391 case ValueId.PoolNonpagedBytes:
392 processInfo.PoolNonPagedBytes = num;
395 processInfo.VirtualBytes = num;
398 processInfo.VirtualBytesPeak = num;
401 processInfo.WorkingSetPeak = num;
404 processInfo.WorkingSet = num;
406 case ValueId.PageFileBytesPeak:
407 processInfo.PageFileBytesPeak = num;
410 processInfo.PageFileBytes = num;
413 processInfo.PrivateBytes = num;
416 processInfo.BasePriority = (int)num;
419 processInfo.HandleCount = (int)num;
456 if (!global::Interop.Kernel32.IsWow64Process(global::Interop.Kernel32.GetCurrentProcess(),
out var Wow64Process))
502 BaseAddress = ntModuleInfo.BaseOfDll
531 if (
span.StartsWith(
"\\\\?\\"))
533 span =
span.Slice(
"\\\\?\\".Length);
535 processModule.FileName =
span.ToString();
559 if (global::Interop.Kernel32.EnumProcessModules(processHandle,
modules, size,
out needed))
static readonly SafeProcessHandle InvalidHandle
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
void Add(TKey key, TValue value)
static ProcessInfo[] GetProcessInfos(PerformanceCounterLib library)
static long ReadCounterValue(int counterType, ReadOnlySpan< byte > data)
static ProcessModule GetFirstModule(int processId)
static ProcessInfo[] GetProcessInfos(string machineName, bool isRemoteMachine)
static ThreadInfo GetThreadInfo(ReadOnlySpan< byte > instanceData, global::Interop.Advapi32.PERF_COUNTER_DEFINITION[] counters)
static int[] GetProcessIds()
static ProcessInfo[] GetProcessInfos(PerformanceCounterLib library, int processIndex, int threadIndex, ReadOnlySpan< byte > data)
static ThreadWaitReason GetThreadWaitReason(int value)
static readonly Dictionary< string, ValueId > s_valueIds
static ProcessInfo GetProcessInfo(ReadOnlySpan< byte > instanceData, global::Interop.Advapi32.PERF_COUNTER_DEFINITION[] counters)
static void EnumProcessModulesUntilSuccess(SafeProcessHandle processHandle, IntPtr[] modules, int size, out int needed)
static ProcessModuleCollection GetModules(int processId, bool firstModuleOnly)
static int[] GetProcessIds(string machineName, bool isRemoteMachine)
static ValueId GetValueId(string counterName)
static int GetProcessIdFromHandle(SafeProcessHandle processHandle)
static ProcessModuleCollection GetModules(int processId)
static void HandleLastWin32Error()
static int SystemProcessID
static SafeProcessHandle OpenProcess(int processId, int access, bool throwIfExited)
static bool Equals(this ReadOnlySpan< char > span, ReadOnlySpan< char > other, StringComparison comparisonType)
static int GetLastWin32Error()
static string EnumProcessModuleFailedDueToWow
static string CouldntGetProcessInfos
static string ProcessDisabled
static string CouldntConnectToRemoteMachine
static string EnumProcessModuleFailed
static void Sleep(int millisecondsTimeout)