Path: utzoo!attcan!uunet!olivea!apple!dlyons From: dlyons@Apple.COM (David A. Lyons) Newsgroups: comp.sys.apple2 Subject: Re: patching toolbox calls Message-ID: <48550@apple.Apple.COM> Date: 28 Jan 91 01:10:08 GMT References: <2039@kluge.fiu.edu> <1991Jan18.231501.7352@nntp-server.caltech.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 24 In article <1991Jan18.231501.7352@nntp-server.caltech.edu> toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes: >2. patch out the specific functions you want, using GetTSPtr to get the >function pointer table (the format is explained in Appendix A of toolbox ref 2) >and SetDefaultTPT (this is documented in toolbox ref 3 but I can type it in if >you want) to notify the system that the current tool state should be preserved. Note that SetDefaultTPT is officially for use by the system. If you're going to call it yourself, at least do it at "init" time, not in the middle of an application! One effect it has is to make the currently-loaded RAM tools *stay* loaded, even when an application is no longer using them. Also, be careful not to assume that a particular function pointer table is already in RAM. GetTSPtr returns a pointer to an FPT, but that table may be in ROM or RAM! If it's not already in RAM, call SetTSPtr with a FPT of the appropriate size, with zeroes for all functions you don't want to patch. -- David A. Lyons, Apple Computer, Inc. | DAL Systems Apple II System Software Engineer | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.