473,659 Members | 3,420 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 4063
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 priority. It works great when run from visual studio, but as soon as i run it directly (whether in...
77
4571
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 long time (hundreds of milliseconds), but as each part of the process is complete, my worker thread...
1
8857
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 RunCommands(string cmds, ArrayList files) {
6
3073
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 System.Diagnostics.Process.Start( arg1 , arg2) when run in the code behind of a Visual Studio WebForm
0
1124
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
1813
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 is put on hold. When I exit the started program the output of the bat is flushed to my stream.
0
1750
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 checked with Process Explorer, and the .NET DLL is correctly associated to the w3wp process - yet...
6
3218
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 to it from an external link, it gets "object reference not set to an instance of an object" when I...
0
8428
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6179
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.