SGetSRsrc
SGetSRsrc Return information about the sResource data structure SpBlockPtr spBlkPtr ; address of 56-byte Slot Parameter Block
structure
SGetSRsrc returns information about that sResource data structure, the next sResource data structure in the same slot, or the next sResource data
structure in any higher- numbered slot.
spBlkPtr is the address of a 56-byte Slot Parameter Block structure.
The relevant fields are as follows:
Out-In Name Type Size Offset Description
¨ spsPointer Ptr 4 4 Structure pointer ´ spParamData long 4 24 input: fall, foneslot flags
output: sResource enabled or disabled
¨ spRefNum short 2 38 Slot Resource Table RefNum
¨ spCategory short 2 40 sResource_Type: Category field
¨ spCType short 2 42 sResource_Type: cType field
¨ spDrvrSW short 2 44 sResource_Type: DrvrSW field
¨ spDrvrHW short 2 46 sResource_Type: DrvrHW field
´ spSlot char 1 49 Slot number
´ spID char 1 50 ID of the sResource
´ spExtDev char 1 51 ID of external device
¨ spHWDev char 1 52 ID of hardware device
noErr (0) No error
except that for the SGetSRsrc function, you set the fall, foneslot, and fnext flags to specify which type of search the function is to perform.
You specify an sResource data structure with the spSlot, spID, and
spExtDev fields. You must also set bits 0, 1, and 2 of the spParamData field
as follows:
• Set the fall flag (bit 0) to search both enabled and disabled sResource
data structures.
• Clear the fall flag to search only enabled sResource data structures.
• Set the foneslot flag (bit 1) to search only the specified slot.
• Clear the foneslot flag to search all slots.
• Set the fnext flag (bit 2) to search for the sResource data structure
that follows the specified sResource data structure.
• Clear the fnext flag to return data about the sResource data structure
that you specified.
The SGetSRsrc function returns new values in the spSlot, spID, and spExtDev fields specifying the sResource data structure that it found, and
it returns in the spsPointer field a pointer to the sResource data structure.
If you cleared the fNext flag to 0, then the spSlot, spID, and spExtDev fields
return the same values that you specified when you called the function. The
SGetSRsrc function also returns information about the sResource data structure in the spRefNum, spCategory, spCType, spDrvrSW, spDrvrHW,
and spHwDev fields. In addition, the function returns 0 in the spParamData
field if the sResource data structure is enabled or 1 if it is disabled.
This routine can return the non-fatal error:
smNoMoresRsrcs (-344) No more sResources.