home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / RUNNING2.ZIP / RUNNING2.DOC next >
Text File  |  1992-07-16  |  6KB  |  130 lines

  1. RUNNING2: Shows Processes Running in OS/2
  2. ----------------------------------------
  3.  
  4. ** Version 2.00 is for OS/2 2.00 **
  5.  
  6.  
  7. This program is released to the public domain and may be distributed
  8. freely by any means.
  9.  
  10. I have included the source code to RUNNING2 and to SLAY.  Please feel
  11. free to use them as long as the code is not used for commercial
  12. profit.  I would appreciate receiving copies of modifications at any
  13. of the below addresses.
  14.  
  15. RUNNING2 is a simple program which provides a listing of all processes
  16. currently being used by OS/2.  It provides information about the
  17. processes such as their PID, their PARENT PID, the internal module ID
  18. #, the number of children processes, the number of threads currently
  19. running in each process, and optionally a tree view of the process
  20. hierarchy.
  21.  
  22. Here is a sample of a listing of processes:
  23.  
  24.                                               ┌──────── Threads ────────┐
  25.                                                    ┌────── Threads ──────┐
  26. PID   PPID  Mod#  Process Name               Chld  Run   Ready Block Other
  27. ----  ----  ----  -------------------------  ----  ----- ----- ----- -----
  28. 03e9  0009  0004  CMD.EXE                      1                  1       
  29. 0009  0002  0004  FSHL.EXE                     1            1     1       
  30. 000b  0002  0005  FSHL.EXE                     0                  2       
  31. 000d  0002  0006  FSHL.EXE                     1                  1       
  32. 000f  0002  0007  FSHL.EXE                     1                  1       
  33. 0013  0002  0008  FSHL.EXE                     1                  1       
  34. 0003  0002  0000  HARDERR.EXE                  0                  3       
  35. 0002  0001  0001  PMSHELL.EXE                  7            3    15       
  36. 0005  0002  0011  PMSHELL.EXE                  0                 12       
  37. 03ea  03e9  0004  RUNNING2.EXE                 0      1                   
  38. 001b  0013  0008  STARTBBS.EXE                 0                        3 
  39. 0018  000d  0006  TE2.EXE                      0            1           2 
  40. 0019  000f  0007  TE2.EXE                      0                  1     2 
  41.  
  42. The PID is the process ID which might be used by a program such as
  43. SLAY (Included with RUNNING2) or KILL (Copyright (c) 1988, Ed Braaten and 
  44. available on many BBSs - inconvenient because it accepts PIDs in
  45. decimal format instead of my hexadecimal format) to totally remove a 
  46. process from the system.  The PPID is the parent process' PID and 
  47. the module # is a number used internally to identify the process.  
  48. The process name is the name of the executable.  The number of child 
  49. processes are followed by the number of threads categorized by state
  50. (Running/Ready/Blocked/Other).
  51.  
  52. If you invoke RUNNING2 with the -p flag, you will get a listing of the
  53. complete pathname that invoked the process.  The -t flag produces a
  54. tree view of the processes.  Here is an example with both flags.
  55.  
  56.                                                    ┌────── Threads ──────┐
  57. PID   PPID  Mod#  Process Name               Chld  Run   Ready Block Other
  58. ----  ----  ----  -------------------------  ----  ----- ----- ----- -----
  59. 03ed  0009  0004  CMD.EXE                      1                  1       
  60.                   L:\OS2\CMD.EXE
  61. 0009  0002  0004  FSHL.EXE                     1                  2       
  62.                   D:\BIN2\FSHL.EXE
  63. 000b  0002  0005  FSHL.EXE                     0                  2       
  64.                   D:\BIN2\FSHL.EXE
  65. 000d  0002  0006  FSHL.EXE                     1                  1       
  66.                   D:\BIN2\FSHL.EXE
  67. 000f  0002  0007  FSHL.EXE                     1                  1       
  68.                   D:\BIN2\FSHL.EXE
  69. 0013  0002  0008  FSHL.EXE                     1                  1       
  70.                   D:\BIN2\FSHL.EXE
  71. 0003  0002  0000  HARDERR.EXE                  0                  3       
  72.                   L:\OS2\SYSTEM\HARDERR.EXE
  73. 0002  0001  0001  PMSHELL.EXE                  7            3    15       
  74.                   L:\OS2\PMSHELL.EXE
  75. 0005  0002  0011  PMSHELL.EXE                  0                 12       
  76.                   L:\OS2\PMSHELL.EXE
  77. 03ee  03ed  0004  RUNNING2.EXE                 0      1                   
  78.                   H:\OS2\RUNNING2\RUNNING2.EXE
  79. 001b  0013  0008  STARTBBS.EXE                 0                  2     1 
  80.                   J:\HOST\STARTBBS.EXE
  81. 0018  000d  0006  TE2.EXE                      0            2     1       
  82.                   D:\BIN2\TE2.EXE
  83. 0019  000f  0007  TE2.EXE                      0            1     2       
  84.                   D:\BIN2\TE2.EXE
  85.  
  86. PID 0001
  87.  └─── PMSHELL.EXE (PID=0002)
  88.       ├─── FSHL.EXE (PID=0009)
  89.       │    └─── CMD.EXE (PID=03ed)
  90.       │         └─── RUNNING2.EXE (PID=03ee)
  91.       ├─── FSHL.EXE (PID=000b)
  92.       ├─── FSHL.EXE (PID=000d)
  93.       │    └─── TE2.EXE (PID=0018)
  94.       ├─── FSHL.EXE (PID=000f)
  95.       │    └─── TE2.EXE (PID=0019)
  96.       ├─── FSHL.EXE (PID=0013)
  97.       │    └─── STARTBBS.EXE (PID=001b)
  98.       ├─── HARDERR.EXE (PID=0003)
  99.       └─── PMSHELL.EXE (PID=0005)
  100.  
  101.  
  102. RUNNING2 has the following command line flags:
  103.  
  104.     -n  means do not sort list by name
  105.     -p  means include path names
  106.     -t  means draw tree of processes
  107.     -?   shows the options (as does -h)
  108.  
  109.  
  110. SLAY is a program which simply attempts to kill the process that you
  111. indicate on the command line.  The PID that you pass to SLAY MUST BE
  112. HEXIDECIMAL (e.g. slay b3 or slay 18d) NOT DECIMAL!
  113.  
  114. RUNNING2 uses the undocumented function DosQProcStatus() which is
  115. used by the programs PSTAT.EXE and PS.EXE which are provided with
  116. OS/2.  This function was brought to my attention by Franz Krainer in
  117. a message in the OS2 echo (10-19-89), and helped fulfil a need that I
  118. have had for a long time (since I moved over to OS/2 from QNX) to
  119. know what exactly is running in my system at any moment.  The
  120. function works with OS/2 1.1 and should also work with version 1.2.  
  121. OS/2 2.0 keeps the function but changes the format from version 1.xx,
  122. a format which is documented by Rick Fishman in his PD program PROCS.
  123.  
  124. If you have questions or comments, you can send them to me Netmail at
  125. my BBSes, The Programmer's Oases (1:3644/1 or 1:3644/2).  You can also call
  126. the BBSes at 919/226-6984 or 919/226-7136 (North Carolina). You can drop 
  127. me a line through BIX (ID=laforet) or through Compuserve (ID 76120,110).
  128.  
  129. July 16, 1992.
  130.