473,503 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process priority/running from outside visual studio

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(Int3 2 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(Proce ssPriorityClass 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

Nov 22 '05 #1
2 4030
The caller needs "SeDebugPrivilege".

Willy.

"wtfhits" <an*******@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
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 denied
at System.Diagnostics.ProcessManager.OpenProcess(Int3 2 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(Proce ssPriorityClass
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 113

Nov 22 '05 #2
The caller needs "SeDebugPrivilege".

Willy.

"wtfhits" <an*******@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
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 denied
at System.Diagnostics.ProcessManager.OpenProcess(Int3 2 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(Proce ssPriorityClass
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 113

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
373
by: wtfhits | last post by:
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...
77
4503
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
1
8813
by: JC | last post by:
I'm trying to create a GUI wrapper for dumpbin, and so I'm using the Process class to run the command-line application. The problem is that if I use Readline() to get the output from the...
6
3057
by: mg | last post by:
The following .exe and its parameters work correctly from the command prompt (it prints x.pdf without prompting the user. acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"...
0
1116
by: tomko | last post by:
Hi, When I start a console program using the Process calss inside the Visual Studio IDE (debug) all the output is redirected to my stream reader. But when I run the same program from outside the...
2
1809
by: tomko | last post by:
Hi, My program uses the Process class to start a bat file that starts an exe. When I run my program inside Visual Studio (debug) the bat and exe run in the background (are not visible) and all...
0
1742
by: ToadLurker | last post by:
Usually, to debug my .NET dll, I typically just run my web application until the DLL in question is invoked - at which point I can just attach to it via Visual Studio .Net, and debug it. Two weeks...
6
3210
by: GaryDean | last post by:
I see some references on debugging by attaching to a process. There are MSDN articles that show how to attach to a process for debugging. However, I can find no info on how exactly to get the...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.