Path: utzoo!utdoe!generic!pnet91!ericmcg From: ericmcg@pnet91.cts.com (Eric Mcgillicuddy) Newsgroups: comp.sys.apple2 Subject: Re: patching toolbox calls Message-ID: <479@generic.UUCP> Date: 9 Feb 91 15:21:49 GMT Sender: root@generic.UUCP Organization: People-Net [pnet91], Etobicoke, ON Lines: 20 I use GetTSptr and save the value and then call SetTSptr to add in my routines. If the initialization fails for some reason (I have a half dozen or so Memory Manager calls to patch) then it just restores the old ptr and ends. Aside from NoewHandle, I just have to do some stuff to update my data and then JML to the existing routines. I use GetFuncPtr prior to switching TS pointers and use self modifying (to avoid eating bank $0 memory which is verboten to an INIT) code. NewHandle is special because I need to do stuff after the call is completed. Basically I clone the parameters and reissue the call with a JSL . I then extract the returned value, do my stuff and return the value expected. Works fine. CheckHandle also works fine despite the fact I make a couple of additional MM toolcalls (RestoreHandle mainly) before passing on control. (also has to restore old PurgeLevel, which I may have altered previosly) ViM also includes a new toolcall, DeRefHandle, which Checks, Lockas and returns a pointer to the memory whose Handle was given. $3002 when installed. UUCP: bkj386!pnet91!ericmcg INET: ericmcg@pnet91.cts.com