Important: The information in this document is obsolete and should not be used for new development.
SGetBlock
You can use theSGetBlockfunction to obtain a copy of ansBlockdata structure pointed to by the offset field of an sResource entry.
FUNCTION SGetBlock (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
<-- spResultPtr A pointer to a copy of an sBlockdata structure (described on page 2-9).--> spsPointerPtr A pointer to an sResource (described in "The sResource," beginning on page 2-7). --> spIDSignedByte The ID of the sResource entry. X spSizeLongInt X spOffsetDataLongInt X spByteLanesSignedByte X spFlagsSignedByte DESCRIPTION
TheSGetBlockfunction returns a copy of thesBlockdata structure pointed to by the offset field of an sResource entry.In the parameter block you point to in the spBlkPtr parameter, you provide a pointer to the sResource in the
spsPointerfield and specify the ID of the entry in thespIDfield.The
SGetBlockfunction allocates a memory buffer, copies the contents of thesBlockdata structure into it, and returns a pointer to it in thespResultfield. You should dispose of this pointer by using the Memory Manager procedureDisposePtr.SPECIAL CONSIDERATIONS
TheSGetBlockfunction may alter the values of thespSize,spOffsetData,spByteLanes, andspFlagsfields of the parameter block. Your application should not depend on the values returned in these fields.The
SGetBlockfunction allocates memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSGetBlockfunction are
Trap macro Selector _SlotManager $0005 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 $0005
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found