Important: The information in this document is obsolete and should not be used for new development.
InsertSRTRec
You can use theInsertSRTRecfunction to add an sResource to the slot resource table.
FUNCTION InsertSRTRec (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spsPointerPtr A NILpointer.--> spParamDataLongInt Either a value of 0 to enable the sResource or a value of 1 to disable it. --> spRefNumInteger The device driver reference number. --> spSlotSignedByte The slot number. --> spIdSignedByte The sResource ID. --> spExtDevSignedByte The external device identifier. DESCRIPTION
TheInsertSRTRecfunction installs an sResource from the firmware of a NuBus card into the slot resource table. For example, if the user makes a selection in the Monitors control panel that requires your video card to switch to a new sResource that was deleted byPrimaryInitcode, you can use theInsertSRTRecfunction to restore that sResource.You specify an sResource with the
spSlot,spID, andspExtDevfields of the Slot Manager parameter block you point to in the spBlkPtr parameter. You must set thespsPointerfield toNIL. Set thespParamDatafield to 1 to disable the restored sResource or to 0 to enable it.If you place a valid device driver reference number in the
spRefNumfield, the Slot Manager updates thedCtlDevBasefield in that device driver's device control entry (that is, in the device control entry that has that driver reference number in thedCtlRefNumfield). ThedCtlDevBasefield contains the base address of the slot device. For a video card this is the base address for the pixel map in the card'sGDevicerecord (which is described in Inside Macintosh: Imaging With QuickDraw). For other types of cards the base address is optional and defined by the card designer.The base address consists of the card's slot address plus an optional offset that the card designer can specify using the
MinorBaseOSorMajorBaseOSentries of the sResource. The Slot Manager calculates the base address by using bit 2 (thef32BitModeflag) of thesRsrcFlagsentry of the sResource. As shown in Table 2-4, the Slot Manager first checks the value of bit 2 of thesRsrcFlagsfield, and then it checks for aMinorBaseOSentry. If it finds one, it uses this value to create a 32-bit value to store in thedCtlDevBasefield. If it does not find aMinorBaseOSentry, it uses the value in theMajorBaseOSentry, if any.
- Note
- In this table, x represents any hexadecimal digit and s represents a slot number.

SPECIAL CONSIDERATIONS
TheInsertSRTRecfunction is available only with version 1 or later of the Slot Manager. You can use theSVersionfunction, 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 theInsertSRTRecfunction are
Trap macro Selector _SlotManager $000A 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 $000A 
Registers on exit D0 Result code RESULT CODES
noErr 0 No error memFullErr -108 Not enough room in heap smUnExBusErr -308 Bus error smBadRefId -330 Reference ID not found in list smBadsList -331 Bad sResource: Id1 < Id2 < Id3 ... format is not followed smReservedErr -332 Reserved field not zero smSlotOOBErr -337 Slot number out of bounds smNoMoresRsrcs -344 Specified sResource not found smBadsPtrErr -346 Bad pointer was passed to SCalcSPointersmByteLanesErr -347 ByteLanesfield in card's format block was determined to be zeroSEE ALSO
For more information about the slot resource table, see "About the Slot Manager" on page 2-15.For information about deleting an sResource from the slot resource table, see the
SDeleteSRTRecfunction, described on page 2-52. For more information on deleting and restoring sResources, see "Deleting and Restoring sResources" on page 2-17.For more information about the device control entry and device driver reference numbers, see the chapter "Device Manager" in this book.
 
  
  
 