home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15265 < prev    next >
Encoding:
Text File  |  1992-09-09  |  2.0 KB  |  54 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!sun-barr!ames!data.nas.nasa.gov!taligent!keith@taligent.com
  3. From: keith@taligent.com (Keith Rollin)
  4. Subject: Re: Patching the _Launch Trap
  5. Message-ID: <BuCLzq.A7z@taligent.com>
  6. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  7. Organization: Taligent
  8. References: <1992Sep8.024049.20121@Arco.COM> <abrn6k+.leonardr@netcom.com> <BuA3vu.97H@taligent.com> <1992Sep9.172136.13700@dcs.qmw.ac.uk>
  9. Date: Thu, 10 Sep 1992 05:59:50 GMT
  10. Lines: 42
  11.  
  12. In article <1992Sep9.172136.13700@dcs.qmw.ac.uk>, jeremyr@dcs.qmw.ac.uk (Jeremy
  13. Roussak) writes:
  14. > In <BuA3vu.97H@taligent.com> keith@taligent.com (Keith Rollin) writes:
  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
  17. InitGraf
  18. > >is in determining if the call is being made from the start of an application.
  19. > >Some InitGraf calls are made from INITs at INIT time (by ShowINIT, for
  20. example);
  21. > >some applications call InitGraf more than once (applications written with
  22. THINK
  23. > >Pascal are common "offenders"); and CE Toolbox calls InitGraf at shutdown
  24. time
  25. > >under certain circumstances. If you patch InitGraf, you'll have to look out
  26. for
  27. > >all these cases.
  28. > The other problem with patching _InitGraf is that it doesn't
  29. > move memory, so neither can (should) your patch. We won't get
  30. > into the "all traps move memory because of patches" here! You
  31. > can argue that unexpectedly moving memory within _InitGraf
  32. > probably won't matter because of the way in which apps call it,
  33. > but it's a little unsafe. _InitFonts, on the other hand, does
  34. > move memory and is usually called immediately after _InitGraf.
  35.  
  36. You make a good point concerning patching _InitGraf. I had thought about it at
  37. the time, but went ahead and patched it, figuring that I was safe for the
  38. reasons you gave.
  39.  
  40. > When is _InitAllPacks called?
  41.  
  42. After your application is loaded, but just before its entry point is called.
  43.  
  44. --
  45. Keith Rollin
  46. Phantom Programmer
  47. Taligent, Inc.
  48.  
  49.