home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!sun-barr!ames!data.nas.nasa.gov!taligent!keith@taligent.com
- From: keith@taligent.com (Keith Rollin)
- Subject: Re: Patching the _Launch Trap
- Message-ID: <BuCLzq.A7z@taligent.com>
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- References: <1992Sep8.024049.20121@Arco.COM> <abrn6k+.leonardr@netcom.com> <BuA3vu.97H@taligent.com> <1992Sep9.172136.13700@dcs.qmw.ac.uk>
- Date: Thu, 10 Sep 1992 05:59:50 GMT
- Lines: 42
-
- In article <1992Sep9.172136.13700@dcs.qmw.ac.uk>, jeremyr@dcs.qmw.ac.uk (Jeremy
- Roussak) writes:
- >
- > 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.
-
- You make a good point concerning patching _InitGraf. I had thought about it at
- the time, but went ahead and patched it, figuring that I was safe for the
- reasons you gave.
-
- >
- > When is _InitAllPacks called?
- >
-
- After your application is loaded, but just before its entry point is called.
-
- --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
-