Important: The information in this document is obsolete and should not be used for new development.
SGetTypeSRsrc
You can use theSGetTypeSRsrcfunction to step through sResources of one type, including disabled ones.
FUNCTION SGetTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
<-- spsPointerPtr A pointer to an sResource (described in "The sResource," beginning on page 2-7). <--> spParamDataLongInt On input: parameter flags.
On output: 0 if the sResource is enabled or 1 if disabled.<-- spRefNumInteger The slot resource table reference number. <--> spCategoryInteger The Categoryfield of thesRsrcTypeentry (described on page 2-10).<--> spCTypeInteger The cTypefield of thesRsrcTypeentry.<--> spDrvrSWInteger The DrSWfield of thesRsrcTypeentry.<--> spDrvrHWInteger The DrHWfield of thesRsrcTypeentry.--> spTBMaskSignedByte The type bit mask for sRsrcType fields. <--> spSlotSignedByte The slot number. <--> spIdSignedByte The sResource ID. <--> spExtDevSignedByte The external device identifier. <-- spHWDevSignedByte The hardware device identifier. DESCRIPTION
TheSGetTypeSRsrcfunction allows you to find the next sResource of a certain type, as does theSNextTypeSRsrcfunction, but theSGetTypeSRsrcfunction also allows you to find disabled sResources and to limit searching to a single slot.You specify an sResource with the
spSlot,spID, andspExtDevfields 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, andspDrvrHWfields. You must also use thespTBMaskfield to specify which of thesesRsrcTypefields should not be included in the search:
You must also set the
- Set bit 0 to ignore the
DrHWfield.- Set bit 1 to ignore the
DrSWfield.- Set bit 2 to ignore the
cTypefield.- Set bit 3 to ignore the
Categoryfield.
fAllflag of thespParamDatafield (bit 0) to search both enabled and disabled sResources or clear this flag to search only enabled ones. Set thefOneSlotflag (bit 1) to search only the specified slot, or clear this flag to search all slots. TheSGetTypeSRsrcfunction does not use thefNextflag (bit 2) because it always searches for the next sResource of the given type.The
SGetTypeSRsrcfunction returns values in thespSlot,spID, andspExtDevfields corresponding to the sResource that it found, and it returns 0 in thespParamDatafield if that sResource is enabled or 1 if it is disabled.The
SGetTypeSRsrcfunction also returns a pointer to the sResource in thespsPointerfield and returns other information about the sResource in thespRefNum,spCategory,spCType,spDrvrSW,spDrvrHW, andspHwDevfields.SPECIAL CONSIDERATIONS
TheSGetTypeSRsrcfunction is available only with version 1 or later of the Slot Manager. You can use theSVersionfunction, 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 theSGetTypeSRsrcfunction 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
_SlotManagerreturns, 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 theSetSRsrcStatefunction in the next section.