scripts
This commit is contained in:
@@ -0,0 +1,2496 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Diagnostics
|
||||
{
|
||||
/// <summary>Provides access to local and remote processes and enables you to start and stop local system processes.</summary>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x020000E5 RID: 229
|
||||
[global::System.ComponentModel.Designer("System.Diagnostics.Design.ProcessDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
|
||||
[global::System.ComponentModel.DefaultEvent("Exited")]
|
||||
[global::System.ComponentModel.DefaultProperty("StartInfo")]
|
||||
[MonitoringDescription("Represents a system process")]
|
||||
public class Process : global::System.ComponentModel.Component
|
||||
{
|
||||
// Token: 0x060007B2 RID: 1970 RVA: 0x000148D8 File Offset: 0x00012AD8
|
||||
private Process(IntPtr handle, int id)
|
||||
{
|
||||
this.process_handle = handle;
|
||||
this.pid = id;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Diagnostics.Process" /> class.</summary>
|
||||
// Token: 0x060007B3 RID: 1971 RVA: 0x000148F0 File Offset: 0x00012AF0
|
||||
public Process()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Occurs when an application writes to its redirected <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream.</summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x1400001A RID: 26
|
||||
// (add) Token: 0x060007B4 RID: 1972 RVA: 0x000148F8 File Offset: 0x00012AF8
|
||||
// (remove) Token: 0x060007B5 RID: 1973 RVA: 0x00014914 File Offset: 0x00012B14
|
||||
[global::System.ComponentModel.Browsable(true)]
|
||||
[MonitoringDescription("Raised when it receives output data")]
|
||||
public event DataReceivedEventHandler OutputDataReceived;
|
||||
|
||||
/// <summary>Occurs when an application writes to its redirected <see cref="P:System.Diagnostics.Process.StandardError" /> stream.</summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x1400001B RID: 27
|
||||
// (add) Token: 0x060007B6 RID: 1974 RVA: 0x00014930 File Offset: 0x00012B30
|
||||
// (remove) Token: 0x060007B7 RID: 1975 RVA: 0x0001494C File Offset: 0x00012B4C
|
||||
[global::System.ComponentModel.Browsable(true)]
|
||||
[MonitoringDescription("Raised when it receives error data")]
|
||||
public event DataReceivedEventHandler ErrorDataReceived;
|
||||
|
||||
/// <summary>Occurs when a process exits.</summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x1400001C RID: 28
|
||||
// (add) Token: 0x060007B8 RID: 1976 RVA: 0x00014968 File Offset: 0x00012B68
|
||||
// (remove) Token: 0x060007B9 RID: 1977 RVA: 0x000149D0 File Offset: 0x00012BD0
|
||||
[global::System.ComponentModel.Category("Behavior")]
|
||||
[MonitoringDescription("Raised when this process exits.")]
|
||||
public event EventHandler Exited
|
||||
{
|
||||
add
|
||||
{
|
||||
if (this.process_handle != IntPtr.Zero && this.HasExited)
|
||||
{
|
||||
value.BeginInvoke(null, null, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.exited_event = (EventHandler)Delegate.Combine(this.exited_event, value);
|
||||
if (this.exited_event != null)
|
||||
{
|
||||
this.StartExitCallbackIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
remove
|
||||
{
|
||||
this.exited_event = (EventHandler)Delegate.Remove(this.exited_event, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the base priority of the associated process.</summary>
|
||||
/// <returns>The base priority, which is computed from the <see cref="P:System.Diagnostics.Process.PriorityClass" /> of the associated process.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> property to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process has exited.-or- The process has not started, so there is no process ID. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001E4 RID: 484
|
||||
// (get) Token: 0x060007BA RID: 1978 RVA: 0x000149EC File Offset: 0x00012BEC
|
||||
[MonitoringDescription("Base process priority.")]
|
||||
[global::System.MonoTODO]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int BasePriority
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007BB RID: 1979 RVA: 0x000149F0 File Offset: 0x00012BF0
|
||||
private void StartExitCallbackIfNeeded()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets whether the <see cref="E:System.Diagnostics.Process.Exited" /> event should be raised when the process terminates.</summary>
|
||||
/// <returns>true if the <see cref="E:System.Diagnostics.Process.Exited" /> event should be raised when the associated process is terminated (through either an exit or a call to <see cref="M:System.Diagnostics.Process.Kill" />); otherwise, false. The default is false.</returns>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001E5 RID: 485
|
||||
// (get) Token: 0x060007BC RID: 1980 RVA: 0x000149F4 File Offset: 0x00012BF4
|
||||
// (set) Token: 0x060007BD RID: 1981 RVA: 0x000149FC File Offset: 0x00012BFC
|
||||
[MonitoringDescription("Check for exiting of the process to raise the apropriate event.")]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[global::System.ComponentModel.DefaultValue(false)]
|
||||
public bool EnableRaisingEvents
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.enableRaisingEvents;
|
||||
}
|
||||
set
|
||||
{
|
||||
bool flag = this.enableRaisingEvents;
|
||||
this.enableRaisingEvents = value;
|
||||
if (this.enableRaisingEvents && !flag)
|
||||
{
|
||||
this.StartExitCallbackIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007BE RID: 1982
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int ExitCode_internal(IntPtr handle);
|
||||
|
||||
/// <summary>Gets the value that the associated process specified when it terminated.</summary>
|
||||
/// <returns>The code that the associated process specified when it terminated.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process has not exited.-or- The process <see cref="P:System.Diagnostics.Process.Handle" /> is not valid. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.ExitCode" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001E6 RID: 486
|
||||
// (get) Token: 0x060007BF RID: 1983 RVA: 0x00014A30 File Offset: 0x00012C30
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The exit code of the process.")]
|
||||
public int ExitCode
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("Process has not been started.");
|
||||
}
|
||||
int num = Process.ExitCode_internal(this.process_handle);
|
||||
if (num == 259)
|
||||
{
|
||||
throw new InvalidOperationException("The process must exit before getting the requested information.");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007C0 RID: 1984
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern long ExitTime_internal(IntPtr handle);
|
||||
|
||||
/// <summary>Gets the time that the associated process exited.</summary>
|
||||
/// <returns>A <see cref="T:System.DateTime" /> that indicates when the associated process was terminated.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.ExitTime" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001E7 RID: 487
|
||||
// (get) Token: 0x060007C1 RID: 1985 RVA: 0x00014A80 File Offset: 0x00012C80
|
||||
[MonitoringDescription("The exit time of the process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
public DateTime ExitTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("Process has not been started.");
|
||||
}
|
||||
if (!this.HasExited)
|
||||
{
|
||||
throw new InvalidOperationException("The process must exit before getting the requested information.");
|
||||
}
|
||||
return DateTime.FromFileTime(Process.ExitTime_internal(this.process_handle));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the native handle of the associated process.</summary>
|
||||
/// <returns>The handle that the operating system assigned to the associated process when the process was started. The system uses this handle to keep track of process attributes.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process has not been started. The <see cref="P:System.Diagnostics.Process.Handle" /> property cannot be read because there is no process associated with this <see cref="T:System.Diagnostics.Process" /> instance.-or- The <see cref="T:System.Diagnostics.Process" /> instance has been attached to a running process but you do not have the necessary permissions to get a handle with full access rights. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.Handle" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001E8 RID: 488
|
||||
// (get) Token: 0x060007C2 RID: 1986 RVA: 0x00014AD4 File Offset: 0x00012CD4
|
||||
[MonitoringDescription("Handle for this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
public IntPtr Handle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.process_handle;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of handles opened by the process.</summary>
|
||||
/// <returns>The number of operating system handles the process has opened.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> property to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001E9 RID: 489
|
||||
// (get) Token: 0x060007C3 RID: 1987 RVA: 0x00014ADC File Offset: 0x00012CDC
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoTODO]
|
||||
[MonitoringDescription("Handles for this process.")]
|
||||
public int HandleCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the associated process has been terminated.</summary>
|
||||
/// <returns>true if the operating system process referenced by the <see cref="T:System.Diagnostics.Process" /> component has terminated; otherwise, false.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">There is no process associated with the object. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">The exit code for the process could not be retrieved. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.HasExited" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001EA RID: 490
|
||||
// (get) Token: 0x060007C4 RID: 1988 RVA: 0x00014AE0 File Offset: 0x00012CE0
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("Determines if the process is still running.")]
|
||||
public bool HasExited
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("Process has not been started.");
|
||||
}
|
||||
int num = Process.ExitCode_internal(this.process_handle);
|
||||
return num != 259;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the unique identifier for the associated process.</summary>
|
||||
/// <returns>The system-generated unique identifier of the process that is referenced by this <see cref="T:System.Diagnostics.Process" /> instance.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process's <see cref="P:System.Diagnostics.Process.Id" /> property has not been set.-or- There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> property to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001EB RID: 491
|
||||
// (get) Token: 0x060007C5 RID: 1989 RVA: 0x00014B28 File Offset: 0x00012D28
|
||||
[MonitoringDescription("Process identifier.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int Id
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.pid == 0)
|
||||
{
|
||||
throw new InvalidOperationException("Process ID has not been set.");
|
||||
}
|
||||
return this.pid;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the name of the computer the associated process is running on.</summary>
|
||||
/// <returns>The name of the computer that the associated process is running on.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001EC RID: 492
|
||||
// (get) Token: 0x060007C6 RID: 1990 RVA: 0x00014B48 File Offset: 0x00012D48
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoTODO]
|
||||
[MonitoringDescription("The name of the computer running the process.")]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
public string MachineName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "localhost";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the main module for the associated process.</summary>
|
||||
/// <returns>The <see cref="T:System.Diagnostics.ProcessModule" /> that was used to start the process.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.MainModule" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> is not available.-or- The process has exited. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001ED RID: 493
|
||||
// (get) Token: 0x060007C7 RID: 1991 RVA: 0x00014B50 File Offset: 0x00012D50
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[MonitoringDescription("The main module of the process.")]
|
||||
public ProcessModule MainModule
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Modules[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the window handle of the main window of the associated process.</summary>
|
||||
/// <returns>The system-generated window handle of the main window of the associated process.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.MainWindowHandle" /> is not defined because the process has exited. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.MainWindowHandle" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001EE RID: 494
|
||||
// (get) Token: 0x060007C8 RID: 1992 RVA: 0x00014B60 File Offset: 0x00012D60
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoTODO]
|
||||
[MonitoringDescription("The handle of the main window of the process.")]
|
||||
public IntPtr MainWindowHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return (IntPtr)0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the caption of the main window of the process.</summary>
|
||||
/// <returns>The process's main window title.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.MainWindowTitle" /> property is not defined because the process has exited. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.MainWindowTitle" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001EF RID: 495
|
||||
// (get) Token: 0x060007C9 RID: 1993 RVA: 0x00014B68 File Offset: 0x00012D68
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The title of the main window of the process.")]
|
||||
[global::System.MonoTODO]
|
||||
public string MainWindowTitle
|
||||
{
|
||||
get
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007CA RID: 1994
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool GetWorkingSet_internal(IntPtr handle, out int min, out int max);
|
||||
|
||||
// Token: 0x060007CB RID: 1995
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool SetWorkingSet_internal(IntPtr handle, int min, int max, bool use_min);
|
||||
|
||||
/// <summary>Gets or sets the maximum allowable working set size for the associated process.</summary>
|
||||
/// <returns>The maximum working set size that is allowed in memory for the process, in bytes.</returns>
|
||||
/// <exception cref="T:System.ArgumentException">The maximum working set size is invalid. It must be greater than or equal to the minimum working set size.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">Working set information cannot be retrieved from the associated process resource.-or- The process identifier or process handle is zero because the process has not been started. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.MaxWorkingSet" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> is not available.-or- The process has exited. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F0 RID: 496
|
||||
// (get) Token: 0x060007CC RID: 1996 RVA: 0x00014B70 File Offset: 0x00012D70
|
||||
// (set) Token: 0x060007CD RID: 1997 RVA: 0x00014BEC File Offset: 0x00012DEC
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The maximum working set for this process.")]
|
||||
public IntPtr MaxWorkingSet
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.HasExited)
|
||||
{
|
||||
throw new InvalidOperationException(string.Concat(new object[] { "The process ", this.ProcessName, " (ID ", this.Id, ") has exited" }));
|
||||
}
|
||||
int num;
|
||||
int num2;
|
||||
if (!Process.GetWorkingSet_internal(this.process_handle, out num, out num2))
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception();
|
||||
}
|
||||
return (IntPtr)num2;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.HasExited)
|
||||
{
|
||||
throw new InvalidOperationException(string.Concat(new object[] { "The process ", this.ProcessName, " (ID ", this.Id, ") has exited" }));
|
||||
}
|
||||
if (!Process.SetWorkingSet_internal(this.process_handle, 0, value.ToInt32(), false))
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the minimum allowable working set size for the associated process.</summary>
|
||||
/// <returns>The minimum working set size that is required in memory for the process, in bytes.</returns>
|
||||
/// <exception cref="T:System.ArgumentException">The minimum working set size is invalid. It must be less than or equal to the maximum working set size.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">Working set information cannot be retrieved from the associated process resource.-or- The process identifier or process handle is zero because the process has not been started. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are trying to access the <see cref="P:System.Diagnostics.Process.MinWorkingSet" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> is not available.-or- The process has exited.</exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F1 RID: 497
|
||||
// (get) Token: 0x060007CE RID: 1998 RVA: 0x00014C68 File Offset: 0x00012E68
|
||||
// (set) Token: 0x060007CF RID: 1999 RVA: 0x00014CE4 File Offset: 0x00012EE4
|
||||
[MonitoringDescription("The minimum working set for this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public IntPtr MinWorkingSet
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.HasExited)
|
||||
{
|
||||
throw new InvalidOperationException(string.Concat(new object[] { "The process ", this.ProcessName, " (ID ", this.Id, ") has exited" }));
|
||||
}
|
||||
int num;
|
||||
int num2;
|
||||
if (!Process.GetWorkingSet_internal(this.process_handle, out num, out num2))
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception();
|
||||
}
|
||||
return (IntPtr)num;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.HasExited)
|
||||
{
|
||||
throw new InvalidOperationException(string.Concat(new object[] { "The process ", this.ProcessName, " (ID ", this.Id, ") has exited" }));
|
||||
}
|
||||
if (!Process.SetWorkingSet_internal(this.process_handle, value.ToInt32(), 0, true))
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007D0 RID: 2000
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern ProcessModule[] GetModules_internal(IntPtr handle);
|
||||
|
||||
/// <summary>Gets the modules that have been loaded by the associated process.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Diagnostics.ProcessModule" /> that represents the modules that have been loaded by the associated process.</returns>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.Modules" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> is not available.</exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">You are attempting to access the <see cref="P:System.Diagnostics.Process.Modules" /> property for either the system process or the idle process. These processes do not have modules.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F2 RID: 498
|
||||
// (get) Token: 0x060007D1 RID: 2001 RVA: 0x00014D60 File Offset: 0x00012F60
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[MonitoringDescription("The modules that are loaded as part of this process.")]
|
||||
public ProcessModuleCollection Modules
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.module_collection == null)
|
||||
{
|
||||
this.module_collection = new ProcessModuleCollection(this.GetModules_internal(this.process_handle));
|
||||
}
|
||||
return this.module_collection;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007D2 RID: 2002
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern long GetProcessData(int pid, int data_type, out int error);
|
||||
|
||||
/// <summary>Gets the nonpaged system memory size allocated to this process.</summary>
|
||||
/// <returns>The amount of memory, in bytes, the system has allocated for the associated process that cannot be written to the virtual memory paging file.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F3 RID: 499
|
||||
// (get) Token: 0x060007D3 RID: 2003 RVA: 0x00014D98 File Offset: 0x00012F98
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The number of bytes that are not pageable.")]
|
||||
[global::System.MonoTODO]
|
||||
[Obsolete("Use NonpagedSystemMemorySize64")]
|
||||
public int NonpagedSystemMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the paged memory size.</summary>
|
||||
/// <returns>The amount of memory, in bytes, allocated by the associated process that can be written to the virtual memory paging file.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F4 RID: 500
|
||||
// (get) Token: 0x060007D4 RID: 2004 RVA: 0x00014D9C File Offset: 0x00012F9C
|
||||
[MonitoringDescription("The number of bytes that are paged.")]
|
||||
[global::System.MonoTODO]
|
||||
[Obsolete("Use PagedMemorySize64")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int PagedMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the paged system memory size.</summary>
|
||||
/// <returns>The amount of memory, in bytes, the system has allocated for the associated process that can be written to the virtual memory paging file.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F5 RID: 501
|
||||
// (get) Token: 0x060007D5 RID: 2005 RVA: 0x00014DA0 File Offset: 0x00012FA0
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoTODO]
|
||||
[Obsolete("Use PagedSystemMemorySize64")]
|
||||
[MonitoringDescription("The amount of paged system memory in bytes.")]
|
||||
public int PagedSystemMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the peak paged memory size.</summary>
|
||||
/// <returns>The maximum amount of memory, in bytes, allocated by the associated process that could be written to the virtual memory paging file.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F6 RID: 502
|
||||
// (get) Token: 0x060007D6 RID: 2006 RVA: 0x00014DA4 File Offset: 0x00012FA4
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[Obsolete("Use PeakPagedMemorySize64")]
|
||||
[global::System.MonoTODO]
|
||||
[MonitoringDescription("The maximum amount of paged memory used by this process.")]
|
||||
public int PeakPagedMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the peak virtual memory size.</summary>
|
||||
/// <returns>The maximum amount of virtual memory, in bytes, that the associated process has requested.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F7 RID: 503
|
||||
// (get) Token: 0x060007D7 RID: 2007 RVA: 0x00014DA8 File Offset: 0x00012FA8
|
||||
[MonitoringDescription("The maximum amount of virtual memory used by this process.")]
|
||||
[Obsolete("Use PeakVirtualMemorySize64")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int PeakVirtualMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return (int)Process.GetProcessData(this.pid, 8, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the peak working set size for the associated process.</summary>
|
||||
/// <returns>The maximum amount of physical memory that the associated process has required all at once, in bytes.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F8 RID: 504
|
||||
// (get) Token: 0x060007D8 RID: 2008 RVA: 0x00014DC4 File Offset: 0x00012FC4
|
||||
[MonitoringDescription("The maximum amount of system memory used by this process.")]
|
||||
[Obsolete("Use PeakWorkingSet64")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int PeakWorkingSet
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return (int)Process.GetProcessData(this.pid, 5, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of nonpaged system memory allocated for the associated process.</summary>
|
||||
/// <returns>The amount of system memory, in bytes, allocated for the associated process that cannot be written to the virtual memory paging file.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001F9 RID: 505
|
||||
// (get) Token: 0x060007D9 RID: 2009 RVA: 0x00014DE0 File Offset: 0x00012FE0
|
||||
[global::System.MonoTODO]
|
||||
[ComVisible(false)]
|
||||
[MonitoringDescription("The number of bytes that are not pageable.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public long NonpagedSystemMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of paged memory allocated for the associated process.</summary>
|
||||
/// <returns>The amount of memory, in bytes, allocated in the virtual memory paging file for the associated process.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001FA RID: 506
|
||||
// (get) Token: 0x060007DA RID: 2010 RVA: 0x00014DE4 File Offset: 0x00012FE4
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The number of bytes that are paged.")]
|
||||
[global::System.MonoTODO]
|
||||
[ComVisible(false)]
|
||||
public long PagedMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of pageable system memory allocated for the associated process.</summary>
|
||||
/// <returns>The amount of system memory, in bytes, allocated for the associated process that can be written to the virtual memory paging file.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001FB RID: 507
|
||||
// (get) Token: 0x060007DB RID: 2011 RVA: 0x00014DE8 File Offset: 0x00012FE8
|
||||
[ComVisible(false)]
|
||||
[global::System.MonoTODO]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The amount of paged system memory in bytes.")]
|
||||
public long PagedSystemMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the maximum amount of memory in the virtual memory paging file used by the associated process.</summary>
|
||||
/// <returns>The maximum amount of memory, in bytes, allocated in the virtual memory paging file for the associated process since it was started.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001FC RID: 508
|
||||
// (get) Token: 0x060007DC RID: 2012 RVA: 0x00014DEC File Offset: 0x00012FEC
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The maximum amount of paged memory used by this process.")]
|
||||
[ComVisible(false)]
|
||||
[global::System.MonoTODO]
|
||||
public long PeakPagedMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the maximum amount of virtual memory used by the associated process.</summary>
|
||||
/// <returns>The maximum amount of virtual memory, in bytes, allocated for the associated process since it was started.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001FD RID: 509
|
||||
// (get) Token: 0x060007DD RID: 2013 RVA: 0x00014DF0 File Offset: 0x00012FF0
|
||||
[MonitoringDescription("The maximum amount of virtual memory used by this process.")]
|
||||
[ComVisible(false)]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public long PeakVirtualMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return Process.GetProcessData(this.pid, 8, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the maximum amount of physical memory used by the associated process.</summary>
|
||||
/// <returns>The maximum amount of physical memory, in bytes, allocated for the associated process since it was started.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x170001FE RID: 510
|
||||
// (get) Token: 0x060007DE RID: 2014 RVA: 0x00014E0C File Offset: 0x0001300C
|
||||
[MonitoringDescription("The maximum amount of system memory used by this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[ComVisible(false)]
|
||||
public long PeakWorkingSet64
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return Process.GetProcessData(this.pid, 5, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value indicating whether the associated process priority should temporarily be boosted by the operating system when the main window has the focus.</summary>
|
||||
/// <returns>true if dynamic boosting of the process priority should take place for a process when it is taken out of the wait state; otherwise, false. The default is false.</returns>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">Priority boost information could not be retrieved from the associated process resource. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.-or- The process identifier or process handle is zero. (The process has not been started.) </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.PriorityBoostEnabled" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> is not available.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x170001FF RID: 511
|
||||
// (get) Token: 0x060007DF RID: 2015 RVA: 0x00014E28 File Offset: 0x00013028
|
||||
// (set) Token: 0x060007E0 RID: 2016 RVA: 0x00014E2C File Offset: 0x0001302C
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoTODO]
|
||||
[MonitoringDescription("Process will be of higher priority while it is actively used.")]
|
||||
public bool PriorityBoostEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the overall priority category for the associated process.</summary>
|
||||
/// <returns>The priority category for the associated process, from which the <see cref="P:System.Diagnostics.Process.BasePriority" /> of the process is calculated.</returns>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">Process priority information could not be set or retrieved from the associated process resource.-or- The process identifier or process handle is zero. (The process has not been started.) </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.PriorityClass" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> is not available.</exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">You have set the <see cref="P:System.Diagnostics.Process.PriorityClass" /> to AboveNormal or BelowNormal when using Windows 98 or Windows Millennium Edition (Windows Me). These platforms do not support those values for the priority class. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">Priority class cannot be set because it does not use a valid value, as defined in the <see cref="T:System.Diagnostics.ProcessPriorityClass" /> enumeration.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000200 RID: 512
|
||||
// (get) Token: 0x060007E1 RID: 2017 RVA: 0x00014E30 File Offset: 0x00013030
|
||||
// (set) Token: 0x060007E2 RID: 2018 RVA: 0x00014E7C File Offset: 0x0001307C
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoLimitation("Under Unix, only root is allowed to raise the priority.")]
|
||||
[MonitoringDescription("The relative process priority.")]
|
||||
public ProcessPriorityClass PriorityClass
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("Process has not been started.");
|
||||
}
|
||||
int num;
|
||||
int priorityClass = Process.GetPriorityClass(this.process_handle, out num);
|
||||
if (priorityClass == 0)
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception(num);
|
||||
}
|
||||
return (ProcessPriorityClass)priorityClass;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(ProcessPriorityClass), value))
|
||||
{
|
||||
throw new global::System.ComponentModel.InvalidEnumArgumentException("value", (int)value, typeof(ProcessPriorityClass));
|
||||
}
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("Process has not been started.");
|
||||
}
|
||||
int num;
|
||||
if (!Process.SetPriorityClass(this.process_handle, (int)value, out num))
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007E3 RID: 2019
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int GetPriorityClass(IntPtr handle, out int error);
|
||||
|
||||
// Token: 0x060007E4 RID: 2020
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool SetPriorityClass(IntPtr handle, int priority, out int error);
|
||||
|
||||
/// <summary>Gets the private memory size.</summary>
|
||||
/// <returns>The number of bytes allocated by the associated process that cannot be shared with other processes.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000201 RID: 513
|
||||
// (get) Token: 0x060007E5 RID: 2021 RVA: 0x00014EF4 File Offset: 0x000130F4
|
||||
[MonitoringDescription("The amount of memory exclusively used by this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[Obsolete("Use PrivateMemorySize64")]
|
||||
public int PrivateMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return (int)Process.GetProcessData(this.pid, 6, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the Terminal Services session identifier for the associated process.</summary>
|
||||
/// <returns>The Terminal Services session identifier for the associated process.</returns>
|
||||
/// <exception cref="T:System.NullReferenceException">There is no session associated with this process.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">There is no process associated with this session identifier.-or-The associated process is not on this machine. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The <see cref="P:System.Diagnostics.Process.SessionId" /> property is not supported on Windows 98.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000202 RID: 514
|
||||
// (get) Token: 0x060007E6 RID: 2022 RVA: 0x00014F10 File Offset: 0x00013110
|
||||
[MonitoringDescription("The session ID for this process.")]
|
||||
[global::System.MonoNotSupported("")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int SessionId
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007E7 RID: 2023
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern long Times(IntPtr handle, int type);
|
||||
|
||||
/// <summary>Gets the privileged processor time for this process.</summary>
|
||||
/// <returns>A <see cref="T:System.TimeSpan" /> that indicates the amount of time that the process has spent running code inside the operating system core.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.PrivilegedProcessorTime" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000203 RID: 515
|
||||
// (get) Token: 0x060007E8 RID: 2024 RVA: 0x00014F18 File Offset: 0x00013118
|
||||
[MonitoringDescription("The amount of processing time spent in the OS core for this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public TimeSpan PrivilegedProcessorTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TimeSpan(Process.Times(this.process_handle, 1));
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007E9 RID: 2025
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern string ProcessName_internal(IntPtr handle);
|
||||
|
||||
/// <summary>Gets the name of the process.</summary>
|
||||
/// <returns>The name that the system uses to identify the process to the user.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process does not have an identifier, or no process is associated with the <see cref="T:System.Diagnostics.Process" />.-or- The associated process has exited. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000204 RID: 516
|
||||
// (get) Token: 0x060007EA RID: 2026 RVA: 0x00014F2C File Offset: 0x0001312C
|
||||
[MonitoringDescription("The name of this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public string ProcessName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.process_name == null)
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new InvalidOperationException("No process is associated with this object.");
|
||||
}
|
||||
this.process_name = Process.ProcessName_internal(this.process_handle);
|
||||
if (this.process_name == null)
|
||||
{
|
||||
throw new InvalidOperationException("Process has exited, so the requested information is not available.");
|
||||
}
|
||||
if (this.process_name.EndsWith(".exe") || this.process_name.EndsWith(".bat") || this.process_name.EndsWith(".com"))
|
||||
{
|
||||
this.process_name = this.process_name.Substring(0, this.process_name.Length - 4);
|
||||
}
|
||||
}
|
||||
return this.process_name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the processors on which the threads in this process can be scheduled to run.</summary>
|
||||
/// <returns>A bitmask representing the processors that the threads in the associated process can run on. The default depends on the number of processors on the computer. The default value is 2 n -1, where n is the number of processors.</returns>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">
|
||||
/// <see cref="P:System.Diagnostics.Process.ProcessorAffinity" /> information could not be set or retrieved from the associated process resource.-or- The process identifier or process handle is zero. (The process has not been started.) </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.ProcessorAffinity" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process <see cref="P:System.Diagnostics.Process.Id" /> was not available.-or- The process has exited. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000205 RID: 517
|
||||
// (get) Token: 0x060007EB RID: 2027 RVA: 0x00014FF0 File Offset: 0x000131F0
|
||||
// (set) Token: 0x060007EC RID: 2028 RVA: 0x00014FF8 File Offset: 0x000131F8
|
||||
[global::System.MonoTODO]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("Allowed processor that can be used by this process.")]
|
||||
public IntPtr ProcessorAffinity
|
||||
{
|
||||
get
|
||||
{
|
||||
return (IntPtr)0;
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the user interface of the process is responding.</summary>
|
||||
/// <returns>true if the user interface of the associated process is responding to the system; otherwise, false.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.Responding" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000206 RID: 518
|
||||
// (get) Token: 0x060007ED RID: 2029 RVA: 0x00014FFC File Offset: 0x000131FC
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.MonoTODO]
|
||||
[MonitoringDescription("Is this process responsive.")]
|
||||
public bool Responding
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a stream used to read the error output of the application.</summary>
|
||||
/// <returns>A <see cref="T:System.IO.StreamReader" /> that can be used to read the standard error stream of the application.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.StandardError" /> stream has not been defined for redirection; ensure <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardError" /> is set to true and <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> is set to false.- or - The <see cref="P:System.Diagnostics.Process.StandardError" /> stream has been opened for asynchronous read operations with <see cref="M:System.Diagnostics.Process.BeginErrorReadLine" />. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000207 RID: 519
|
||||
// (get) Token: 0x060007EE RID: 2030 RVA: 0x00015000 File Offset: 0x00013200
|
||||
[MonitoringDescription("The standard error stream of this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
public StreamReader StandardError
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.error_stream == null)
|
||||
{
|
||||
throw new InvalidOperationException("Standard error has not been redirected");
|
||||
}
|
||||
if ((this.async_mode & Process.AsyncModes.AsyncError) != Process.AsyncModes.NoneYet)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot mix asynchronous and synchonous reads.");
|
||||
}
|
||||
this.async_mode |= Process.AsyncModes.SyncError;
|
||||
return this.error_stream;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a stream used to write the input of the application.</summary>
|
||||
/// <returns>A <see cref="T:System.IO.StreamWriter" /> that can be used to write the standard input stream of the application.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.StandardInput" /> stream has not been defined because <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardInput" /> is set to false. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000208 RID: 520
|
||||
// (get) Token: 0x060007EF RID: 2031 RVA: 0x00015050 File Offset: 0x00013250
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[MonitoringDescription("The standard input stream of this process.")]
|
||||
public StreamWriter StandardInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.input_stream == null)
|
||||
{
|
||||
throw new InvalidOperationException("Standard input has not been redirected");
|
||||
}
|
||||
return this.input_stream;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a stream used to read the output of the application.</summary>
|
||||
/// <returns>A <see cref="T:System.IO.StreamReader" /> that can be used to read the standard output stream of the application.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream has not been defined for redirection; ensure <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardOutput" /> is set to true and <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> is set to false.- or - The <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream has been opened for asynchronous read operations with <see cref="M:System.Diagnostics.Process.BeginOutputReadLine" />. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x17000209 RID: 521
|
||||
// (get) Token: 0x060007F0 RID: 2032 RVA: 0x00015070 File Offset: 0x00013270
|
||||
[MonitoringDescription("The standard output stream of this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
public StreamReader StandardOutput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.output_stream == null)
|
||||
{
|
||||
throw new InvalidOperationException("Standard output has not been redirected");
|
||||
}
|
||||
if ((this.async_mode & Process.AsyncModes.AsyncOutput) != Process.AsyncModes.NoneYet)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot mix asynchronous and synchonous reads.");
|
||||
}
|
||||
this.async_mode |= Process.AsyncModes.SyncOutput;
|
||||
return this.output_stream;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the properties to pass to the <see cref="M:System.Diagnostics.Process.Start" /> method of the <see cref="T:System.Diagnostics.Process" />.</summary>
|
||||
/// <returns>The <see cref="T:System.Diagnostics.ProcessStartInfo" /> that represents the data with which to start the process. These arguments include the name of the executable file or document used to start the process.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The value that specifies the <see cref="P:System.Diagnostics.Process.StartInfo" /> is null. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x1700020A RID: 522
|
||||
// (get) Token: 0x060007F1 RID: 2033 RVA: 0x000150C0 File Offset: 0x000132C0
|
||||
// (set) Token: 0x060007F2 RID: 2034 RVA: 0x000150E0 File Offset: 0x000132E0
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[MonitoringDescription("Information for the start of this process.")]
|
||||
public ProcessStartInfo StartInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.start_info == null)
|
||||
{
|
||||
this.start_info = new ProcessStartInfo();
|
||||
}
|
||||
return this.start_info;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
this.start_info = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060007F3 RID: 2035
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern long StartTime_internal(IntPtr handle);
|
||||
|
||||
/// <summary>Gets the time that the associated process was started.</summary>
|
||||
/// <returns>A <see cref="T:System.DateTime" /> that indicates when the process started. This only has meaning for started processes.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.StartTime" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process has exited.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">An error occurred in the call to the Windows function.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x1700020B RID: 523
|
||||
// (get) Token: 0x060007F4 RID: 2036 RVA: 0x000150FC File Offset: 0x000132FC
|
||||
[MonitoringDescription("The time this process started.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public DateTime StartTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return DateTime.FromFileTime(Process.StartTime_internal(this.process_handle));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the object used to marshal the event handler calls that are issued as a result of a process exit event.</summary>
|
||||
/// <returns>The <see cref="T:System.ComponentModel.ISynchronizeInvoke" /> used to marshal event handler calls that are issued as a result of an <see cref="E:System.Diagnostics.Process.Exited" /> event on the process.</returns>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x1700020C RID: 524
|
||||
// (get) Token: 0x060007F5 RID: 2037 RVA: 0x00015110 File Offset: 0x00013310
|
||||
// (set) Token: 0x060007F6 RID: 2038 RVA: 0x00015118 File Offset: 0x00013318
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[global::System.ComponentModel.DefaultValue(null)]
|
||||
[MonitoringDescription("The object that is used to synchronize event handler calls for this process.")]
|
||||
public global::System.ComponentModel.ISynchronizeInvoke SynchronizingObject
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.synchronizingObject;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.synchronizingObject = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the set of threads that are running in the associated process.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Diagnostics.ProcessThread" /> representing the operating system threads currently running in the associated process.</returns>
|
||||
/// <exception cref="T:System.SystemException">The process does not have an <see cref="P:System.Diagnostics.Process.Id" />, or no process is associated with the <see cref="T:System.Diagnostics.Process" /> instance.-or- The associated process has exited. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x1700020D RID: 525
|
||||
// (get) Token: 0x060007F7 RID: 2039 RVA: 0x00015124 File Offset: 0x00013324
|
||||
[global::System.ComponentModel.Browsable(false)]
|
||||
[MonitoringDescription("The number of threads of this process.")]
|
||||
[global::System.MonoTODO]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public ProcessThreadCollection Threads
|
||||
{
|
||||
get
|
||||
{
|
||||
return ProcessThreadCollection.GetEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the total processor time for this process.</summary>
|
||||
/// <returns>A <see cref="T:System.TimeSpan" /> that indicates the amount of time that the associated process has spent utilizing the CPU. This value is the sum of the <see cref="P:System.Diagnostics.Process.UserProcessorTime" /> and the <see cref="P:System.Diagnostics.Process.PrivilegedProcessorTime" />.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.TotalProcessorTime" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x1700020E RID: 526
|
||||
// (get) Token: 0x060007F8 RID: 2040 RVA: 0x0001512C File Offset: 0x0001332C
|
||||
[MonitoringDescription("The total CPU time spent for this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public TimeSpan TotalProcessorTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TimeSpan(Process.Times(this.process_handle, 2));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the user processor time for this process.</summary>
|
||||
/// <returns>A <see cref="T:System.TimeSpan" /> that indicates the amount of time that the associated process has spent running code inside the application portion of the process (not inside the operating system core).</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to access the <see cref="P:System.Diagnostics.Process.UserProcessorTime" /> property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x1700020F RID: 527
|
||||
// (get) Token: 0x060007F9 RID: 2041 RVA: 0x00015140 File Offset: 0x00013340
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The CPU time spent for this process in user mode.")]
|
||||
public TimeSpan UserProcessorTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TimeSpan(Process.Times(this.process_handle, 0));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the size of the process's virtual memory.</summary>
|
||||
/// <returns>The amount of virtual memory, in bytes, that the associated process has requested.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000210 RID: 528
|
||||
// (get) Token: 0x060007FA RID: 2042 RVA: 0x00015154 File Offset: 0x00013354
|
||||
[MonitoringDescription("The amount of virtual memory currently used for this process.")]
|
||||
[Obsolete("Use VirtualMemorySize64")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int VirtualMemorySize
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return (int)Process.GetProcessData(this.pid, 7, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the associated process's physical memory usage.</summary>
|
||||
/// <returns>The total amount of physical memory the associated process is using, in bytes.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000211 RID: 529
|
||||
// (get) Token: 0x060007FB RID: 2043 RVA: 0x00015170 File Offset: 0x00013370
|
||||
[Obsolete("Use WorkingSet64")]
|
||||
[MonitoringDescription("The amount of physical memory currently used for this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public int WorkingSet
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return (int)Process.GetProcessData(this.pid, 4, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of private memory allocated for the associated process.</summary>
|
||||
/// <returns>The amount of memory, in bytes, allocated for the associated process that cannot be shared with other processes.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000212 RID: 530
|
||||
// (get) Token: 0x060007FC RID: 2044 RVA: 0x0001518C File Offset: 0x0001338C
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The amount of memory exclusively used by this process.")]
|
||||
[ComVisible(false)]
|
||||
public long PrivateMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return Process.GetProcessData(this.pid, 6, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of the virtual memory allocated for the associated process.</summary>
|
||||
/// <returns>The amount of virtual memory, in bytes, allocated for the associated process.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000213 RID: 531
|
||||
// (get) Token: 0x060007FD RID: 2045 RVA: 0x000151A8 File Offset: 0x000133A8
|
||||
[ComVisible(false)]
|
||||
[MonitoringDescription("The amount of virtual memory currently used for this process.")]
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
public long VirtualMemorySize64
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return Process.GetProcessData(this.pid, 7, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the amount of physical memory allocated for the associated process.</summary>
|
||||
/// <returns>The amount of physical memory, in bytes, allocated for the associated process.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x17000214 RID: 532
|
||||
// (get) Token: 0x060007FE RID: 2046 RVA: 0x000151C4 File Offset: 0x000133C4
|
||||
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||
[MonitoringDescription("The amount of physical memory currently used for this process.")]
|
||||
[ComVisible(false)]
|
||||
public long WorkingSet64
|
||||
{
|
||||
get
|
||||
{
|
||||
int num;
|
||||
return Process.GetProcessData(this.pid, 4, out num);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Frees all the resources that are associated with this component.</summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x060007FF RID: 2047 RVA: 0x000151E0 File Offset: 0x000133E0
|
||||
public void Close()
|
||||
{
|
||||
this.Dispose(true);
|
||||
}
|
||||
|
||||
// Token: 0x06000800 RID: 2048
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool Kill_internal(IntPtr handle, int signo);
|
||||
|
||||
// Token: 0x06000801 RID: 2049 RVA: 0x000151EC File Offset: 0x000133EC
|
||||
private bool Close(int signo)
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero)
|
||||
{
|
||||
throw new SystemException("No process to kill.");
|
||||
}
|
||||
int num = Process.ExitCode_internal(this.process_handle);
|
||||
if (num != 259)
|
||||
{
|
||||
throw new InvalidOperationException("The process already finished.");
|
||||
}
|
||||
return Process.Kill_internal(this.process_handle, signo);
|
||||
}
|
||||
|
||||
/// <summary>Closes a process that has a user interface by sending a close message to its main window.</summary>
|
||||
/// <returns>true if the close message was successfully sent; false if the associated process does not have a main window or if the main window is disabled (for example if a modal dialog is being shown).</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> property to false to access this property on Windows 98 and Windows Me.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process has already exited. -or-No process is associated with this <see cref="T:System.Diagnostics.Process" /> object.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000802 RID: 2050 RVA: 0x00015248 File Offset: 0x00013448
|
||||
public bool CloseMainWindow()
|
||||
{
|
||||
return this.Close(2);
|
||||
}
|
||||
|
||||
/// <summary>Puts a <see cref="T:System.Diagnostics.Process" /> component in state to interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread.</summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x06000803 RID: 2051 RVA: 0x00015254 File Offset: 0x00013454
|
||||
[global::System.MonoTODO]
|
||||
public static void EnterDebugMode()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000804 RID: 2052
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern IntPtr GetProcess_internal(int pid);
|
||||
|
||||
// Token: 0x06000805 RID: 2053
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int GetPid_internal();
|
||||
|
||||
/// <summary>Gets a new <see cref="T:System.Diagnostics.Process" /> component and associates it with the currently active process.</summary>
|
||||
/// <returns>A new <see cref="T:System.Diagnostics.Process" /> component associated with the process resource that is running the calling application.</returns>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000806 RID: 2054 RVA: 0x00015258 File Offset: 0x00013458
|
||||
public static Process GetCurrentProcess()
|
||||
{
|
||||
int pid_internal = Process.GetPid_internal();
|
||||
IntPtr process_internal = Process.GetProcess_internal(pid_internal);
|
||||
if (process_internal == IntPtr.Zero)
|
||||
{
|
||||
throw new SystemException("Can't find current process");
|
||||
}
|
||||
return new Process(process_internal, pid_internal);
|
||||
}
|
||||
|
||||
/// <summary>Returns a new <see cref="T:System.Diagnostics.Process" /> component, given the identifier of a process on the local computer.</summary>
|
||||
/// <returns>A <see cref="T:System.Diagnostics.Process" /> component that is associated with the local process resource identified by the <paramref name="processId" /> parameter.</returns>
|
||||
/// <param name="processId">The system-unique identifier of a process resource. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The process specified by the <paramref name="processId" /> parameter is not running. The identifier might be expired. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process was not started by this object.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000807 RID: 2055 RVA: 0x00015294 File Offset: 0x00013494
|
||||
public static Process GetProcessById(int processId)
|
||||
{
|
||||
IntPtr process_internal = Process.GetProcess_internal(processId);
|
||||
if (process_internal == IntPtr.Zero)
|
||||
{
|
||||
throw new ArgumentException("Can't find process with ID " + processId.ToString());
|
||||
}
|
||||
return new Process(process_internal, processId);
|
||||
}
|
||||
|
||||
/// <summary>Returns a new <see cref="T:System.Diagnostics.Process" /> component, given a process identifier and the name of a computer on the network.</summary>
|
||||
/// <returns>A <see cref="T:System.Diagnostics.Process" /> component that is associated with a remote process resource identified by the <paramref name="processId" /> parameter.</returns>
|
||||
/// <param name="processId">The system-unique identifier of a process resource. </param>
|
||||
/// <param name="machineName">The name of a computer on the network. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The process specified by the <paramref name="processId" /> parameter is not running. The identifier might be expired.-or- The <paramref name="machineName" /> parameter syntax is invalid. The name might have length zero (0). </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="machineName" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process was not started by this object.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000808 RID: 2056 RVA: 0x000152D8 File Offset: 0x000134D8
|
||||
[global::System.MonoTODO("There is no support for retrieving process information from a remote machine")]
|
||||
public static Process GetProcessById(int processId, string machineName)
|
||||
{
|
||||
if (machineName == null)
|
||||
{
|
||||
throw new ArgumentNullException("machineName");
|
||||
}
|
||||
if (!Process.IsLocalMachine(machineName))
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
return Process.GetProcessById(processId);
|
||||
}
|
||||
|
||||
// Token: 0x06000809 RID: 2057
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int[] GetProcesses_internal();
|
||||
|
||||
/// <summary>Creates a new <see cref="T:System.Diagnostics.Process" /> component for each process resource on the local computer.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Diagnostics.Process" /> that represents all the process resources running on the local computer.</returns>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600080A RID: 2058 RVA: 0x00015310 File Offset: 0x00013510
|
||||
public static Process[] GetProcesses()
|
||||
{
|
||||
int[] processes_internal = Process.GetProcesses_internal();
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (processes_internal == null)
|
||||
{
|
||||
return new Process[0];
|
||||
}
|
||||
for (int i = 0; i < processes_internal.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
arrayList.Add(Process.GetProcessById(processes_internal[i]));
|
||||
}
|
||||
catch (SystemException)
|
||||
{
|
||||
}
|
||||
}
|
||||
return (Process[])arrayList.ToArray(typeof(Process));
|
||||
}
|
||||
|
||||
/// <summary>Creates a new <see cref="T:System.Diagnostics.Process" /> component for each process resource on the specified computer.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Diagnostics.Process" /> that represents all the process resources running on the specified computer.</returns>
|
||||
/// <param name="machineName">The computer from which to read the list of processes. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="machineName" /> parameter syntax is invalid. It might have length zero (0). </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="machineName" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The operating system platform does not support this operation on remote computers. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">A problem occurred accessing an underlying system API. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600080B RID: 2059 RVA: 0x00015398 File Offset: 0x00013598
|
||||
[global::System.MonoTODO("There is no support for retrieving process information from a remote machine")]
|
||||
public static Process[] GetProcesses(string machineName)
|
||||
{
|
||||
if (machineName == null)
|
||||
{
|
||||
throw new ArgumentNullException("machineName");
|
||||
}
|
||||
if (!Process.IsLocalMachine(machineName))
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
return Process.GetProcesses();
|
||||
}
|
||||
|
||||
/// <summary>Creates an array of new <see cref="T:System.Diagnostics.Process" /> components and associates them with all the process resources on the local computer that share the specified process name.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Diagnostics.Process" /> that represents the process resources running the specified application or file.</returns>
|
||||
/// <param name="processName">The friendly name of the process. </param>
|
||||
/// <exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600080C RID: 2060 RVA: 0x000153C4 File Offset: 0x000135C4
|
||||
public static Process[] GetProcessesByName(string processName)
|
||||
{
|
||||
Process[] processes = Process.GetProcesses();
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (int i = 0; i < processes.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.Compare(processName, processes[i].ProcessName, true) == 0)
|
||||
{
|
||||
arrayList.Add(processes[i]);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
return (Process[])arrayList.ToArray(typeof(Process));
|
||||
}
|
||||
|
||||
/// <summary>Creates an array of new <see cref="T:System.Diagnostics.Process" /> components and associates them with all the process resources on a remote computer that share the specified process name.</summary>
|
||||
/// <returns>An array of type <see cref="T:System.Diagnostics.Process" /> that represents the process resources running the specified application or file.</returns>
|
||||
/// <param name="processName">The friendly name of the process. </param>
|
||||
/// <param name="machineName">The name of a computer on the network. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="machineName" /> parameter syntax is invalid. It might have length zero (0). </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="machineName" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">The operating system platform does not support this operation on remote computers. </exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">A problem occurred accessing an underlying system API. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600080D RID: 2061 RVA: 0x0001544C File Offset: 0x0001364C
|
||||
[global::System.MonoTODO]
|
||||
public static Process[] GetProcessesByName(string processName, string machineName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>Immediately stops the associated process.</summary>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">The associated process could not be terminated. -or-The process is terminating.-or- The associated process is a Win16 executable.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">You are attempting to call <see cref="M:System.Diagnostics.Process.Kill" /> for a process that is running on a remote computer. The method is available only for processes running on the local computer.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process has already exited. -or-There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600080E RID: 2062 RVA: 0x00015454 File Offset: 0x00013654
|
||||
public void Kill()
|
||||
{
|
||||
this.Close(1);
|
||||
}
|
||||
|
||||
/// <summary>Takes a <see cref="T:System.Diagnostics.Process" /> component out of the state that lets it interact with operating system processes that run in a special mode.</summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x0600080F RID: 2063 RVA: 0x00015460 File Offset: 0x00013660
|
||||
[global::System.MonoTODO]
|
||||
public static void LeaveDebugMode()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Discards any information about the associated process that has been cached inside the process component.</summary>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000810 RID: 2064 RVA: 0x00015464 File Offset: 0x00013664
|
||||
public void Refresh()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000811 RID: 2065
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool ShellExecuteEx_internal(ProcessStartInfo startInfo, ref Process.ProcInfo proc_info);
|
||||
|
||||
// Token: 0x06000812 RID: 2066
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool CreateProcess_internal(ProcessStartInfo startInfo, IntPtr stdin, IntPtr stdout, IntPtr stderr, ref Process.ProcInfo proc_info);
|
||||
|
||||
// Token: 0x06000813 RID: 2067 RVA: 0x00015468 File Offset: 0x00013668
|
||||
private static bool Start_shell(ProcessStartInfo startInfo, Process process)
|
||||
{
|
||||
Process.ProcInfo procInfo = default(Process.ProcInfo);
|
||||
if (startInfo.RedirectStandardInput || startInfo.RedirectStandardOutput || startInfo.RedirectStandardError)
|
||||
{
|
||||
throw new InvalidOperationException("UseShellExecute must be false when redirecting I/O.");
|
||||
}
|
||||
if (startInfo.HaveEnvVars)
|
||||
{
|
||||
throw new InvalidOperationException("UseShellExecute must be false in order to use environment variables.");
|
||||
}
|
||||
Process.FillUserInfo(startInfo, ref procInfo);
|
||||
bool flag;
|
||||
try
|
||||
{
|
||||
flag = Process.ShellExecuteEx_internal(startInfo, ref procInfo);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (procInfo.Password != IntPtr.Zero)
|
||||
{
|
||||
Marshal.FreeBSTR(procInfo.Password);
|
||||
}
|
||||
procInfo.Password = IntPtr.Zero;
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
throw new global::System.ComponentModel.Win32Exception(-procInfo.pid);
|
||||
}
|
||||
process.process_handle = procInfo.process_handle;
|
||||
process.pid = procInfo.pid;
|
||||
process.StartExitCallbackIfNeeded();
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06000814 RID: 2068 RVA: 0x00015558 File Offset: 0x00013758
|
||||
private static bool Start_noshell(ProcessStartInfo startInfo, Process process)
|
||||
{
|
||||
Process.ProcInfo procInfo = default(Process.ProcInfo);
|
||||
IntPtr intPtr = IntPtr.Zero;
|
||||
IntPtr intPtr2 = IntPtr.Zero;
|
||||
if (startInfo.HaveEnvVars)
|
||||
{
|
||||
string[] array = new string[startInfo.EnvironmentVariables.Count];
|
||||
startInfo.EnvironmentVariables.Keys.CopyTo(array, 0);
|
||||
procInfo.envKeys = array;
|
||||
array = new string[startInfo.EnvironmentVariables.Count];
|
||||
startInfo.EnvironmentVariables.Values.CopyTo(array, 0);
|
||||
procInfo.envValues = array;
|
||||
}
|
||||
bool flag;
|
||||
if (startInfo.RedirectStandardInput)
|
||||
{
|
||||
if (Process.IsWindows)
|
||||
{
|
||||
int num = 2;
|
||||
IntPtr intPtr3;
|
||||
flag = global::System.IO.MonoIO.CreatePipe(out intPtr, out intPtr3);
|
||||
if (flag)
|
||||
{
|
||||
flag = global::System.IO.MonoIO.DuplicateHandle(Process.GetCurrentProcess().Handle, intPtr3, Process.GetCurrentProcess().Handle, out intPtr2, 0, 0, num);
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr3, out monoIOError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = global::System.IO.MonoIO.CreatePipe(out intPtr, out intPtr2);
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
throw new IOException("Error creating standard input pipe");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
intPtr = global::System.IO.MonoIO.ConsoleInput;
|
||||
intPtr2 = (IntPtr)0;
|
||||
}
|
||||
IntPtr consoleOutput;
|
||||
if (startInfo.RedirectStandardOutput)
|
||||
{
|
||||
IntPtr zero = IntPtr.Zero;
|
||||
if (Process.IsWindows)
|
||||
{
|
||||
int num2 = 2;
|
||||
IntPtr intPtr4;
|
||||
flag = global::System.IO.MonoIO.CreatePipe(out intPtr4, out consoleOutput);
|
||||
if (flag)
|
||||
{
|
||||
global::System.IO.MonoIO.DuplicateHandle(Process.GetCurrentProcess().Handle, intPtr4, Process.GetCurrentProcess().Handle, out zero, 0, 0, num2);
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr4, out monoIOError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = global::System.IO.MonoIO.CreatePipe(out zero, out consoleOutput);
|
||||
}
|
||||
process.stdout_rd = zero;
|
||||
if (!flag)
|
||||
{
|
||||
if (startInfo.RedirectStandardInput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr, out monoIOError);
|
||||
global::System.IO.MonoIO.Close(intPtr2, out monoIOError);
|
||||
}
|
||||
throw new IOException("Error creating standard output pipe");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process.stdout_rd = (IntPtr)0;
|
||||
consoleOutput = global::System.IO.MonoIO.ConsoleOutput;
|
||||
}
|
||||
IntPtr consoleError;
|
||||
if (startInfo.RedirectStandardError)
|
||||
{
|
||||
IntPtr zero2 = IntPtr.Zero;
|
||||
if (Process.IsWindows)
|
||||
{
|
||||
int num3 = 2;
|
||||
IntPtr intPtr5;
|
||||
flag = global::System.IO.MonoIO.CreatePipe(out intPtr5, out consoleError);
|
||||
if (flag)
|
||||
{
|
||||
global::System.IO.MonoIO.DuplicateHandle(Process.GetCurrentProcess().Handle, intPtr5, Process.GetCurrentProcess().Handle, out zero2, 0, 0, num3);
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr5, out monoIOError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = global::System.IO.MonoIO.CreatePipe(out zero2, out consoleError);
|
||||
}
|
||||
process.stderr_rd = zero2;
|
||||
if (!flag)
|
||||
{
|
||||
if (startInfo.RedirectStandardInput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr, out monoIOError);
|
||||
global::System.IO.MonoIO.Close(intPtr2, out monoIOError);
|
||||
}
|
||||
if (startInfo.RedirectStandardOutput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(process.stdout_rd, out monoIOError);
|
||||
global::System.IO.MonoIO.Close(consoleOutput, out monoIOError);
|
||||
}
|
||||
throw new IOException("Error creating standard error pipe");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process.stderr_rd = (IntPtr)0;
|
||||
consoleError = global::System.IO.MonoIO.ConsoleError;
|
||||
}
|
||||
Process.FillUserInfo(startInfo, ref procInfo);
|
||||
try
|
||||
{
|
||||
flag = Process.CreateProcess_internal(startInfo, intPtr, consoleOutput, consoleError, ref procInfo);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (procInfo.Password != IntPtr.Zero)
|
||||
{
|
||||
Marshal.FreeBSTR(procInfo.Password);
|
||||
}
|
||||
procInfo.Password = IntPtr.Zero;
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
if (startInfo.RedirectStandardInput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr, out monoIOError);
|
||||
global::System.IO.MonoIO.Close(intPtr2, out monoIOError);
|
||||
}
|
||||
if (startInfo.RedirectStandardOutput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(process.stdout_rd, out monoIOError);
|
||||
global::System.IO.MonoIO.Close(consoleOutput, out monoIOError);
|
||||
}
|
||||
if (startInfo.RedirectStandardError)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(process.stderr_rd, out monoIOError);
|
||||
global::System.IO.MonoIO.Close(consoleError, out monoIOError);
|
||||
}
|
||||
throw new global::System.ComponentModel.Win32Exception(-procInfo.pid, string.Concat(new string[] { "ApplicationName='", startInfo.FileName, "', CommandLine='", startInfo.Arguments, "', CurrentDirectory='", startInfo.WorkingDirectory, "'" }));
|
||||
}
|
||||
process.process_handle = procInfo.process_handle;
|
||||
process.pid = procInfo.pid;
|
||||
if (startInfo.RedirectStandardInput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(intPtr, out monoIOError);
|
||||
process.input_stream = new StreamWriter(new global::System.IO.MonoSyncFileStream(intPtr2, FileAccess.Write, true, 8192), Console.Out.Encoding);
|
||||
process.input_stream.AutoFlush = true;
|
||||
}
|
||||
Encoding encoding = startInfo.StandardOutputEncoding ?? Console.Out.Encoding;
|
||||
Encoding encoding2 = startInfo.StandardErrorEncoding ?? Console.Out.Encoding;
|
||||
if (startInfo.RedirectStandardOutput)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(consoleOutput, out monoIOError);
|
||||
process.output_stream = new StreamReader(new global::System.IO.MonoSyncFileStream(process.stdout_rd, FileAccess.Read, true, 8192), encoding, true, 8192);
|
||||
}
|
||||
if (startInfo.RedirectStandardError)
|
||||
{
|
||||
global::System.IO.MonoIOError monoIOError;
|
||||
global::System.IO.MonoIO.Close(consoleError, out monoIOError);
|
||||
process.error_stream = new StreamReader(new global::System.IO.MonoSyncFileStream(process.stderr_rd, FileAccess.Read, true, 8192), encoding2, true, 8192);
|
||||
}
|
||||
process.StartExitCallbackIfNeeded();
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06000815 RID: 2069 RVA: 0x00015A30 File Offset: 0x00013C30
|
||||
private static void FillUserInfo(ProcessStartInfo startInfo, ref Process.ProcInfo proc_info)
|
||||
{
|
||||
if (startInfo.UserName != null)
|
||||
{
|
||||
proc_info.UserName = startInfo.UserName;
|
||||
proc_info.Domain = startInfo.Domain;
|
||||
if (startInfo.Password != null)
|
||||
{
|
||||
proc_info.Password = Marshal.SecureStringToBSTR(startInfo.Password);
|
||||
}
|
||||
else
|
||||
{
|
||||
proc_info.Password = IntPtr.Zero;
|
||||
}
|
||||
proc_info.LoadUserProfile = startInfo.LoadUserProfile;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000816 RID: 2070 RVA: 0x00015A98 File Offset: 0x00013C98
|
||||
private static bool Start_common(ProcessStartInfo startInfo, Process process)
|
||||
{
|
||||
if (startInfo.FileName == null || startInfo.FileName.Length == 0)
|
||||
{
|
||||
throw new InvalidOperationException("File name has not been set");
|
||||
}
|
||||
if (startInfo.StandardErrorEncoding != null && !startInfo.RedirectStandardError)
|
||||
{
|
||||
throw new InvalidOperationException("StandardErrorEncoding is only supported when standard error is redirected");
|
||||
}
|
||||
if (startInfo.StandardOutputEncoding != null && !startInfo.RedirectStandardOutput)
|
||||
{
|
||||
throw new InvalidOperationException("StandardOutputEncoding is only supported when standard output is redirected");
|
||||
}
|
||||
if (!startInfo.UseShellExecute)
|
||||
{
|
||||
return Process.Start_noshell(startInfo, process);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(startInfo.UserName))
|
||||
{
|
||||
throw new InvalidOperationException("UserShellExecute must be false if an explicit UserName is specified when starting a process");
|
||||
}
|
||||
return Process.Start_shell(startInfo, process);
|
||||
}
|
||||
|
||||
/// <summary>Starts (or reuses) the process resource that is specified by the <see cref="P:System.Diagnostics.Process.StartInfo" /> property of this <see cref="T:System.Diagnostics.Process" /> component and associates it with the component.</summary>
|
||||
/// <returns>true if a process resource is started; false if no new process resource is started (for example, if an existing process is reused).</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">No file name was specified in the <see cref="T:System.Diagnostics.Process" /> component's <see cref="P:System.Diagnostics.Process.StartInfo" />.-or- The <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> member of the <see cref="P:System.Diagnostics.Process.StartInfo" /> property is true while <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardInput" />, <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardOutput" />, or <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardError" /> is true. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">There was an error in opening the associated file. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The process object has already been disposed. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000817 RID: 2071 RVA: 0x00015B44 File Offset: 0x00013D44
|
||||
public bool Start()
|
||||
{
|
||||
if (this.process_handle != IntPtr.Zero)
|
||||
{
|
||||
this.Process_free_internal(this.process_handle);
|
||||
this.process_handle = IntPtr.Zero;
|
||||
}
|
||||
return Process.Start_common(this.start_info, this);
|
||||
}
|
||||
|
||||
/// <summary>Starts the process resource that is specified by the parameter containing process start information (for example, the file name of the process to start) and associates the resource with a new <see cref="T:System.Diagnostics.Process" /> component.</summary>
|
||||
/// <returns>A new <see cref="T:System.Diagnostics.Process" /> component that is associated with the process resource, or null if no process resource is started (for example, if an existing process is reused).</returns>
|
||||
/// <param name="startInfo">The <see cref="T:System.Diagnostics.ProcessStartInfo" /> that contains the information that is used to start the process, including the file name and any command-line arguments. </param>
|
||||
/// <exception cref="T:System.InvalidOperationException">No file name was specified in the <paramref name="startInfo" /> parameter's <see cref="P:System.Diagnostics.ProcessStartInfo.FileName" /> property.-or- The <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> property of the <paramref name="startInfo" /> parameter is true and the <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardInput" />, <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardOutput" />, or <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardError" /> property is also true.-or-The <see cref="P:System.Diagnostics.ProcessStartInfo.UseShellExecute" /> property of the <paramref name="startInfo" /> parameter is true and the <see cref="P:System.Diagnostics.ProcessStartInfo.UserName" /> property is not null or empty or the <see cref="P:System.Diagnostics.ProcessStartInfo.Password" /> property is not null.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="startInfo" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">There was an error in opening the associated file. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The process object has already been disposed. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file specified in the <paramref name="startInfo" /> parameter's <see cref="P:System.Diagnostics.ProcessStartInfo.FileName" /> property could not be found.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">An error occurred when opening the associated file. -or-The sum of the length of the arguments and the length of the full path to the process exceeds 2080. The error message associated with this exception can be one of the following: "The data area passed to a system call is too small." or "Access is denied."</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000818 RID: 2072 RVA: 0x00015B8C File Offset: 0x00013D8C
|
||||
public static Process Start(ProcessStartInfo startInfo)
|
||||
{
|
||||
if (startInfo == null)
|
||||
{
|
||||
throw new ArgumentNullException("startInfo");
|
||||
}
|
||||
Process process = new Process();
|
||||
process.StartInfo = startInfo;
|
||||
if (Process.Start_common(startInfo, process))
|
||||
{
|
||||
return process;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Starts a process resource by specifying the name of a document or application file and associates the resource with a new <see cref="T:System.Diagnostics.Process" /> component.</summary>
|
||||
/// <returns>A new <see cref="T:System.Diagnostics.Process" /> component that is associated with the process resource, or null, if no process resource is started (for example, if an existing process is reused).</returns>
|
||||
/// <param name="fileName">The name of a document or application file to run in the process. </param>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">An error occurred when opening the associated file. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The process object has already been disposed. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The PATH environment variable has a string containing quotes.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000819 RID: 2073 RVA: 0x00015BC8 File Offset: 0x00013DC8
|
||||
public static Process Start(string fileName)
|
||||
{
|
||||
return Process.Start(new ProcessStartInfo(fileName));
|
||||
}
|
||||
|
||||
/// <summary>Starts a process resource by specifying the name of an application and a set of command-line arguments, and associates the resource with a new <see cref="T:System.Diagnostics.Process" /> component.</summary>
|
||||
/// <returns>A new <see cref="T:System.Diagnostics.Process" /> component that is associated with the process, or null, if no process resource is started (for example, if an existing process is reused).</returns>
|
||||
/// <param name="fileName">The name of an application file to run in the process. </param>
|
||||
/// <param name="arguments">Command-line arguments to pass when starting the process. </param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <paramref name="fileName" /> or <paramref name="arguments" /> parameter is null. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">An error occurred when opening the associated file. -or-The sum of the length of the arguments and the length of the full path to the process exceeds 2080. The error message associated with this exception can be one of the following: "The data area passed to a system call is too small." or "Access is denied."</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The process object has already been disposed. </exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The PATH environment variable has a string containing quotes.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600081A RID: 2074 RVA: 0x00015BD8 File Offset: 0x00013DD8
|
||||
public static Process Start(string fileName, string arguments)
|
||||
{
|
||||
return Process.Start(new ProcessStartInfo(fileName, arguments));
|
||||
}
|
||||
|
||||
/// <summary>Starts a process resource by specifying the name of an application, a user name, a password, and a domain and associates the resource with a new <see cref="T:System.Diagnostics.Process" /> component.</summary>
|
||||
/// <returns>A new <see cref="T:System.Diagnostics.Process" /> component that is associated with the process resource, or null if no process resource is started (for example, if an existing process is reused).</returns>
|
||||
/// <param name="fileName">The name of an application file to run in the process.</param>
|
||||
/// <param name="userName">The user name to use when starting the process.</param>
|
||||
/// <param name="password">A <see cref="T:System.Security.SecureString" /> that contains the password to use when starting the process.</param>
|
||||
/// <param name="domain">The domain to use when starting the process.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">No file name was specified. </exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">
|
||||
/// <paramref name="fileName" /> is not an executable (.exe) file.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">There was an error in opening the associated file. </exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The process object has already been disposed. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600081B RID: 2075 RVA: 0x00015BE8 File Offset: 0x00013DE8
|
||||
public static Process Start(string fileName, string username, SecureString password, string domain)
|
||||
{
|
||||
return Process.Start(fileName, null, username, password, domain);
|
||||
}
|
||||
|
||||
/// <summary>Starts a process resource by specifying the name of an application, a set of command-line arguments, a user name, a password, and a domain and associates the resource with a new <see cref="T:System.Diagnostics.Process" /> component.</summary>
|
||||
/// <returns>A new <see cref="T:System.Diagnostics.Process" /> component that is associated with the process resource, or null if no process resource is started (for example, if an existing process is reused).</returns>
|
||||
/// <param name="fileName">The name of an application file to run in the process. </param>
|
||||
/// <param name="arguments">Command-line arguments to pass when starting the process. </param>
|
||||
/// <param name="userName">The user name to use when starting the process.</param>
|
||||
/// <param name="password">A <see cref="T:System.Security.SecureString" /> that contains the password to use when starting the process.</param>
|
||||
/// <param name="domain">The domain to use when starting the process.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">No file name was specified.</exception>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">An error occurred when opening the associated file. -or-The sum of the length of the arguments and the length of the full path to the associated file exceeds 2080. The error message associated with this exception can be one of the following: "The data area passed to a system call is too small." or "Access is denied."</exception>
|
||||
/// <exception cref="T:System.ObjectDisposedException">The process object has already been disposed. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600081C RID: 2076 RVA: 0x00015BF4 File Offset: 0x00013DF4
|
||||
public static Process Start(string fileName, string arguments, string username, SecureString password, string domain)
|
||||
{
|
||||
return Process.Start(new ProcessStartInfo(fileName, arguments)
|
||||
{
|
||||
UserName = username,
|
||||
Password = password,
|
||||
Domain = domain,
|
||||
UseShellExecute = false
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Formats the process's name as a string, combined with the parent component type, if applicable.</summary>
|
||||
/// <returns>The <see cref="P:System.Diagnostics.Process.ProcessName" />, combined with the base component's <see cref="M:System.Object.ToString" /> return value.</returns>
|
||||
/// <exception cref="T:System.PlatformNotSupportedException">
|
||||
/// <see cref="M:System.Diagnostics.Process.ToString" /> is not supported on Windows 98.</exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x0600081D RID: 2077 RVA: 0x00015C2C File Offset: 0x00013E2C
|
||||
public override string ToString()
|
||||
{
|
||||
return base.ToString() + " (" + this.ProcessName + ")";
|
||||
}
|
||||
|
||||
// Token: 0x0600081E RID: 2078
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern bool WaitForExit_internal(IntPtr handle, int ms);
|
||||
|
||||
/// <summary>Instructs the <see cref="T:System.Diagnostics.Process" /> component to wait indefinitely for the associated process to exit.</summary>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">The wait setting could not be accessed. </exception>
|
||||
/// <exception cref="T:System.SystemException">No process <see cref="P:System.Diagnostics.Process.Id" /> has been set, and a <see cref="P:System.Diagnostics.Process.Handle" /> from which the <see cref="P:System.Diagnostics.Process.Id" /> property can be determined does not exist.-or- There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object.-or- You are attempting to call <see cref="M:System.Diagnostics.Process.WaitForExit" /> for a process that is running on a remote computer. This method is available only for processes that are running on the local computer. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x0600081F RID: 2079 RVA: 0x00015C54 File Offset: 0x00013E54
|
||||
public void WaitForExit()
|
||||
{
|
||||
this.WaitForExit(-1);
|
||||
}
|
||||
|
||||
/// <summary>Instructs the <see cref="T:System.Diagnostics.Process" /> component to wait the specified number of milliseconds for the associated process to exit.</summary>
|
||||
/// <returns>true if the associated process has exited; otherwise, false.</returns>
|
||||
/// <param name="milliseconds">The amount of time, in milliseconds, to wait for the associated process to exit. The maximum is the largest possible value of a 32-bit integer, which represents infinity to the operating system. </param>
|
||||
/// <exception cref="T:System.ComponentModel.Win32Exception">The wait setting could not be accessed. </exception>
|
||||
/// <exception cref="T:System.SystemException">No process <see cref="P:System.Diagnostics.Process.Id" /> has been set, and a <see cref="P:System.Diagnostics.Process.Handle" /> from which the <see cref="P:System.Diagnostics.Process.Id" /> property can be determined does not exist.-or- There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object.-or- You are attempting to call <see cref="M:System.Diagnostics.Process.WaitForExit(System.Int32)" /> for a process that is running on a remote computer. This method is available only for processes that are running on the local computer. </exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000820 RID: 2080 RVA: 0x00015C60 File Offset: 0x00013E60
|
||||
public bool WaitForExit(int milliseconds)
|
||||
{
|
||||
int num = milliseconds;
|
||||
if (num == 2147483647)
|
||||
{
|
||||
num = -1;
|
||||
}
|
||||
DateTime dateTime = DateTime.UtcNow;
|
||||
if (this.async_output != null && !this.async_output.IsCompleted)
|
||||
{
|
||||
if (!this.async_output.WaitHandle.WaitOne(num, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (num >= 0)
|
||||
{
|
||||
DateTime utcNow = DateTime.UtcNow;
|
||||
num -= (int)(utcNow - dateTime).TotalMilliseconds;
|
||||
if (num <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
dateTime = utcNow;
|
||||
}
|
||||
}
|
||||
if (this.async_error != null && !this.async_error.IsCompleted)
|
||||
{
|
||||
if (!this.async_error.WaitHandle.WaitOne(num, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (num >= 0)
|
||||
{
|
||||
num -= (int)(DateTime.UtcNow - dateTime).TotalMilliseconds;
|
||||
if (num <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.WaitForExit_internal(this.process_handle, num);
|
||||
}
|
||||
|
||||
// Token: 0x06000821 RID: 2081
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern bool WaitForInputIdle_internal(IntPtr handle, int ms);
|
||||
|
||||
/// <summary>Causes the <see cref="T:System.Diagnostics.Process" /> component to wait indefinitely for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop.</summary>
|
||||
/// <returns>true if the associated process has reached an idle state.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process does not have a graphical interface.-or-An unknown error occurred. The process failed to enter an idle state.-or-The process has already exited. -or-No process is associated with this <see cref="T:System.Diagnostics.Process" /> object.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000822 RID: 2082 RVA: 0x00015D4C File Offset: 0x00013F4C
|
||||
[global::System.MonoTODO]
|
||||
public bool WaitForInputIdle()
|
||||
{
|
||||
return this.WaitForInputIdle(-1);
|
||||
}
|
||||
|
||||
/// <summary>Causes the <see cref="T:System.Diagnostics.Process" /> component to wait the specified number of milliseconds for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop.</summary>
|
||||
/// <returns>true if the associated process has reached an idle state; otherwise, false.</returns>
|
||||
/// <param name="milliseconds">A value of 1 to <see cref="F:System.Int32.MaxValue" /> that specifies the amount of time, in milliseconds, to wait for the associated process to become idle. A value of 0 specifies an immediate return, and a value of -1 specifies an infinite wait. </param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The process does not have a graphical interface.-or-An unknown error occurred. The process failed to enter an idle state.-or-The process has already exited. -or-No process is associated with this <see cref="T:System.Diagnostics.Process" /> object.</exception>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
// Token: 0x06000823 RID: 2083 RVA: 0x00015D58 File Offset: 0x00013F58
|
||||
[global::System.MonoTODO]
|
||||
public bool WaitForInputIdle(int milliseconds)
|
||||
{
|
||||
return this.WaitForInputIdle_internal(this.process_handle, milliseconds);
|
||||
}
|
||||
|
||||
// Token: 0x06000824 RID: 2084 RVA: 0x00015D68 File Offset: 0x00013F68
|
||||
private static bool IsLocalMachine(string machineName)
|
||||
{
|
||||
return machineName == "." || machineName.Length == 0 || string.Compare(machineName, Environment.MachineName, true) == 0;
|
||||
}
|
||||
|
||||
// Token: 0x06000825 RID: 2085 RVA: 0x00015DA4 File Offset: 0x00013FA4
|
||||
private void OnOutputDataReceived(string str)
|
||||
{
|
||||
if (this.OutputDataReceived != null)
|
||||
{
|
||||
this.OutputDataReceived(this, new DataReceivedEventArgs(str));
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000826 RID: 2086 RVA: 0x00015DC4 File Offset: 0x00013FC4
|
||||
private void OnErrorDataReceived(string str)
|
||||
{
|
||||
if (this.ErrorDataReceived != null)
|
||||
{
|
||||
this.ErrorDataReceived(this, new DataReceivedEventArgs(str));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Begins asynchronous read operations on the redirected <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream of the application.</summary>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardOutput" /> property is false.- or - An asynchronous read operation is already in progress on the <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream.- or - The <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream has been used by a synchronous read operation. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x06000827 RID: 2087 RVA: 0x00015DE4 File Offset: 0x00013FE4
|
||||
[ComVisible(false)]
|
||||
public void BeginOutputReadLine()
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero || this.output_stream == null || !this.StartInfo.RedirectStandardOutput)
|
||||
{
|
||||
throw new InvalidOperationException("Standard output has not been redirected or process has not been started.");
|
||||
}
|
||||
if ((this.async_mode & Process.AsyncModes.SyncOutput) != Process.AsyncModes.NoneYet)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot mix asynchronous and synchonous reads.");
|
||||
}
|
||||
this.async_mode |= Process.AsyncModes.AsyncOutput;
|
||||
this.output_canceled = false;
|
||||
if (this.async_output == null)
|
||||
{
|
||||
this.async_output = new Process.ProcessAsyncReader(this, this.stdout_rd, true);
|
||||
this.async_output.ReadHandler.BeginInvoke(null, this.async_output);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Cancels the asynchronous read operation on the redirected <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream of an application.</summary>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.StandardOutput" /> stream is not enabled for asynchronous read operations. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x06000828 RID: 2088 RVA: 0x00015E90 File Offset: 0x00014090
|
||||
[ComVisible(false)]
|
||||
public void CancelOutputRead()
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero || this.output_stream == null || !this.StartInfo.RedirectStandardOutput)
|
||||
{
|
||||
throw new InvalidOperationException("Standard output has not been redirected or process has not been started.");
|
||||
}
|
||||
if ((this.async_mode & Process.AsyncModes.SyncOutput) != Process.AsyncModes.NoneYet)
|
||||
{
|
||||
throw new InvalidOperationException("OutputStream is not enabled for asynchronous read operations.");
|
||||
}
|
||||
if (this.async_output == null)
|
||||
{
|
||||
throw new InvalidOperationException("No async operation in progress.");
|
||||
}
|
||||
this.output_canceled = true;
|
||||
}
|
||||
|
||||
/// <summary>Begins asynchronous read operations on the redirected <see cref="P:System.Diagnostics.Process.StandardError" /> stream of the application.</summary>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.ProcessStartInfo.RedirectStandardError" /> property is false.- or - An asynchronous read operation is already in progress on the <see cref="P:System.Diagnostics.Process.StandardError" /> stream.- or - The <see cref="P:System.Diagnostics.Process.StandardError" /> stream has been used by a synchronous read operation. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x06000829 RID: 2089 RVA: 0x00015F10 File Offset: 0x00014110
|
||||
[ComVisible(false)]
|
||||
public void BeginErrorReadLine()
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero || this.error_stream == null || !this.StartInfo.RedirectStandardError)
|
||||
{
|
||||
throw new InvalidOperationException("Standard error has not been redirected or process has not been started.");
|
||||
}
|
||||
if ((this.async_mode & Process.AsyncModes.SyncError) != Process.AsyncModes.NoneYet)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot mix asynchronous and synchonous reads.");
|
||||
}
|
||||
this.async_mode |= Process.AsyncModes.AsyncError;
|
||||
this.error_canceled = false;
|
||||
if (this.async_error == null)
|
||||
{
|
||||
this.async_error = new Process.ProcessAsyncReader(this, this.stderr_rd, false);
|
||||
this.async_error.ReadHandler.BeginInvoke(null, this.async_error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Cancels the asynchronous read operation on the redirected <see cref="P:System.Diagnostics.Process.StandardError" /> stream of an application.</summary>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Diagnostics.Process.StandardError" /> stream is not enabled for asynchronous read operations. </exception>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
// Token: 0x0600082A RID: 2090 RVA: 0x00015FBC File Offset: 0x000141BC
|
||||
[ComVisible(false)]
|
||||
public void CancelErrorRead()
|
||||
{
|
||||
if (this.process_handle == IntPtr.Zero || this.output_stream == null || !this.StartInfo.RedirectStandardOutput)
|
||||
{
|
||||
throw new InvalidOperationException("Standard output has not been redirected or process has not been started.");
|
||||
}
|
||||
if ((this.async_mode & Process.AsyncModes.SyncOutput) != Process.AsyncModes.NoneYet)
|
||||
{
|
||||
throw new InvalidOperationException("OutputStream is not enabled for asynchronous read operations.");
|
||||
}
|
||||
if (this.async_error == null)
|
||||
{
|
||||
throw new InvalidOperationException("No async operation in progress.");
|
||||
}
|
||||
this.error_canceled = true;
|
||||
}
|
||||
|
||||
// Token: 0x0600082B RID: 2091
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void Process_free_internal(IntPtr handle);
|
||||
|
||||
/// <summary>Release all resources used by this process.</summary>
|
||||
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
|
||||
// Token: 0x0600082C RID: 2092 RVA: 0x0001603C File Offset: 0x0001423C
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (!this.disposed)
|
||||
{
|
||||
this.disposed = true;
|
||||
if (disposing)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (this.async_output != null)
|
||||
{
|
||||
this.async_output.Close();
|
||||
}
|
||||
if (this.async_error != null)
|
||||
{
|
||||
this.async_error.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
lock (this)
|
||||
{
|
||||
if (this.process_handle != IntPtr.Zero)
|
||||
{
|
||||
this.Process_free_internal(this.process_handle);
|
||||
this.process_handle = IntPtr.Zero;
|
||||
}
|
||||
if (this.input_stream != null)
|
||||
{
|
||||
this.input_stream.Close();
|
||||
this.input_stream = null;
|
||||
}
|
||||
if (this.output_stream != null)
|
||||
{
|
||||
this.output_stream.Close();
|
||||
this.output_stream = null;
|
||||
}
|
||||
if (this.error_stream != null)
|
||||
{
|
||||
this.error_stream.Close();
|
||||
this.error_stream = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
// Token: 0x0600082D RID: 2093 RVA: 0x00016174 File Offset: 0x00014374
|
||||
~Process()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
// Token: 0x0600082E RID: 2094 RVA: 0x000161B0 File Offset: 0x000143B0
|
||||
private static void CBOnExit(object state, bool unused)
|
||||
{
|
||||
Process process = (Process)state;
|
||||
process.OnExited();
|
||||
}
|
||||
|
||||
/// <summary>Raises the <see cref="E:System.Diagnostics.Process.Exited" /> event.</summary>
|
||||
// Token: 0x0600082F RID: 2095 RVA: 0x000161CC File Offset: 0x000143CC
|
||||
protected void OnExited()
|
||||
{
|
||||
if (this.exited_event == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.synchronizingObject == null)
|
||||
{
|
||||
foreach (EventHandler eventHandler in this.exited_event.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
eventHandler(this, EventArgs.Empty);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
object[] array = new object[]
|
||||
{
|
||||
this,
|
||||
EventArgs.Empty
|
||||
};
|
||||
this.synchronizingObject.BeginInvoke(this.exited_event, array);
|
||||
}
|
||||
|
||||
// Token: 0x17000215 RID: 533
|
||||
// (get) Token: 0x06000830 RID: 2096 RVA: 0x00016274 File Offset: 0x00014474
|
||||
private static bool IsWindows
|
||||
{
|
||||
get
|
||||
{
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
return platform == PlatformID.Win32S || platform == PlatformID.Win32Windows || platform == PlatformID.Win32NT || platform == PlatformID.WinCE;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000242 RID: 578
|
||||
private IntPtr process_handle;
|
||||
|
||||
// Token: 0x04000243 RID: 579
|
||||
private int pid;
|
||||
|
||||
// Token: 0x04000244 RID: 580
|
||||
private bool enableRaisingEvents;
|
||||
|
||||
// Token: 0x04000245 RID: 581
|
||||
private bool already_waiting;
|
||||
|
||||
// Token: 0x04000246 RID: 582
|
||||
private global::System.ComponentModel.ISynchronizeInvoke synchronizingObject;
|
||||
|
||||
// Token: 0x04000247 RID: 583
|
||||
private EventHandler exited_event;
|
||||
|
||||
// Token: 0x04000248 RID: 584
|
||||
private IntPtr stdout_rd;
|
||||
|
||||
// Token: 0x04000249 RID: 585
|
||||
private IntPtr stderr_rd;
|
||||
|
||||
// Token: 0x0400024A RID: 586
|
||||
private ProcessModuleCollection module_collection;
|
||||
|
||||
// Token: 0x0400024B RID: 587
|
||||
private string process_name;
|
||||
|
||||
// Token: 0x0400024C RID: 588
|
||||
private StreamReader error_stream;
|
||||
|
||||
// Token: 0x0400024D RID: 589
|
||||
private StreamWriter input_stream;
|
||||
|
||||
// Token: 0x0400024E RID: 590
|
||||
private StreamReader output_stream;
|
||||
|
||||
// Token: 0x0400024F RID: 591
|
||||
private ProcessStartInfo start_info;
|
||||
|
||||
// Token: 0x04000250 RID: 592
|
||||
private Process.AsyncModes async_mode;
|
||||
|
||||
// Token: 0x04000251 RID: 593
|
||||
private bool output_canceled;
|
||||
|
||||
// Token: 0x04000252 RID: 594
|
||||
private bool error_canceled;
|
||||
|
||||
// Token: 0x04000253 RID: 595
|
||||
private Process.ProcessAsyncReader async_output;
|
||||
|
||||
// Token: 0x04000254 RID: 596
|
||||
private Process.ProcessAsyncReader async_error;
|
||||
|
||||
// Token: 0x04000255 RID: 597
|
||||
private bool disposed;
|
||||
|
||||
// Token: 0x020000E6 RID: 230
|
||||
private struct ProcInfo
|
||||
{
|
||||
// Token: 0x04000258 RID: 600
|
||||
public IntPtr process_handle;
|
||||
|
||||
// Token: 0x04000259 RID: 601
|
||||
public IntPtr thread_handle;
|
||||
|
||||
// Token: 0x0400025A RID: 602
|
||||
public int pid;
|
||||
|
||||
// Token: 0x0400025B RID: 603
|
||||
public int tid;
|
||||
|
||||
// Token: 0x0400025C RID: 604
|
||||
public string[] envKeys;
|
||||
|
||||
// Token: 0x0400025D RID: 605
|
||||
public string[] envValues;
|
||||
|
||||
// Token: 0x0400025E RID: 606
|
||||
public string UserName;
|
||||
|
||||
// Token: 0x0400025F RID: 607
|
||||
public string Domain;
|
||||
|
||||
// Token: 0x04000260 RID: 608
|
||||
public IntPtr Password;
|
||||
|
||||
// Token: 0x04000261 RID: 609
|
||||
public bool LoadUserProfile;
|
||||
}
|
||||
|
||||
// Token: 0x020000E7 RID: 231
|
||||
[Flags]
|
||||
private enum AsyncModes
|
||||
{
|
||||
// Token: 0x04000263 RID: 611
|
||||
NoneYet = 0,
|
||||
// Token: 0x04000264 RID: 612
|
||||
SyncOutput = 1,
|
||||
// Token: 0x04000265 RID: 613
|
||||
SyncError = 2,
|
||||
// Token: 0x04000266 RID: 614
|
||||
AsyncOutput = 4,
|
||||
// Token: 0x04000267 RID: 615
|
||||
AsyncError = 8
|
||||
}
|
||||
|
||||
// Token: 0x020000E8 RID: 232
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private sealed class ProcessAsyncReader
|
||||
{
|
||||
// Token: 0x06000831 RID: 2097 RVA: 0x000162AC File Offset: 0x000144AC
|
||||
public ProcessAsyncReader(Process process, IntPtr handle, bool err_out)
|
||||
{
|
||||
this.process = process;
|
||||
this.handle = handle;
|
||||
this.stream = new FileStream(handle, FileAccess.Read, false);
|
||||
this.ReadHandler = new Process.AsyncReadHandler(this.AddInput);
|
||||
this.err_out = err_out;
|
||||
}
|
||||
|
||||
// Token: 0x06000832 RID: 2098 RVA: 0x00016318 File Offset: 0x00014518
|
||||
public void AddInput()
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
int num = this.stream.Read(this.buffer, 0, this.buffer.Length);
|
||||
if (num == 0)
|
||||
{
|
||||
this.completed = true;
|
||||
if (this.wait_handle != null)
|
||||
{
|
||||
this.wait_handle.Set();
|
||||
}
|
||||
this.FlushLast();
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.sb.Append(Encoding.Default.GetString(this.buffer, 0, num));
|
||||
}
|
||||
catch
|
||||
{
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
this.sb.Append((char)this.buffer[i]);
|
||||
}
|
||||
}
|
||||
this.Flush(false);
|
||||
this.ReadHandler.BeginInvoke(null, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000833 RID: 2099 RVA: 0x0001641C File Offset: 0x0001461C
|
||||
private void FlushLast()
|
||||
{
|
||||
this.Flush(true);
|
||||
if (this.err_out)
|
||||
{
|
||||
this.process.OnOutputDataReceived(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.process.OnErrorDataReceived(null);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000834 RID: 2100 RVA: 0x00016450 File Offset: 0x00014650
|
||||
private void Flush(bool last)
|
||||
{
|
||||
if (this.sb.Length == 0 || (this.err_out && this.process.output_canceled) || (!this.err_out && this.process.error_canceled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string text = this.sb.ToString();
|
||||
this.sb.Length = 0;
|
||||
string[] array = text.Split(new char[] { '\n' });
|
||||
int num = array.Length;
|
||||
if (num == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < num - 1; i++)
|
||||
{
|
||||
if (this.err_out)
|
||||
{
|
||||
this.process.OnOutputDataReceived(array[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.process.OnErrorDataReceived(array[i]);
|
||||
}
|
||||
}
|
||||
string text2 = array[num - 1];
|
||||
if (last || (num == 1 && text2 == string.Empty))
|
||||
{
|
||||
if (this.err_out)
|
||||
{
|
||||
this.process.OnOutputDataReceived(text2);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.process.OnErrorDataReceived(text2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.sb.Append(text2);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000216 RID: 534
|
||||
// (get) Token: 0x06000835 RID: 2101 RVA: 0x0001657C File Offset: 0x0001477C
|
||||
public bool IsCompleted
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.completed;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000217 RID: 535
|
||||
// (get) Token: 0x06000836 RID: 2102 RVA: 0x00016584 File Offset: 0x00014784
|
||||
public WaitHandle WaitHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
WaitHandle waitHandle;
|
||||
lock (this)
|
||||
{
|
||||
if (this.wait_handle == null)
|
||||
{
|
||||
this.wait_handle = new ManualResetEvent(this.completed);
|
||||
}
|
||||
waitHandle = this.wait_handle;
|
||||
}
|
||||
return waitHandle;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000837 RID: 2103 RVA: 0x000165EC File Offset: 0x000147EC
|
||||
public void Close()
|
||||
{
|
||||
this.stream.Close();
|
||||
}
|
||||
|
||||
// Token: 0x04000268 RID: 616
|
||||
public object Sock;
|
||||
|
||||
// Token: 0x04000269 RID: 617
|
||||
public IntPtr handle;
|
||||
|
||||
// Token: 0x0400026A RID: 618
|
||||
public object state;
|
||||
|
||||
// Token: 0x0400026B RID: 619
|
||||
public AsyncCallback callback;
|
||||
|
||||
// Token: 0x0400026C RID: 620
|
||||
public ManualResetEvent wait_handle;
|
||||
|
||||
// Token: 0x0400026D RID: 621
|
||||
public Exception delayedException;
|
||||
|
||||
// Token: 0x0400026E RID: 622
|
||||
public object EndPoint;
|
||||
|
||||
// Token: 0x0400026F RID: 623
|
||||
private byte[] buffer = new byte[4196];
|
||||
|
||||
// Token: 0x04000270 RID: 624
|
||||
public int Offset;
|
||||
|
||||
// Token: 0x04000271 RID: 625
|
||||
public int Size;
|
||||
|
||||
// Token: 0x04000272 RID: 626
|
||||
public int SockFlags;
|
||||
|
||||
// Token: 0x04000273 RID: 627
|
||||
public object AcceptSocket;
|
||||
|
||||
// Token: 0x04000274 RID: 628
|
||||
public object[] Addresses;
|
||||
|
||||
// Token: 0x04000275 RID: 629
|
||||
public int port;
|
||||
|
||||
// Token: 0x04000276 RID: 630
|
||||
public object Buffers;
|
||||
|
||||
// Token: 0x04000277 RID: 631
|
||||
public bool ReuseSocket;
|
||||
|
||||
// Token: 0x04000278 RID: 632
|
||||
public object acc_socket;
|
||||
|
||||
// Token: 0x04000279 RID: 633
|
||||
public int total;
|
||||
|
||||
// Token: 0x0400027A RID: 634
|
||||
public bool completed_sync;
|
||||
|
||||
// Token: 0x0400027B RID: 635
|
||||
private bool completed;
|
||||
|
||||
// Token: 0x0400027C RID: 636
|
||||
private bool err_out;
|
||||
|
||||
// Token: 0x0400027D RID: 637
|
||||
internal int error;
|
||||
|
||||
// Token: 0x0400027E RID: 638
|
||||
public int operation = 8;
|
||||
|
||||
// Token: 0x0400027F RID: 639
|
||||
public object ares;
|
||||
|
||||
// Token: 0x04000280 RID: 640
|
||||
public int EndCalled;
|
||||
|
||||
// Token: 0x04000281 RID: 641
|
||||
private Process process;
|
||||
|
||||
// Token: 0x04000282 RID: 642
|
||||
private Stream stream;
|
||||
|
||||
// Token: 0x04000283 RID: 643
|
||||
private StringBuilder sb = new StringBuilder();
|
||||
|
||||
// Token: 0x04000284 RID: 644
|
||||
public Process.AsyncReadHandler ReadHandler;
|
||||
}
|
||||
|
||||
// Token: 0x020000E9 RID: 233
|
||||
private class ProcessWaitHandle : WaitHandle
|
||||
{
|
||||
// Token: 0x06000838 RID: 2104 RVA: 0x000165FC File Offset: 0x000147FC
|
||||
public ProcessWaitHandle(IntPtr handle)
|
||||
{
|
||||
this.Handle = Process.ProcessWaitHandle.ProcessHandle_duplicate(handle);
|
||||
}
|
||||
|
||||
// Token: 0x06000839 RID: 2105
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern IntPtr ProcessHandle_duplicate(IntPtr handle);
|
||||
}
|
||||
|
||||
// Token: 0x02000308 RID: 776
|
||||
// (Invoke) Token: 0x06001BF9 RID: 7161
|
||||
private delegate void AsyncReadHandler();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user