Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetProcessInfos() [1/2]

static unsafe ProcessInfo[] System.Diagnostics.NtProcessInfoHelper.GetProcessInfos ( int? processIdFilter = null)
inlinestaticpackage

Definition at line 13 of file NtProcessInfoHelper.cs.

14 {
15 int num = 131072;
17 try
18 {
19 while (true)
20 {
21 if (array == null)
22 {
23 array = new long[(num + 7) / 8];
24 }
25 uint requiredSize = 0u;
27 {
28 uint num2 = global::Interop.NtDll.NtQuerySystemInformation(5, systemInformation, (uint)(array.Length * 8), &requiredSize);
29 if (num2 != 3221225476u)
30 {
31 if ((int)num2 < 0)
32 {
34 }
35 return GetProcessInfos(MemoryMarshal.AsBytes<long>(array), processIdFilter);
36 }
37 }
38 array = null;
39 num = GetNewBufferSize(num, (int)requiredSize);
40 }
41 }
42 finally
43 {
45 }
46 }
static unsafe ProcessInfo[] GetProcessInfos(int? processIdFilter=null)
static int GetNewBufferSize(int existingBufferSize, int requiredSize)
static string CouldntGetProcessInfos
Definition SR.cs:46
Definition SR.cs:7
static int Exchange(ref int location1, int value)

References System.array, System.Diagnostics.NtProcessInfoHelper.CachedBuffer, System.SR.CouldntGetProcessInfos, System.Threading.Interlocked.Exchange(), System.Diagnostics.NtProcessInfoHelper.GetNewBufferSize(), and System.Diagnostics.NtProcessInfoHelper.GetProcessInfos().

Referenced by System.Diagnostics.ProcessManager.GetProcessInfo(), System.Diagnostics.NtProcessInfoHelper.GetProcessInfos(), and System.Diagnostics.ProcessManager.GetProcessInfos().