[comp.sys.mac.programmer] Resource Manager Problems on an SE, Plus

holland@m2.csc.ti.com (Fred Hollander) (05/22/89)

I've got an INIT that creates a resource file (using CreateResFile) on
startup.  I have no problem on a Mac II or SE/30, but it crashes on an
SE or Plus.  I even tried creating the file first (using Create).  The
file was created, but CreateResFile still crashed.  Then I created the
resource file off-line and it crashed during OpenRFPerm (caused an
immediate restart).

What's different in the Resource Manager (of File Manager) between a II
and an SE/Plus?  They're all running either 6.02 or 6.03!

All suggestions will be greatly appreciated.

Fred Hollander
Computer Science Center
Texas Instruments, Inc.
hollander@ti.com

The above statements are my own and not representative of Texas Instruments.

han@Apple.COM (Byron Han, wyl E. coyote ) (05/23/89)

article <78461@ti-csl.csc.ti.com> holland@m2.csc.ti.com (Fred Hollander) writes:
>I've got an INIT that creates a resource file (using CreateResFile) on
>startup.  I have no problem on a Mac II or SE/30, but it crashes on an
>SE or Plus.  I even tried creating the file first (using Create).  The
>file was created, but CreateResFile still crashed.  Then I created the
>resource file off-line and it crashed during OpenRFPerm (caused an
>immediate restart).
>
Is the name of the file stored in the INIT itself?  If so, you have a 
potential problem (read Technical Note 232 - Strip before OpenRFPerm)

The problem is that OpenRFPerm looks at the pointer to the name of the
file being opened.  If the pointer has the resource bit set (which it will
if the name is stored inside the INIT resource) certain other things occur
(which are for old bugs/patches for ancient print drivers/applications)

The solution is to get the address of the file name, do a strip address,
and then call OpenRFPerm.

This should clear up the problem.  Hope this helps.
+-----------------------------------------------------------------------------+
| Disclaimer: Apple has no connection with my postings.                       |
+-----------------------------------------------------------------------------+ 
Byron Han, Communications Architect   At Apple, we change the world everyday.
Apple Computer, Inc.                  -----------------------------------------
20525 Mariani Ave, MS27Y              Internet: han@apple.COM
Cupertino, CA 95014                   UUCP:{sun,voder,nsc,decwrl}!apple!han
------------------------------------  GENIE:BYRONHAN   CompuServe:72167,1664
ATTnet: 408-974-6450                  Applelink:HAN1   HAN1@applelink.apple.COM
-------------------------------------------------------------------------------