Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Diagnostics.Process Class Reference

Classes

class  ShellExecuteHelper
 

Public Member Functions

 Process ()
 
bool CloseMainWindow ()
 
bool WaitForInputIdle ()
 
bool WaitForInputIdle (int milliseconds)
 
void Close ()
 
void Refresh ()
 
bool Start ()
 
override string ToString ()
 
void WaitForExit ()
 
bool WaitForExit (int milliseconds)
 
async Task WaitForExitAsync (CancellationToken cancellationToken=default(CancellationToken))
 
void BeginOutputReadLine ()
 
void BeginErrorReadLine ()
 
void CancelOutputRead ()
 
void CancelErrorRead ()
 
void Kill ()
 
void Kill (bool entireProcessTree)
 
void Dispose ()
 
object GetLifetimeService ()
 
virtual object InitializeLifetimeService ()
 

Static Public Member Functions

static Process GetProcessById (int processId, string machineName)
 
static Process GetProcessById (int processId)
 
static Process[] GetProcessesByName (string? processName)
 
static Process[] GetProcesses ()
 
static Process[] GetProcesses (string machineName)
 
static Process GetCurrentProcess ()
 
static Process Start (string fileName)
 
static Process Start (string fileName, string arguments)
 
static Process Start (string fileName, IEnumerable< string > arguments)
 
static ? Process Start (ProcessStartInfo startInfo)
 
static Process[] GetProcessesByName (string? processName, string machineName)
 
static ? Process Start (string fileName, string userName, SecureString password, string domain)
 
static ? Process Start (string fileName, string arguments, string userName, SecureString password, string domain)
 
static void EnterDebugMode ()
 
static void LeaveDebugMode ()
 

Protected Member Functions

override void Dispose (bool disposing)
 
void OnExited ()
 
virtual ? object GetService (Type service)
 
MarshalByRefObject MemberwiseClone (bool cloneIdentity)
 

Package Functions

void OutputReadNotifyUser (string data)
 
void ErrorReadNotifyUser (string data)
 

Package Attributes

AsyncStreamReader _output
 
AsyncStreamReader _error
 
bool _pendingOutputRead
 
bool _pendingErrorRead
 

Properties

SafeProcessHandle SafeHandle [get]
 
IntPtr Handle [get]
 
bool Associated [get]
 
int BasePriority [get]
 
int ExitCode [get]
 
bool HasExited [get]
 
DateTime StartTime [get]
 
DateTime ExitTime [get]
 
int Id [get]
 
string MachineName [get]
 
IntPtr MaxWorkingSet [get, set]
 
IntPtr MinWorkingSet [get, set]
 
ProcessModuleCollection Modules [get]
 
long NonpagedSystemMemorySize64 [get]
 
int NonpagedSystemMemorySize [get]
 
long PagedMemorySize64 [get]
 
int PagedMemorySize [get]
 
long PagedSystemMemorySize64 [get]
 
int PagedSystemMemorySize [get]
 
long PeakPagedMemorySize64 [get]
 
int PeakPagedMemorySize [get]
 
long PeakWorkingSet64 [get]
 
int PeakWorkingSet [get]
 
long PeakVirtualMemorySize64 [get]
 
int PeakVirtualMemorySize [get]
 
bool PriorityBoostEnabled [get, set]
 
ProcessPriorityClass PriorityClass [get, set]
 
long PrivateMemorySize64 [get]
 
int PrivateMemorySize [get]
 
string ProcessName [get]
 
IntPtr ProcessorAffinity [get, set]
 
int SessionId [get]
 
ProcessStartInfo StartInfo [get, set]
 
ProcessThreadCollection Threads [get]
 
int HandleCount [get]
 
long VirtualMemorySize64 [get]
 
int VirtualMemorySize [get]
 
bool EnableRaisingEvents [get, set]
 
StreamWriter StandardInput [get]
 
StreamReader StandardOutput [get]
 
StreamReader StandardError [get]
 
long WorkingSet64 [get]
 
int WorkingSet [get]
 
ISynchronizeInvokeSynchronizingObject [get, set]
 
ProcessModuleMainModule [get]
 
DateTime ExitTimeCore [get]
 
TimeSpan PrivilegedProcessorTime [get]
 
DateTime StartTimeCore [get]
 
TimeSpan TotalProcessorTime [get]
 
TimeSpan UserProcessorTime [get]
 
bool PriorityBoostEnabledCore [get, set]
 
ProcessPriorityClass PriorityClassCore [get, set]
 
IntPtr ProcessorAffinityCore [get, set]
 
IntPtr MainWindowHandle [get]
 
string MainWindowTitle [get]
 
bool Responding [get]
 
unsafe int ParentProcessId [get]
 
EventHandler Exited
 
virtual bool CanRaiseEvents [get]
 
bool CanRaiseEventsInternal [get]
 
EventHandlerList Events [get]
 
virtual ? ISite Site [get, set]
 
IContainer? Container [get]
 
bool DesignMode [get]
 
EventHandlerDisposed
 

Events

DataReceivedEventHandlerOutputDataReceived
 
DataReceivedEventHandlerErrorDataReceived
 

Private Types

enum  StreamReadMode { Undefined , SyncMode , AsyncMode }
 
