🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #942

Re: Why can't I hook INT 21h???

#942
From: Edward Quillen
Date: Mon, 17 Aug 1992 19:19
47 lines
2204 bytes
In article <14339@mindlink.bc.ca> Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins) writes:
>From: Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins)
>Subject: Why can't I hook INT 21h???
>Date: 17 Aug 92 17:41:03 GMT
>Okay, maybe someone could help me here.  I am trying to write a TSR
>that hooks interrupt 21h but whenever I try and hook that vector I
>get an invalid command.com error and my system crashes.  I am using
>TC++ 3.0 and I have tryed both using their set vect routine as
>well as manually changing the interrupt vector table but in both
>cases the same thing happens...crash!  Even if I write an ISR for
>INT 21h that simply returns control to the original ISR the system
>crahes.  For example, even this crashes my system:
>
>#include <dos.h>
>#include <stdio.h>
>
>void interrupt new21handler(void);
>void interrupt (*old21handler)();
>
>void main(void)
>{
>        disable();
>        old21handler=getvect(0x21);
>        setvect(0x21, new21handler);
>        enable();
>        keep(0, 4000);
>}
>
>void interrupt new21handler(void)
>{
>        (old21handler)();
>}
>
>Anyone know what's wrong here??? As far as I can see this program should
>basically do nothing but take up memory but instead, it crahes the system when
>run.  Any info would be greatly appreciated.
>
>...Charlie Hutchins

Please post replies to this ? because I've always wanted to hook INT 21h
but have never been able to. Thanks!!!

+++++++++++++++++++++++++++++++++++++++++++++++++
+++ ED (Edward Quillen)   (517) 336-1293      +++
+++ Vet Teaching Hosp.    System Admin.       +++
+++ Email: quillen@cps.msu.edu                +++
+++++++++++++++++++++++++++++++++++++++++++++++++
Technical Details
Message-ID: <eoq.25.0@vthnw.cvm.msu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!rpi!usc!wupost!darwin.sura.net!jvnc.net!netnews.upenn.edu!msuinfo!vthnw.cvm.msu.edu!eoq
References: <14339@mindlink.bc.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!rpi!usc!wupost!darwin.sura.net!jvnc.net!netnews.upenn.edu!msuinfo!vthnw.cvm.msu.edu!eoq
From: eoq@vthnw.cvm.msu.edu (Edward Quillen)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Why can't I hook INT 21h???
Message-ID: <eoq.25.0@vthnw.cvm.msu.edu>
Date: 17 Aug 92 19:19:32 GMT
References: <14339@mindlink.bc.ca>
Sender: news@msuinfo.cl.msu.edu
Organization: Veterinary Teaching Hospital, Michigan State Univ.
Lines: 47