Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Swapping Handles Message-ID: <47225@apple.Apple.COM> Date: 9 Dec 90 23:11:34 GMT References: <2599@runxtsa.runx.oz.au> Organization: Apple Computer Inc., Cupertino, CA Lines: 36 In article <2599@runxtsa.runx.oz.au> karlg@runxtsa.runx.oz.au (Karl Goiser) writes: >If I swap the master pointers (?) of two Handles like so: > >VAR > H1, H2: Handle; > >... > >Ptemp:= H2^; >H2^:= H1^; >H1^:= H2^; >... > >will I hurt anybody or anything (including myself)? Karl, I think that you may also have to munge with the "relative handle" in the block header. Take a look at figure 12 on page II-24. There it shows that the block header for relocatable blocks contain a reference to their master pointers. If you swap master pointers, then the master pointer that the relocatable block points to will not, in turn, point to that relocatable block. So why are you trying to do this? What is the need for swapping master pointers? As it notes on page II-24, "...your program shouldn't normally have to deal with block headers directly...". Also, the block header format has changed for 32-bit mode under 7.0, which means that any block header munging you do today will change tomorrow. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions