Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!julius.cs.uiuc.edu!apple!well!oster From: oster@well.sf.ca.us (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: init.driver.resource question Message-ID: <22215@well.sf.ca.us> Date: 17 Dec 90 07:41:22 GMT References: <1990Dec15.225015.8462@jarvis.csri.toronto.edu> Distribution: na Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 20 In article <1990Dec15.225015.8462@jarvis.csri.toronto.edu> tracyn@dgp.toronto.edu (Tracy Narine) writes: >I am writing a driver that has resources. The driver is being loaded by >an init. In my init I renumber all of the resources and then release them >so the new info is stored. When my driver is called though, the resources >don't seem to be there. They method I have taken is to OpenResFile of the >init in the driver. I think this should give the driver the resources > it needs but this is not happening because my driver keeps on crashing. When the INIT returns, all attached resource get discarded, so be sure your INIT does DetachResource after caching the handle in the driver's data space so the driver can find it. Also, the INIT runs in the application heap, and the application heap is destroyed and re-used as soon as the iNIT returns. If you turn on the systemHeap bit on your resources, they will go in the system heap and stick around. Check the Control Panel chapter of Inside Mac Vol4 for information on the sysz resource. This resource tells the system to expand the system heap if necessary, before your INIT runs, so it will find enough space, when it actually runs. Good luck. -- -- David Phillip Oster - At least the government doesn't make death worse. -- oster@well.sf.ca.us = {backbone}!well!oster