Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDick Porter <dick@acm.org>2007-12-19 17:25:14 +0300
committerDick Porter <dick@acm.org>2007-12-19 17:25:14 +0300
commit6ffa6c9dbc1fe340a54d43069d1ba3860d8a379f (patch)
tree3421ce0bdacb65ad3ebe4a9f714b0329aff8a0b6 /mcs/class/System/System.Diagnostics/Process.cs
parent6486fa984c8d4f08180fa55151715e7d37416717 (diff)
2007-12-19 Dick Porter <dick@ximian.com>
* Process.cs: Check that the process has been started before getting or setting the priority class. Fixes bug 348415. 2007-12-19 Dick Porter <dick@ximian.com> * Win32Exception.cs: Add text for error 5, Access denied. svn path=/trunk/mcs/; revision=91629
Diffstat (limited to 'mcs/class/System/System.Diagnostics/Process.cs')
-rw-r--r--mcs/class/System/System.Diagnostics/Process.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs
index 4472ae42a90..6ba92637bc3 100644
--- a/mcs/class/System/System.Diagnostics/Process.cs
+++ b/mcs/class/System/System.Diagnostics/Process.cs
@@ -486,6 +486,10 @@ namespace System.Diagnostics {
[MonitoringDescription ("The relative process priority.")]
public ProcessPriorityClass PriorityClass {
get {
+ if (process_handle == IntPtr.Zero) {
+ throw new InvalidOperationException ("Process has not been started.");
+ }
+
int error;
int prio = GetPriorityClass (process_handle, out error);
if (prio == 0)
@@ -493,6 +497,10 @@ namespace System.Diagnostics {
return (ProcessPriorityClass) prio;
}
set {
+ if (process_handle == IntPtr.Zero) {
+ throw new InvalidOperationException ("Process has not been started.");
+ }
+
// LAMESPEC: not documented on MSDN for NET_1_1
if (!Enum.IsDefined (typeof (ProcessPriorityClass), value))
throw new InvalidEnumArgumentException ();