home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8581 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  2.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!usc!wupost!darwin.sura.net!jvnc.net!netnews.upenn.edu!msuinfo!vthnw.cvm.msu.edu!eoq
  2. From: eoq@vthnw.cvm.msu.edu (Edward Quillen)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Why can't I hook INT 21h???
  5. Message-ID: <eoq.25.0@vthnw.cvm.msu.edu>
  6. Date: 17 Aug 92 19:19:32 GMT
  7. References: <14339@mindlink.bc.ca>
  8. Sender: news@msuinfo.cl.msu.edu
  9. Organization: Veterinary Teaching Hospital, Michigan State Univ.
  10. Lines: 47
  11.  
  12. In article <14339@mindlink.bc.ca> Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins) writes:
  13. >From: Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins)
  14. >Subject: Why can't I hook INT 21h???
  15. >Date: 17 Aug 92 17:41:03 GMT
  16. >Okay, maybe someone could help me here.  I am trying to write a TSR
  17. >that hooks interrupt 21h but whenever I try and hook that vector I
  18. >get an invalid command.com error and my system crashes.  I am using
  19. >TC++ 3.0 and I have tryed both using their set vect routine as
  20. >well as manually changing the interrupt vector table but in both
  21. >cases the same thing happens...crash!  Even if I write an ISR for
  22. >INT 21h that simply returns control to the original ISR the system
  23. >crahes.  For example, even this crashes my system:
  24. >
  25. >#include <dos.h>
  26. >#include <stdio.h>
  27. >
  28. >void interrupt new21handler(void);
  29. >void interrupt (*old21handler)();
  30. >
  31. >void main(void)
  32. >{
  33. >        disable();
  34. >        old21handler=getvect(0x21);
  35. >        setvect(0x21, new21handler);
  36. >        enable();
  37. >        keep(0, 4000);
  38. >}
  39. >
  40. >void interrupt new21handler(void)
  41. >{
  42. >        (old21handler)();
  43. >}
  44. >
  45. >Anyone know what's wrong here??? As far as I can see this program should
  46. >basically do nothing but take up memory but instead, it crahes the system when
  47. >run.  Any info would be greatly appreciated.
  48. >
  49. >...Charlie Hutchins
  50.  
  51. Please post replies to this ? because I've always wanted to hook INT 21h
  52. but have never been able to. Thanks!!!
  53.  
  54. +++++++++++++++++++++++++++++++++++++++++++++++++
  55. +++ ED (Edward Quillen)   (517) 336-1293      +++
  56. +++ Vet Teaching Hosp.    System Admin.       +++
  57. +++ Email: quillen@cps.msu.edu                +++
  58. +++++++++++++++++++++++++++++++++++++++++++++++++
  59.