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

◆ GetProcessHandlePairs()

List<(Process Process, SafeProcessHandle Handle)> System.Diagnostics.Process.GetProcessHandlePairs ( Func< Process, Process, bool > predicate)
inlineprivate

Definition at line 2328 of file Process.cs.

2329 {
2330 List<(Process, SafeProcessHandle)> list = new List<(Process, SafeProcessHandle)>();
2331 Process[] processes = GetProcesses();
2332 foreach (Process process2 in processes)
2333 {
2335 if (!safeProcessHandle.IsInvalid)
2336 {
2337 if (predicate(this, process2))
2338 {
2340 continue;
2341 }
2342 process2.Dispose();
2343 safeProcessHandle.Dispose();
2344 }
2345 }
2346 return list;
2348 {
2349 try
2350 {
2351 return process.GetProcessHandle(4096, throwIfExited: false);
2352 }
2353 catch (Win32Exception)
2354 {
2356 }
2357 }
2358 }
static readonly SafeProcessHandle InvalidHandle
static Process[] GetProcesses()
Definition Process.cs:1089

References System.Diagnostics.Process.Process(), System.Runtime.Serialization.Dictionary, System.Diagnostics.Process.GetProcesses(), Microsoft.Win32.SafeHandles.SafeProcessHandle.InvalidHandle, and System.list.

Referenced by System.Diagnostics.Process.KillTree().