enum  State {
  HaveId = 1 , IsLocal = 2 , HaveNonExitedId = 5 , HaveProcessInfo = 8 ,
  Exited = 16 , Associated = 32
}
 

Private Member Functions

 Process (string machineName, bool isRemoteMachine, int processId, ProcessInfo processInfo)
 
void CompletionCallback (object waitHandleContext, bool wasSignaled)
 
void EnsureState (State state)
 
void EnsureWorkingSetLimits ()
 
void SetWorkingSetLimits (IntPtr? min, IntPtr? max)
 
void RaiseOnExited ()
 
SafeProcessHandle GetOrOpenProcessHandle ()
 
void SetProcessHandle (SafeProcessHandle processHandle)
 
void SetProcessId (int processId)
 
void StopWatchingForExit ()
 
void CheckDisposed ()
 
void RefreshCore ()
 
void CloseCore ()
 
void EnsureWatchingForExit ()
 
bool WaitForExitCore (int milliseconds)
 
void UpdateHasExited ()
 
SafeProcessHandle GetProcessHandle ()
 
void GetWorkingSetLimits (out IntPtr minWorkingSet, out IntPtr maxWorkingSet)
 
void SetWorkingSetLimitsCore (IntPtr? newMin, IntPtr? newMax, out IntPtr resultingMin, out IntPtr resultingMax)
 
unsafe bool StartWithCreateProcess (ProcessStartInfo startInfo)
 
ProcessThreadTimes GetProcessTimes ()
 
SafeProcessHandle GetProcessHandle (int access, bool throwIfExited=true)
 
void CreatePipe (out SafeFileHandle parentHandle, out SafeFileHandle childHandle, bool parentInputs)
 
bool StartCore (ProcessStartInfo startInfo)
 
unsafe bool StartWithShellExecuteEx (ProcessStartInfo startInfo)
 
int GetShellError (IntPtr error)
 
unsafe string GetMainWindowTitle ()
 
bool CloseMainWindowCore ()
 
bool IsRespondingCore ()
 
bool WaitForInputIdleCore (int milliseconds)
 
bool IsParentOf (Process possibleChild)
 
bool Equals (Process process)
 
List< ExceptionKillTree ()
 
List< ExceptionKillTree (SafeProcessHandle handle)
 
List<(Process Process, SafeProcessHandle Handle)> GetProcessHandlePairs (Func< Process, Process, bool > predicate)
 
bool IsSelfOrDescendantOf (Process processOfInterest)
 
IReadOnlyList< ProcessGetChildProcesses (Process[] processes=null)
 

Static Private Member Functions

static Win32Exception CreateExceptionForErrorStartingProcess (string errorMessage, int errorCode, string fileName, string workingDirectory)
 
static Encoding GetEncoding (int codePage)
 
static void BuildCommandLine (ProcessStartInfo startInfo, ref System.Text.ValueStringBuilder commandLine)
 
static unsafe void SetPrivilege (string privilegeName, int attrib)
 
static void CreatePipeWithSecurityAttributes (out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe, ref global::Interop.Kernel32.SECURITY_ATTRIBUTES lpPipeAttributes, int nSize)
 
static string GetEnvironmentVariablesBlock (IDictionary< string, string > sd)
 
static string GetErrorMessage (int error)
 
static bool IsProcessInvalidException (Exception e)
 

Private Attributes

bool _haveProcessId
 
int _processId
 
bool _haveProcessHandle
 
SafeProcessHandle _processHandle
 
bool _isRemoteMachine
 
string _machineName
 
ProcessInfo _processInfo
 
ProcessThreadCollection _threads
 
ProcessModuleCollection _modules
 
bool _haveWorkingSetLimits
 
IntPtr _minWorkingSet
 
IntPtr _maxWorkingSet
 
bool _haveProcessorAffinity
 
IntPtr _processorAffinity
 
bool _havePriorityClass
 
ProcessPriorityClass _priorityClass
 
ProcessStartInfo _startInfo
 
bool _watchForExit
 
bool _watchingForExit
 
EventHandler _onExited
 
bool _exited
 
int _exitCode
 
DateTime_startTime
 
DateTime _exitTime
 
bool _haveExitTime
 
bool _priorityBoostEnabled
 
bool _havePriorityBoostEnabled
 
bool _raisedOnExited
 
RegisteredWaitHandle _registeredWaitHandle
 
WaitHandle _waitHandle
 
StreamReader _standardOutput
 
StreamWriter _standardInput
 
StreamReader _standardError
 
bool _disposed
 
bool _standardInputAccessed
 
StreamReadMode _outputStreamReadMode
 
StreamReadMode _errorStreamReadMode
 
bool _signaled
 
bool _haveMainWindow
 
IntPtr _mainWindowHandle
 
string _mainWindowTitle
 
bool _haveResponding
 
bool _responding
 
ISite _site
 
EventHandlerList _events
 

Static Private Attributes

static int s_cachedSerializationSwitch
 
static readonly object s_createProcessLock = new object()
 
static readonly object s_eventDisposed = new object()
 

Detailed Description

Definition at line 17 of file Process.cs.


The documentation for this class was generated from the following file: