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

  1. Xref: sparky comp.lang.pascal:5374 alt.msdos.programmer:2364
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!ames!sun-barr!west.West.Sun.COM!cronkite.Central.Sun.COM!texsun!exucom.exu.ericsson.se!news
  3. From: exuptr@exu.ericsson.se (exuptr@exu.ericsson.se)
  4. Newsgroups: comp.lang.pascal,alt.msdos.programmer
  5. Subject: Re: 3 questions
  6. Message-ID: <exuptr.544.716424717@exu.ericsson.se>
  7. Date: 13 Sep 92 22:51:57 GMT
  8. References: <18ot9rINN67t@matt.ksu.ksu.edu> <1992Sep11.132246.12645@rhrk.uni-kl.de> <1992Sep13.020938.898@ncsu.edu>
  9. Sender: news@exu.ericsson.se
  10. Organization: Ericsson Network Systems, Inc.
  11. Lines: 43
  12. Nntp-Posting-Host: pc254167.exu.ericsson.se
  13.  
  14. In article <1992Sep13.020938.898@ncsu.edu> dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL) writes:
  15. >From: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
  16. >Subject: Re: 3 questions
  17. >Date: 13 Sep 92 02:09:38 GMT
  18.  
  19.  
  20. >In article <1992Sep11.132246.12645@rhrk.uni-kl.de>, bootz@efes.physik.uni-kl.de (Michael Bootz) writes:
  21. >|> In article <18ot9rINN67t@matt.ksu.ksu.edu>, holland@matt.ksu.ksu.edu (Rich Holland) writes:
  22. >|> > Question 1:
  23. >|> > -----------
  24. >|> >   How do I determine if the user is at the command line?  I've been thinking
  25. >|> >   about writing a TSR to intercept keypresses at the DOS command line and
  26. >|> >   expand TABs to full filenames (like tcsh does).  
  27. >|> > 
  28. >|> [Question 2..3 deleted]
  29. >|> If the actual PSP = PSP of command.com ==> user is at command line.
  30. >|> (PSP= program segment prefix)
  31. >|> see Ralf's Interrupt list, 
  32. >|>   Int $21, fct $51 to get PSP
  33. >|>   Int $21, fct $52 for format of MCB (memory control block)
  34. >|> the MCB contains the name of a program, here command.com
  35. >|> the MCB of an PSP is located 16 bytes before the PSP
  36.  
  37. >DOS versions prior to 4.0 do not put the name of the owner process in the MCB.
  38.  
  39. >One thing you could check is whether or not the parent PSP field in the current
  40. >PSP is zero.  For some reason COMMAND.COM (even child copies) like to zero out
  41. >this field, making it nearly impossible to trace back to the original shell.
  42. >Of course, other shells (like 4DOS) may not do this, so this may not be such
  43. >a great solution.
  44.  
  45. >Tschuess,
  46. >David Paschal
  47.  
  48. Also there is an interrupt vector that contains command.com's PSP.  I believe
  49. it is 2eh?
  50.  ----------------------------------------------------------------------------
  51.     "This must be Thursday.  I never could get the hang of Thursdays"
  52.                                                        - Douglas Adams
  53.   - Patrick Taylor                                       (Arthur Dent)
  54.     Ericsson Network Systems
  55.     exuptr@exu.ericsson.se                       "Don't let the .se fool you"
  56.     or exuptr@ZGNews.Lonestar.Org, exu.exuptr@memo.ericsson.se
  57.