home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxprior.zip / README next >
Text File  |  1994-01-18  |  2KB  |  54 lines

  1. ----------------------------------------------------------------------
  2.    Copyright IBM Corp., 1993,1994.  All Rights Reserved.
  3.  
  4.    OS/2 is a registered trademark of the IBM Corp.
  5.  
  6.    While the information provided herein is believed to be accurate, IBM
  7.    does not warrant the information, and the information is provided "as
  8.    is".
  9. ----------------------------------------------------------------------
  10.  
  11. This package contains the source for the rxPrior function package for
  12. OS/2, as described in the OS/2 Developer Magazine, January/February
  13. 1994, pg. 73, by Andrei Malacinski and Patrick Mueller.  Patrick can
  14. be reached via the Internet at pmuellr@vnet.ibm.com.
  15.  
  16. The package is made up of five files:
  17.    README      - this file
  18.    rxprior.c   - the C source
  19.    rxprior.mak - the make file
  20.    rxprior.def - the .def file
  21.    rxprior.cmd - a REXX program to test the function package
  22.  
  23. To build the rxprior.dll file, just invoke make on the rxprior.mak
  24. file.  After building the .dll, you can run the rxprior.cmd test
  25. program.
  26.  
  27. The sample code implements two functions:  SysGetPriority() and
  28. SysSetPriority().  These functions are used to query and set the
  29. priority of the currently process.
  30.  
  31. SysGetPriority()
  32.    This function expects no parameters.  It returns an 8-digit hex
  33.    string that indicates the priority of the current process.  The
  34.    function returns the priority from a field in the info blocks
  35.    structure returned by the DosGetInfoBlocks() function.
  36.  
  37. SysSetPriority(delta,class,scope)
  38.    This function expects the delta parameter to be a number from -31 to
  39.    31, the class parameter to be one of the strings "NOCHANGE", IDLETIME",
  40.    "REGULAR", "TIMECRITICAL", or "FOREGROUNDSERVER",  and the scope
  41.    parameter to be one of the strings "PROCESS", "PROCESSTREE" or
  42.    "THREAD".  The parameters correspond to the values expected by
  43.    the DosSetPriority() function.  The external function calls this
  44.    function and returns the return code from that function.  The
  45.    delta parameter must be passed in, but the other two are optional.
  46.    Missing or incorrect parameters cause default values to be used.
  47.  
  48. The RxPrior.cmd file tests the external functions by calling
  49. SysSetPriority() a number of times with different parameters.  After
  50. each call to SysSetPriority(), SysGetPriority() is called to determine
  51. what the priority was set to.  The resulting value is printed as output
  52. from the program.
  53.  
  54.