Link to home
Start Free TrialLog in
Avatar of rosch
rosch

asked on

Executing One process alone in the PC.

Some form exists to execute a alone program in the PC, stopping all the other processes of sistema(screen rest, TSR...)
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nietod
nietod

From C++ you could do
__asm CLI

to prevent interrupts and do

__asm STI

to enable interrupts.
Avatar of rosch

ASKER

This dissable of interruptions will function for the processes in the WIN95? I am using Visual Microsoft Studio 5.0
>> This dissable of interruptions will function for the processes in the WIN95?
Not a chance.  These instructions will fail in protected mode (use of them will cause a general protection fault), since they would allow a program to crash the system if used incorrectly.  

However 16 bit program will still be allowed to use them (which is one of many reasons why 16 bit programs can crash the system).  This is about your only recourse.  The OS isn't going to provide any way for you to have exclusive use of the CPU and is designed to stop any attempt you make.  

Perhaps there is another way, like a high (realtime) thread priority, What are are you doing that you need this for?
Avatar of rosch

ASKER

>> Perhaps there is another way, like a high (realtime) thread priority, What are are you doing that you need this for?
 Yes.
How? I make VxD ring 0?
you can use SetPriorityClass() to set the thread's priority class to REALTIME_PRIORITY_CLASS and you can use SetThreadPriority() to set the priority to THREAD_PRIOROITY_TIME_CITICAL.  This does not guarantee that you get all the CPU time, but it comes close.  However, you can only do this for short periods of time or you could crash the system.

A device driver can use the STI and CLI instructions.  This pretty much insures complete CPU access.  I don't know if a VxD can use those instructions though.