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