Important: The information in this document is obsolete and should not be used for new development.
SetSRsrcState
You can use theSetSRsrcStatefunction to select which sResources are enabled.
FUNCTION SetSRsrcState (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spParamDataLongInt Either a value of 0 to enable the sResource or a value of 1 to disable it. --> spSlotSignedByte The slot number. --> spIdSignedByte The sResource ID. --> spExtDevSignedByte The external device identifier. DESCRIPTION
TheSetSRsrcStatefunction enables or disables an sResource. All of the Slot Manager functions recognize enabled sResources, while only theSGetSRsrcandSGetTypeSRsrcfunctions (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, andspExtDevfields of the Slot Manager parameter block you point to in the spBlkPtr parameter, and you specify whether to enable or disable it in thespParamDatafield. The Slot Manager enables the sResource when thespParamDatafield has a value of 0 and disables it when the field has a value of 1.SPECIAL CONSIDERATIONS
TheSetSRsrcStatefunction is available only with version 1 or later of the Slot Manager. You can use theSVersionfunction, 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 theSetSRsrcStatefunction are
Trap macro Selector _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
_SlotManagerreturns, register D0 contains the result code.
Registers on entry A0 Address of the parameter block D0 $0009
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested 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
SGetSRsrcfunction on page 2-33 and the description of theSGetTypeSRsrcfunction on page 2-35.