home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rxprior.zip
/
README
next >
Wrap
Text File
|
1994-01-18
|
2KB
|
54 lines
----------------------------------------------------------------------
Copyright IBM Corp., 1993,1994. All Rights Reserved.
OS/2 is a registered trademark of the IBM Corp.
While the information provided herein is believed to be accurate, IBM
does not warrant the information, and the information is provided "as
is".
----------------------------------------------------------------------
This package contains the source for the rxPrior function package for
OS/2, as described in the OS/2 Developer Magazine, January/February
1994, pg. 73, by Andrei Malacinski and Patrick Mueller. Patrick can
be reached via the Internet at pmuellr@vnet.ibm.com.
The package is made up of five files:
README - this file
rxprior.c - the C source
rxprior.mak - the make file
rxprior.def - the .def file
rxprior.cmd - a REXX program to test the function package
To build the rxprior.dll file, just invoke make on the rxprior.mak
file. After building the .dll, you can run the rxprior.cmd test
program.
The sample code implements two functions: SysGetPriority() and
SysSetPriority(). These functions are used to query and set the
priority of the currently process.
SysGetPriority()
This function expects no parameters. It returns an 8-digit hex
string that indicates the priority of the current process. The
function returns the priority from a field in the info blocks
structure returned by the DosGetInfoBlocks() function.
SysSetPriority(delta,class,scope)
This function expects the delta parameter to be a number from -31 to
31, the class parameter to be one of the strings "NOCHANGE", IDLETIME",
"REGULAR", "TIMECRITICAL", or "FOREGROUNDSERVER", and the scope
parameter to be one of the strings "PROCESS", "PROCESSTREE" or
"THREAD". The parameters correspond to the values expected by
the DosSetPriority() function. The external function calls this
function and returns the return code from that function. The
delta parameter must be passed in, but the other two are optional.
Missing or incorrect parameters cause default values to be used.
The RxPrior.cmd file tests the external functions by calling
SysSetPriority() a number of times with different parameters. After
each call to SysSetPriority(), SysGetPriority() is called to determine
what the priority was set to. The resulting value is printed as output
from the program.