Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!mailrus!uflorida!haven!umd5!zben From: zben@umd5.umd.edu (Ben Cranston) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File and Desk Accessories Summary: BEWARE! Standard File uses A4! Message-ID: <4975@umd5.umd.edu> Date: 7 Jun 89 18:21:08 GMT References: <50967@tut.cis.ohio-state.edu> <7547@hoptoad.uucp> <4972@umd5.umd.edu> <51276@tut.cis.ohio-state.edu> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 28 Re: using one of the development packages that implements local variables for DAs and other data-less code resources by using A4 as an ersatz global pointer. Standard File saves A4 on entry and uses it to point to other things! For much of the routine it points to the SFReply record, however several of the subroutines save it and use it for local purposes! Therefore it would not work to access DA globals from hook routines... I though of these other ways to solve the original poster's problems: 1. Run the device chain looking for DA's entry, link back to device's control data (see Tim's posting). 2. Use the A6 value from the windows RefCon, knowing that the SFReply record pointer can be found at 8(A6). 3. Use the A4 value, expecting Standard File to have it pointing at SFReply. 4. Build, in a small non-relocatable block, a separate A5 world for the DA. (See the init-time-icon display code recently posted here for examples). At a known offset in that block would be the handle to the main DA data. "Work is the drink of the cursing class..." -- Ben Cranston (Kingdom of Merryland UniSys 1100/92) Copyright 1989 (you may redistribute ONLY if your recipients can).