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 / Getting Information From sResources


SFindStruct

You can use the SFindStruct function to obtain a pointer to any data structure pointed to by the offset field of an sResource entry. You might want to use this function, for example, when the data structure type is defined by the card designer.

FUNCTION SFindStruct (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
<-->spsPointerPtrOn input: a pointer to an sResource.
On output: a pointer to a data structure.
-->spIDSignedByteThe ID of the sResource entry.
XspByteLanesSignedByte 

DESCRIPTION
You provide a pointer to the sResource in the spsPointer field, and the ID of the entry in the spID field. The SFindStruct function returns a pointer to the data structure in the spResult field.

SPECIAL CONSIDERATIONS
This function may alter the value of the spByteLanes field of the parameter block. Your application should not depend on the value returned in this field.

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

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$0006
Registers on exit
D0Result code

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested sResource not found
SEE ALSO
For information about obtaining a copy of a data structure pointed to by the offset field of an sResource entry, rather than a pointer to the data structure, see the next section, which describes the SReadStruct function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996