


this.m_processAccess = 0x1F0FFF;
// System.Diagnostics.Process
/// <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 or has exited. 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>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), MonitoringDescription("ProcessHandle")]
public IntPtr Handle
{
get
{
this.EnsureState(Process.State.Associated);
return this.OpenProcessHandle(this.m_processAccess).DangerousGetHandle();
}
}
// System.Diagnostics.Process
private SafeProcessHandle OpenProcessHandle(int access)
{
if (!this.haveProcessHandle)
{
if (this.disposed)
{
throw new ObjectDisposedException(base.GetType().Name);
}
this.SetProcessHandle(this.GetProcessHandle(access));
}
return this.m_processHandle;
}
// System.Diagnostics.Process
private SafeProcessHandle GetProcessHandle(int access)
{
return this.GetProcessHandle(access, true);
}
// System.Diagnostics.Process
private SafeProcessHandle GetProcessHandle(int access, bool throwIfExited)
{
// .. snipped
this.EnsureState((Process.State)3);
SafeProcessHandle safeProcessHandle = SafeProcessHandle.InvalidHandle;
safeProcessHandle = ProcessManager.OpenProcess(this.processId, access, throwIfExited);
// .. snipped
}
? Any help..?