[alt.msdos.programmer] DOS EXEC function: How to regain control?

sonny@charybdis.harris-atd.com (Bob Davis) (02/17/91)

	I am trying to write a TSR to invoke a command when
the hot key triggers by making use of INT 21h, Function 4Bh (the
DOS EXEC function). I succeed in invoking the command, but after
the command completes, a return is not made to my TSR code at the
point immediately after the EXEC invocation as I desire. My system
simply hangs, requiring a reboot.

	I have attempted to set a terminate address via INT 22h
but that has failed.

	How do I make my TSR regain control immediately after
the EXEC'd command completes? I'm SO frustrated...

	Thanks,
_____________________________________________________________________________
Bob Davis, UofALA alum \\ INTERNET: sonny@trantor.harris-atd.com  |  _   _  |
Harris Corporation, ESS \\    UUCP: ...!uunet!x102a!trantor!sonny |_| |_| | |
Advanced Technology Dept.\\ AETHER: K4VNO          |==============|_/\/\/\|_|
PO Box 37, MS 3A/1912     \\ VOICE: (407) 727-5886 | I SPEAK ONLY | |_| |_| |
Melbourne, FL 32902        \\  FAX: (407) 729-3363 | FOR MYSELF.  |_________|

kds@physics (Kevin Stokes) (02/20/91)

In article <5534@trantor.harris-atd.com> sonny@trantor.harris-atd.com (Bob Davis) writes:
>
>	I am trying to write a TSR to invoke a command when
>the hot key triggers by making use of INT 21h, Function 4Bh (the
>DOS EXEC function). 

  If you interrupt the operation of a DOS program with a hotkey, you
can't turn around and use a DOS call to do anything with making sure
you haven't interrupted a DOS call which was in progress when you struck
the hot key.  IE DOS is not re-entrant.  Also, since function 4Bh uses
the disk drive, a new DTA address and everything will have to be set.
  Writing a TSR which actually loads and executes a program is a very 
complex project.  There are some books which contain the info needed, but
none of them are very complete.
           -Kevin

--
	Kevin Stokes				1-919-684-8256
	Duke University Dept. of Physics	kds@phy.duke.edu
	Durham, N.C.      27706