473,569 Members | 2,676 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.Componen tModel.Win32Exc eption: Access is denie
at System.Diagnost ics.ProcessMana ger.OpenProcess (Int32 processId, Int32 access, Boolean throwIfExited
at System.Diagnost ics.Process.Get ProcessHandle(I nt32 access, Boolean throwIfExited
at System.Diagnost ics.Process.Get ProcessHandle(I nt32 access
at System.Diagnost ics.Process.set _PriorityClass( ProcessPriority Class value
at MyTaskManager.M yTaskManager.Me _Load(Object sender, EventArgs e) in C:\Documents and Settings\Richar d Hart\My Documents\Visua l Studio Projects\MyTask Manager\Form1.v b:line 11

Nov 22 '05 #1
2 4043
The caller needs "SeDebugPrivile ge".

Willy.

"wtfhits" <an*******@disc ussions.microso ft.com> wrote in message
news:FA******** *************** ***********@mic rosoft.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.Componen tModel.Win32Exc eption: Access is denied
at System.Diagnost ics.ProcessMana ger.OpenProcess (Int32 processId, Int32
access, Boolean throwIfExited)
at System.Diagnost ics.Process.Get ProcessHandle(I nt32 access, Boolean
throwIfExited)
at System.Diagnost ics.Process.Get ProcessHandle(I nt32 access)
at System.Diagnost ics.Process.set _PriorityClass( ProcessPriority Class
value)
at MyTaskManager.M yTaskManager.Me _Load(Object sender, EventArgs e) in
C:\Documents and Settings\Richar d Hart\My Documents\Visua l Studio
Projects\MyTask Manager\Form1.v b:line 113

Nov 22 '05 #2
The caller needs "SeDebugPrivile ge".

Willy.

"wtfhits" <an*******@disc ussions.microso ft.com> wrote in message
news:FA******** *************** ***********@mic rosoft.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.Componen tModel.Win32Exc eption: Access is denied
at System.Diagnost ics.ProcessMana ger.OpenProcess (Int32 processId, Int32
access, Boolean throwIfExited)
at System.Diagnost ics.Process.Get ProcessHandle(I nt32 access, Boolean
throwIfExited)
at System.Diagnost ics.Process.Get ProcessHandle(I nt32 access)
at System.Diagnost ics.Process.set _PriorityClass( ProcessPriority Class
value)
at MyTaskManager.M yTaskManager.Me _Load(Object sender, EventArgs e) in
C:\Documents and Settings\Richar d Hart\My Documents\Visua l Studio
Projects\MyTask Manager\Form1.v b: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 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...
77
4521
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 process starts is not especially important, but it must be complete within a small number of seconds. The operations I am performing do not take a...
1
8840
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 commandline app, it will hang when it comes to the command-prompt (there's no return to send it to readline). Here's the code: public bool...
6
3069
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" "HP LaserJet 3300 Series PCL" "DOT4_001" But, I have not been able to use the exe and its parameters as arguments #1 & #2 in...
0
1119
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 IDE the process opens a new shell window for the program and my program is put on hold. How can something work inside the IDE but not outside?!
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 their output is redirected to my stream reader. But when I try to run my program outside the IDE, the exe starts in it's own window and my prgram...
0
1748
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 ago I ran into a problem where Visual Studio would fail to recognize that the NET code is even associated to the IIS process - w3wp.exe. I have...
6
3215
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 debugging to work. I have a wizard page in the anonymous section of my website. If I run it as the startup page in VS it runs fine. But if I link...
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.