home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5356 < prev    next >
Encoding:
Internet Message Format  |  1992-09-12  |  1.8 KB

  1. Xref: sparky comp.lang.pascal:5356 alt.msdos.programmer:2356
  2. Newsgroups: comp.lang.pascal,alt.msdos.programmer
  3. Path: sparky!uunet!gatech!taco!dspascha
  4. From: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
  5. Subject: Re: 3 questions
  6. Message-ID: <1992Sep13.020938.898@ncsu.edu>
  7. Originator: dspascha@c00082-100lez.eos.ncsu.edu
  8. Lines: 28
  9. Sender: news@ncsu.edu (USENET News System)
  10. Reply-To: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
  11. Organization: North Carolina State University, Project Eos
  12. References: <18ot9rINN67t@matt.ksu.ksu.edu> <1992Sep11.132246.12645@rhrk.uni-kl.de>
  13. Date: Sun, 13 Sep 1992 02:09:38 GMT
  14.  
  15.  
  16. In article <1992Sep11.132246.12645@rhrk.uni-kl.de>, bootz@efes.physik.uni-kl.de (Michael Bootz) writes:
  17. |> In article <18ot9rINN67t@matt.ksu.ksu.edu>, holland@matt.ksu.ksu.edu (Rich Holland) writes:
  18. |> > Question 1:
  19. |> > -----------
  20. |> >   How do I determine if the user is at the command line?  I've been thinking
  21. |> >   about writing a TSR to intercept keypresses at the DOS command line and
  22. |> >   expand TABs to full filenames (like tcsh does).  
  23. |> > 
  24. |> [Question 2..3 deleted]
  25. |> If the actual PSP = PSP of command.com ==> user is at command line.
  26. |> (PSP= program segment prefix)
  27. |> see Ralf's Interrupt list, 
  28. |>   Int $21, fct $51 to get PSP
  29. |>   Int $21, fct $52 for format of MCB (memory control block)
  30. |> the MCB contains the name of a program, here command.com
  31. |> the MCB of an PSP is located 16 bytes before the PSP
  32.  
  33. DOS versions prior to 4.0 do not put the name of the owner process in the MCB.
  34.  
  35. One thing you could check is whether or not the parent PSP field in the current
  36. PSP is zero.  For some reason COMMAND.COM (even child copies) like to zero out
  37. this field, making it nearly impossible to trace back to the original shell.
  38. Of course, other shells (like 4DOS) may not do this, so this may not be such
  39. a great solution.
  40.  
  41. Tschuess,
  42. David Paschal
  43.