Important: The information in this document is obsolete and should not be used for new development.
SGetSRsrc
You can use theSGetSRsrc
function to find any sResource, even one that has been disabled.
FUNCTION SGetSRsrc (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.<--> spSlot
SignedByte The slot number. <--> spId
SignedByte The sResource ID. <--> spExtDev
SignedByte The external device identifier. <-- spHWDev
SignedByte The hardware device identifier. DESCRIPTION
TheSGetSRsrc
function allows you to specify whether the function should include disabled sResources, whether it should continue looking for sResources in higher-numbered slots, and whether it should return information about the specified sResource or the one that follows it.You specify an sResource with the
spSlot
,spID
, andspExtDev
fields of the Slot Manager parameter block you point to in the spBlkPtr parameter. You must also include flags in bits 0, 1, and 2 of thespParamData
field as follows:
The
- Set the
fAll
flag (bit 0) to search both enabled and disabled sResources. Clear this flag to search only enabled sResources.- Set the
fOneSlot
flag (bit 1) to search only the specified slot. Clear this flag to search all slots.- Set the
fNext
flag (bit 2) to return information about the sResource with the next higher sResource ID than the specified sResource (or the first one on the next card if thefAll
flag is set). Clear this flag to return data about the specified sResource.
SGetSRsrc
function returns values in thespSlot
,spID
, andspExtDev
fields corresponding to the sResource that it found. If you cleared thefNext
flag, these fields retain the values you specified when calling the function. In addition, the function returns 0 in thespParamData
field if the sResource is enabled or 1 if it is disabled. If you cleared thefAll
bit, thespParamData
field always returns the value 0.The
SGetSRsrc
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
TheSGetSRsrc
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 theSGetSRsrc
function are
Trap macro Selector _SlotManager $000B 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 $000B
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For more control in finding sResources, you can also use theSGetTypeSRsrc
function, described next.