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 / Finding sResources


SNextSRsrc

You can use the SNextSRsrc function to step through the sResources on a card or from one card to the next.

FUNCTION SNextSRsrc (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
--spsPointerPtrA pointer to an sResource (described in "The sResource," beginning on page 2-7).
--spIOReservedIntegerThe value of the slot resource table ioReserved field.
--spRefNumIntegerThe driver reference number.
--spCategoryIntegerThe Category field of the sRsrcType entry (described on page 2-10).
--spCTypeIntegerThe cType field of the sRsrcType entry.
--spDrvrSWIntegerThe DrSW field of the sRsrcType entry.
--spDrvrHWIntegerThe DrHW field of the sRsrcType entry.
-->spSlotSignedByteThe slot number.
-->spIdSignedByteThe sResource ID.
-->spExtDevSignedByteThe external device identifier.
--spHWDevSignedByteThe hardware device identifier.

DESCRIPTION
The SNextSRsrc function is similar to the SRsrcInfo function, except the SNextSRsrc function returns information about the sResource that follows the requested one--that is, the one with the next entry in the sResource directory or the first sResource on the next card. The SNextSRsrc function skips disabled sResources.

You specify a particular sResource with the spSlot, spID, and spExtDev fields of the Slot Manager parameter block you point to in the spBlkPtr parameter. The SNextSRsrc function finds the next sResource, returns a pointer to it in the spsPointer field, and updates the spSlot, spID, and spExtDev fields to correspond to the sResource it found. If there are no more sResources, the SNextSRsrc function returns the smNoMoresRsrcs result code.

The SNextSRsrc function returns other information about the sResource in the spRefNum, spCategory, spCType, spDrvrSW, and spDrvrHW fields.

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

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

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested sResource not found
SEE ALSO
For more control in finding sResources, you can use the SGetSRsrc function, described on page 2-33, and the SGetTypeSRsrc function, described on page 2-35.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996