Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 2 - Slot Manager / Slot Manager Reference
Slot Manager Routines / Enabling, Disabling, Deleting, and Restoring sResources


SetSRsrcState

You can use the SetSRsrcState function to select which sResources are enabled.

FUNCTION SetSRsrcState (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
-->spParamDataLongIntEither a value of 0 to enable the sResource or a value of 1 to disable it.
-->spSlotSignedByteThe slot number.
-->spIdSignedByteThe sResource ID.
-->spExtDevSignedByteThe external device identifier.

DESCRIPTION
The SetSRsrcState function enables or disables an sResource. All of the Slot Manager functions recognize enabled sResources, while only the SGetSRsrc and SGetTypeSRsrc functions (described on page 2-33 and page 2-35, respectively) can recognize disabled ones.

You specify the sResource to enable or disable with the spSlot, spID, and spExtDev fields of the Slot Manager parameter block you point to in the spBlkPtr parameter, and you specify whether to enable or disable it in the spParamData field. The Slot Manager enables the sResource when the spParamData field has a value of 0 and disables it when the field has a value of 1.

SPECIAL CONSIDERATIONS
The SetSRsrcState function is available only with version 1 or later of the Slot Manager. You can use the SVersion function, described on page 2-30, to determine whether the Slot Manager is version 1 or later.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SetSRsrcState function are
Trap macroSelector
_SlotManager$0009

You must set up register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
Registers on entry
A0Address of the parameter block
D0$0009
Registers on exit
D0Result code

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested sResource not found
SEE ALSO
For more information on enabling and disabling sResources, see "Enabling and Disabling sResources" on page 2-18.

For information on finding disabled sResources, see the description of the SGetSRsrc function on page 2-33 and the description of the SGetTypeSRsrc function on page 2-35.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996