Process priority/running from outside visual studio

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm writing my own task manager as I often change process priorities but have gotten myself into trouble on several occasions. I have discovered by keeping csrss.exe and explorer at the equal highest priority, I can keep the computer running ok, or at least recover. So that's what my program does - keeps itself and those programs with high enough priority. It works great when run from visual studio, but as soon as i run it directly (whether in release or debug mode) I cannot access the process priority of csrss.exe. Is this a security issue

The error message begins like this

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box

************** Exception Text *************
System.ComponentModel.Win32Exception: Access is denie
at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited
at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited
at System.Diagnostics.Process.GetProcessHandle(Int32 access
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value
at MyTaskManager.MyTaskManager.Me_Load(Object sender, EventArgs e) in C:\Documents and Settings\Richard Hart\My Documents\Visual Studio Projects\MyTaskManager\Form1.vb:line 11
 
Back
Top