Important: The information in this document is obsolete and should not be used for new development.
SGetTypeSRsrc
You can use theSGetTypeSRsrc
function to step through sResources of one type, including disabled ones.
FUNCTION SGetTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
<-- spsPointer
Ptr A pointer to an sResource (described in "The sResource," beginning on page 2-7). <--> spParamData
LongInt On input: parameter flags.
On output: 0 if the sResource is enabled or 1 if disabled.<-- spRefNum
Integer The slot resource table reference number. <--> spCategory
Integer The Category
field of thesRsrcType
entry (described on page 2-10).<--> spCType
Integer The cType
field of thesRsrcType
entry.<--> spDrvrSW
Integer The DrSW
field of thesRsrcType
entry.<--> spDrvrHW
Integer The DrHW
field of thesRsrcType
entry.--> spTBMask
SignedByte The type bit mask for sRsrcType fields. <--> spSlot
SignedByte The slot number. <--> spId
SignedByte The sResource ID. <--> spExtDev
SignedByte The external device identifier. <-- spHWDev
SignedByte The hardware device identifier. DESCRIPTION
TheSGetTypeSRsrc
function allows you to find the next sResource of a certain type, as does theSNextTypeSRsrc
function, but theSGetTypeSRsrc
function also allows you to find disabled sResources and to limit searching to a single slot.You specify an sResource with the
spSlot
,spID
, andspExtDev
fields of the Slot Manager parameter block you point to in the spBlkPtr parameter, and you specify the type of the sResource with thespCategory
,spCType
,spDrvrSW
, andspDrvrHW
fields. You must also use thespTBMask
field to specify which of thesesRsrcType
fields should not be included in the search:
You must also set the
- Set bit 0 to ignore the
DrHW
field.- Set bit 1 to ignore the
DrSW
field.- Set bit 2 to ignore the
cType
field.- Set bit 3 to ignore the
Category
field.
fAll
flag of thespParamData
field (bit 0) to search both enabled and disabled sResources or clear this flag to search only enabled ones. Set thefOneSlot
flag (bit 1) to search only the specified slot, or clear this flag to search all slots. TheSGetTypeSRsrc
function does not use thefNext
flag (bit 2) because it always searches for the next sResource of the given type.The
SGetTypeSRsrc
function returns values in thespSlot
,spID
, andspExtDev
fields corresponding to the sResource that it found, and it returns 0 in thespParamData
field if that sResource is enabled or 1 if it is disabled.The
SGetTypeSRsrc
function also returns a pointer to the sResource in thespsPointer
field and returns other information about the sResource in thespRefNum
,spCategory
,spCType
,spDrvrSW
,spDrvrHW
, andspHwDev
fields.SPECIAL CONSIDERATIONS
TheSGetTypeSRsrc
function is available only with version 1 or later of the Slot Manager. You can use theSVersion
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 theSGetTypeSRsrc
function are
Trap macro Selector _SlotManager $000C 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 A0 Address of the parameter block D0 $000C
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For information on enabling and disabling sResources, see "Enabling and Disabling sResources" on page 2-18 and the description of theSetSRsrcState
function in the next section.