Path: utzoo!attcan!uunet!husc6!bloom-beacon!apple!ames!ncar!tank!uwvax!astroatc!nicmad!madnix!jason From: jason@madnix.UUCP (Jason Blochowiak) Newsgroups: comp.sys.apple Subject: Re: deleting DA's from memory Keywords: DA, CDA, NDA, Desk Accessories, System Software Message-ID: <678@madnix.UUCP> Date: 5 Jun 89 09:08:21 GMT References: <8905272100.AA01113@obsolete.UUCP> <31983@apple.Apple.COM> Reply-To: jason@madnix.UUCP (Jason Blochowiak) Organization: ARP Software, Madison, WI Lines: 50 In article <31983@apple.Apple.COM> dlyons@Apple.COM (David Lyons) writes: >Under System Disk 4.0 and earlier, there is no legitimate way to remove a >DA. > >Under System Disk 5.0 and later, there are two new Desk Manager calls: >RemoveCDA and RemoveNDA (just like InstallCDA and InstallNDA, only different). >These calls remove a DA from the Desk Manager's tables, but they do *not* >actually remove the DA's code from memory, because there's no safe way to do >that. (The DA may have intercepted system vectors or toolbox functions or >installed heartbeat interrupt tasks, so that freeing up its memory could easily >crash the system.) > >It would be neat if there were a way for a DA to identify itself as "removable" >and have a routine to call that unhooks the DA from the system if necessary. How about something like: If the first word that's pointed to by both the CDA Entry and ShutDown addresses in the CDA header is $0000, then the CDA is considered removeable. Perhaps something similar for the NDAs. I don't understand why they didn't put a "supported calls" count in the headers - then there could be a "are you removeable?" call to the DA. Perhaps this could be done with the "pointing to 0 word" thingie I just mentioned - if that was the case, then the word after the aforementioned 0 word would be the supported calls count. So the header for a CDA would look like this: Header data str 'I be the new kind of CDA' dc i4'NewHeader,NewHeader' NewHeader anop dc i2'0,3' ;# of calls (<2 would cause an error) dc i4'StartOfDACode,ShutDownRoutine' dc i4'CheckRemove' ;Or whatever new calls... end ;End of Header Perhaps instead of a CheckRemove there could be a RemoveThySelf call which would return failure if the DA wasn't removeable (or, of course, if the removal failed for some reason for another). It doesn't seem like it'd be incredibly useful to be able to nuke the thing from the Desk Mgr's list if it can't be removed from memory, especially since both DA menus scroll on 5.0... >But that's not happening in 5.0. Oh, well... :) > --Dave Lyons, Apple Computer, Inc. -- _______________________________________________________________________________ jason@madnix.UUCP, methinks. Formerly blochowi@garfield.cs.wisc.edu "It beats working" - Harrison Ford