home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15235 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  1.6 KB

  1. Path: sparky!uunet!mcsun!uknet!qmw-dcs!jeremyr
  2. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Patching the _Launch Trap
  5. Message-ID: <1992Sep9.172136.13700@dcs.qmw.ac.uk>
  6. Date: 9 Sep 92 17:21:36 GMT
  7. References: <1992Sep8.024049.20121@Arco.COM> <abrn6k+.leonardr@netcom.com> <BuA3vu.97H@taligent.com>
  8. Sender: usenet@dcs.qmw.ac.uk (Usenet News System)
  9. Organization: Computer Science Dept, QMW, University of London
  10. Lines: 22
  11. Nntp-Posting-Host: sequent.dcs.qmw.ac.uk
  12.  
  13. In <BuA3vu.97H@taligent.com> keith@taligent.com (Keith Rollin) writes:
  14.  
  15. >I do something like this. I patch InitGraf right now, but I'm considering a
  16. >scheme where I patch InitAllPacks, instead. The problem with patching InitGraf
  17. >is in determining if the call is being made from the start of an application.
  18. >Some InitGraf calls are made from INITs at INIT time (by ShowINIT, for example);
  19. >some applications call InitGraf more than once (applications written with THINK
  20. >Pascal are common "offenders"); and CE Toolbox calls InitGraf at shutdown time
  21. >under certain circumstances. If you patch InitGraf, you'll have to look out for
  22. >all these cases.
  23.  
  24. The other problem with patching _InitGraf is that it doesn't
  25. move memory, so neither can (should) your patch. We won't get
  26. into the "all traps move memory because of patches" here! You
  27. can argue that unexpectedly moving memory within _InitGraf
  28. probably won't matter because of the way in which apps call it,
  29. but it's a little unsafe. _InitFonts, on the other hand, does
  30. move memory and is usually called immediately after _InitGraf.
  31.  
  32. When is _InitAllPacks called?
  33.  
  34. Jeremy
  35.