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


SRsrcInfo

You can use the SRsrcInfo function to find an sResource. This function also provides additional information about the sResource, such as the driver reference number of the slot device driver.

FUNCTION SRsrcInfo (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 device 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 of the requested sResource.
-->spIdSignedByteThe sResource ID of the requested sResource.
-->spExtDevSignedByteThe external device identifier.
<--spHwDevSignedByteThe hardware device identifier.

DESCRIPTION
The SRsrcInfo function allows you to find an sResource from the slot resource table and provides additional information, including its driver reference number and the values contained in its sRsrcType entry.

You specify an sResource with the spSlot, spID, and spExtDev fields of the Slot Manager parameter block you point to in the spBlkPtr parameter.

The SRsrcInfo function returns a pointer to the sResource in the spsPointer field and returns information about the sResource type in the spRefNum, spCType, spDrvrSW, spDrvrHW fields. The function returns other information about the sResource in the spIOReserved, spRefNum, and spHwDev fields.

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

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$0016
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 next, and the SGetTypeSRsrc function, described on page 2-35.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996