Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!umn-d-ub!rutgers!att!ihuxy!vg55611 From: vg55611@ihuxy.ATT.COM (Gopal) Newsgroups: comp.sys.ibm.pc Subject: Re: problems trying to intercept msdos function requests Message-ID: <2849@ihuxy.ATT.COM> Date: 14 Feb 89 23:59:41 GMT References: <3204@ttrdc.UUCP> Reply-To: vg55611@ihuxy.UUCP (55611-Gopal,V.P.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 35 In article <3204@ttrdc.UUCP> levy@ttrdc.UUCP (Daniel R. Levy) writes: {stuff deleted] >My problem is that I can't even seem to make a do-nothing intercept program do >what I want. My code gets the interrupt vector for 21h, copies it to an >unused interrupt vector, replaces the interrupt vector at 21h with >a pointer to my intercept routine, then terminates while staying resident >(the interrupt for this final request being done through the formerly unused >vector). Future interrupts to 21h should, I figure, call my routine. >I tried a do-nothing routine which just interrupts to the vector to which >I had copied the old vector at 21h, and then performs an iret. This works >a little, but flakily. DIR works okay after this, and I can execute some >programs in the current directory, but when I try to run a program where MS-DOS >must search PATH, the machine goes into an infinite loop and it's reboot time. >(This is on an AT&T PC6300.) > >Could some MS-DOS guru please look at the assembly code below and tell me >what I'm missing? It _must_ be something awfully simple, I just don't know >what it is :-). Thanks much in advance! {Code below deleted} I think the main problem lies in the fact when an application calls int 21h, it doesn't always return through an "iret" instruction. This is so that the flags can be modified (an "iret" will restore the flags). Your int 21h routine will call int 88h, but will not return the flags set to the calling program. Also note: Int 21h calls itself.. there may lie the next problem you run into. Venu P. Gopal UUCP: att!ihuxy!vg55611 Internet: vg55611@ihuxy.att.com BITNET: com%"vg55611@ihuxy.att.com" or com%"vg55611%ihuxy@research.att.com" Save 500 million keystrokes a day; silence those silent letters forever.