Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!calvin.usc.edu!dank From: dank@calvin.usc.edu (Dan King) Newsgroups: comp.sys.mac.programmer Subject: 32-bit Cleanliness Message-ID: <29193@usc> Date: 7 Jan 91 22:07:56 GMT Sender: news@usc Organization: University of Southern California, Los Angeles, CA Lines: 20 Nntp-Posting-Host: calvin.usc.edu I've got a question on the Politically Correct way to dereference a resource. Example (using C-ish syntax): I call GetResource(blah) to get a handle to the resource. I then Detach() it and HLock() it. What should I do to dereference it? Should I kill the upper 8 bits (I don't think so), should I StripAddress it (TN212 says not, but who knows?), or should I just go ahead and dereference it (Ptr x; x=*handle;)? HELP!!!! I've read the technote on being 32-bit clean and the technote on StripAddress. Neither really tells me (explicitly) what I need to do. I believe that just dereferencing the handle without worrying about the upper 8 bits will work, but doesn't the resource manager use those for different states (like locked, purgeable, etc)? Or do those go away when you detach the handle? Thanks for putting up with boring questions, dank