Issue in Setting Process Priority to Real Time
We are working on a C#.net GUI based application that reads data from USB at a faster rate and then plots in the GUI with the help of a plotter . We are trying to elevate the priority of this process(Entire application) to "Real Time" . This works under
Windows XP . But when the same code is run on a Windows 7 PC , the Process is NOT elevated to "Real Time" priority and in turn it is changed to "High" .
Under these circumstances , we are incurring data loss in USB layer on a Windows 7 . We tried logging to the same Windows 7 PC using a "Administrator" login/password and we were able to set the priority of the process(Entire application) to "Real Time" and
there was NO data loss in USB layer.
Now , why we are not able to elevate the priority from our application to "Real Time" using code when we are logged in as normal user with administrator rights but not in "Administrator" login ?
February 18th, 2011 5:57am
You must the Increase scheduling priortiy privilege (SeIncreaseBasePriorityPrivilege) to change the priority to real time."A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2011 9:07am
Hello Andre.Ziegler,
Thanks for your reply.
Is this something that can be done through code using C# or any other way? Or is this part of a Group Policy that can be edited through GPO editor ? Currently we have restrictions to change the policy for the current login Id .
I found something called NTRights.exe that is shipped along with windows ? Will this be able to help us changing the priviledge mode from a normal user login ?
Expecting your reply !!!
Regards,
Yashath
February 21st, 2011 6:32am
Hello Andre.Ziegler,
Thanks for your reply.
Is this something that can be done through code using C# or any other way?
yes. Uses this .Net library:
http://processprivileges.codeplex.com/"A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
Free Windows Admin Tool Kit Click here and download it now
February 21st, 2011 2:11pm
Hello Andre.Ziegler,
Many Thanks . Will check this out and get back .
Regards,
Yashath
February 21st, 2011 11:50pm
Hello Andre.Ziegler,
We tested out the code you pointed at
http://processprivileges.codeplex.com/
We logged in as a normal user(Not an Administrator) in Windows7 and we got the following output(privileges) only .
Shutdown => Enabled
ChangeNotify => Enabled
Undock => Disabled
IncreaseWorkingSet => Disabled
TimeZone => Disabled
Also we tried logging in as an Administrator in the same Windows7 PC and we got the following privileges .
ChangeNotify => Enabled
Security => Disabled
Backup => Disabled
Restore => Disabled
SystemTime => Disabled
Shutdown => Disabled
RemoteShutdown => Disabled
TakeOwnership => Disabled
Debug => Enabled
SystemEnvironment => Disabled
SystemProfile => Disabled
ProfileSingleProcess => Disabled
IncreaseBasePriority => Disabled
LoadDriver => Enabled
CreatePageFile => Disabled
IncreaseQuota => Disabled
Undock => Enabled
ManageVolume => Disabled
Impersonate => Enabled
CreateGlobal => Enabled
TakeOwnership => Enabled (PrivilegeModified)
It is very evident that we get the "IncreaseBasePriority" privilege only if we log in as Administrator .
By any ways can we do this in the Normal user login in Windows 7.
Please let us know your thoughts on this .
The same program works perfectly as expected in Windows XP , but not in Windows 7
Regards,
Yashath
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 7:04am
The same program works perfectly as expected in Windows XP , but not in Windows 7
also for normal users? What is the Privilege output for XP?"A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
February 22nd, 2011 11:24am
Hello Andre,
This is the output that we get when we run the first two snippets on a XP machine with normal user login.
TakeOwnership => Enabled
TakeOwnership => Disabled
/**********************************************/
ChangeNotify => Enabled
Security => Disabled
Backup => Disabled
Restore => Disabled
SystemTime => Disabled
Shutdown => Disabled
RemoteShutdown => Disabled
TakeOwnership => Disabled
Debug => Enabled
SystemEnvironment => Disabled
SystemProfile => Disabled
ProfileSingleProcess => Disabled
IncreaseBasePriority => Disabled
LoadDriver => Enabled
CreatePageFile => Disabled
IncreaseQuota => Disabled
Undock => Enabled
ManageVolume => Disabled
Impersonate => Enabled
CreateGlobal => Enabled
TakeOwnership => Enabled (PrivilegeModified)
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2011 2:49am
this is no normal XP. This is an admin account. Loading of drivers is not allowed for normal suers."A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
February 23rd, 2011 8:03am
Hello Andre,
We fixed this issue by adding "application.manifest" in our project and changing the requested execution level from "asInvoker" to "asarequireAdministrator" level .
But even then this needs a Local admin rights and not a "Administrator" login account.
Thanks & Regards,
Yashath
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2011 2:25am
this is by design. The name is UAC (User account control). You get a filtered token with user rights until you request admin rights (manifest, or selection "Run as administrator")"A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
February 26th, 2011 11:39am