Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File and Desk Accessories Message-ID: <2319@internal.Apple.COM> Date: 9 Jun 89 23:43:26 GMT Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 21 References:<50967@tut.cis.ohio-state.edu> <7547@hoptoad.uucp> <4972@umd5.umd.edu> <51276@tut.cis.ohio-state.edu> <2015@husc6.harvard.edu> <1241@speedy.mcnc.org> In article <1241@speedy.mcnc.org> kk@mcnc.org (Krzysztof Kozminski) writes: > BTW, an idea that I had at 3:15 am was to use the NULL location: > *((Handle*) 0L) = HStorage; > > Why not? All applications should avoid writing into NULL location, so Two reasons why not: (1) Some applications or DAs do write into location 0. Most do this by mistake, but some do it on purpose. I ran across one piece of code that passed NULL as one of the VAR parameters to a Dialog Manager code, which meant that the Dialog Manager would change location 0. (2) Some programs incorrectly dereference a NIL pointer. If location 0 happens to contain an invalid address, the program will crash. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1