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


SUpdateSRT

For system software versions earlier than System 7, you can use the SUpdateSRT function to update the slot resource table record for an existing sResource. A new record will be added if the sResource does not already exist in the slot resource table.

FUNCTION SUpdateSRT (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
-->spIOReservedIntegerThe value to be stored in the IOReserved field of the slot resource table.
-->spRefNumIntegerThe device driver reference number.
-->spSlotSignedByteThe slot number.
-->spIdSignedByteThe sResource ID.
-->spExtDevSignedByteThe external device identifier.

DESCRIPTION
The SUpdateSRT function adds or updates an record in the slot resource table. You specify an sResource with the spSlot, spID, and spExtDev fields of the Slot Manager parameter block you point to in the spBlkPtr parameter. If a matching record is found in the slot resource table, the RefNum and IOReserved fields of the table are updated. If the record is not found, the sResource is added to the table by reading the appropriate declaration ROM. Updates may be made to enabled sResources only.

SPECIAL CONSIDERATIONS
In System 7, this function was replaced by the InsertSRTRec function (described on page 2-54). You should use the SUpdateSRT function only if version 1 or later of the Slot Manager is not available. 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 SUpdateSRT function are
Trap macroSelector
_SlotManager$002B

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$002B
Registers on exit
D0Result code

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap
smEmptySlot-300No card in this slot
smUnExBusErr-308Bus error
smBadRefId-330Reference ID not found in list
smSlotOOBErr-337Slot number out of bounds
smNoMoresRsrcs-344Specified sResource not found
SEE ALSO
For more information about the slot resource table, see "About the Slot Manager" on page 2-15.

For information about the preferred routine for adding an sResource to the slot resource table, see the InsertSRTRec function, described on page 2-54. For information about deleting an sResource from the slot resource table, see the SDeleteSRTRec function, described on page 2-52.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996