Important: The information in this document is obsolete and should not be used for new development.
SReadStruct
You can use theSReadStructfunction 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.
--> spResultPtr A pointer to a memory block. --> spsPointerPtr A pointer to the structure. --> spSizeLongInt The length in bytes of the structure. X spByteLanesSignedByte DESCRIPTION
TheSReadStructfunction copies any arbitrary data structure from the declaration ROM of an expansion card into memory.You provide a pointer to the structure in the
spsPointerfield and specify the size of the structure in thespSizefield. You must also allocate a memory block for the result and send a pointer to it in thespResultfield.The
SReadStructfunction copies the data structure into the memory block pointed to by thespResultfield.SPECIAL CONSIDERATIONS
This function may alter the value of thespByteLanesfield 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 theSReadStructfunction 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
_SlotManagerreturns, 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 theSFindStructfunction on page 2-48.