Important: The information in this document is obsolete and should not be used for new development.
SReadStruct
You can use theSReadStruct
function to obtain a copy of any data structure pointed to by an sResource entry. You might want to use this function, for example, when the data structure type is defined by the card designer.
FUNCTION SReadStruct (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spResult
Ptr A pointer to a memory block. --> spsPointer
Ptr A pointer to the structure. --> spSize
LongInt The length in bytes of the structure. X spByteLanes
SignedByte DESCRIPTION
TheSReadStruct
function copies any arbitrary data structure from the declaration ROM of an expansion card into memory.You provide a pointer to the structure in the
spsPointer
field and specify the size of the structure in thespSize
field. You must also allocate a memory block for the result and send a pointer to it in thespResult
field.The
SReadStruct
function copies the data structure into the memory block pointed to by thespResult
field.SPECIAL CONSIDERATIONS
This function may alter the value of thespByteLanes
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 theSReadStruct
function are
Trap macro Selector _SlotManager $0007 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 $0007
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For information about obtaining a pointer to a data structure pointed to by the offset field of an sResource entry, rather than a copy of the data structure, see the description of theSFindStruct
function on page 2-48.