InsertSRTRec
InsertSRTRec Adds an sResource data structure to the Slot Resource Table
#include <Slots.h> Slot Manager
OSErr InsertSRTRec( spBlkPtr);
SpBlockPtr spBlkPtr ; address of 56-byte Slot Parameter Block
structure
returns Error Code; 0=no error
InsertSRTRec adds an sResource data structure to the Slot Resource
Table.
spBlkPtr is the address of a 56-byte Slot Parameter Block structure.
The relevant fields are as follows:
Out-In Name Type Size Offset Description
Æ spsPointer Ptr 4 4 NIL
Æ spParamData long 4 24 Flags
Æ spRefNum short 2 38 Slot Resource Table RefNum
Æ spSlot char 1 49 Slot number
Æ spID char 1 50 ID of the sResource
Æ spExtDev char 1 51 ID of external device
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
memFullErr (-108) Not enough room in heap..
smUnExBusErr (-308) An unexpected bus error occurred.

Notes: The InsertSRTRec function adds an sResource data structure to the Slot
Resource Table. You can use the function to restore an sResource data
structure that was deleted from the Slot Resource Table with the
SDeleteSRTRec function. For example, if the user makes a selection in
the Monitors control panel that requires your video card to switch to a new
sResource data structure that was deleted by the PrimaryInit code, you can
use the InsertSRTRec function to restore that sResource data structure.
You specify an sResource data structure with the spSlot, spID, and
spExtDev fields. You must set the spsPointer to all zeros. Set the
spParamData field to 1 to disable the restored sResource data structure or
to 0 to enable it.
If you place a valid device-driver reference number in the spRefNum
field, then the Slot Manager updates the dCtlDevBase field in that device
driver's DCE data structure (that is, in the DCE that has that
device-driver reference number in the dCtlRefNum field). The dCtlDevBase
field contains the base address of the memory buffer for data provided by
the sResource data structure that is used by that particular device driver.
The Slot Manager calculates this address by using bit 2 (the f32BitMode
flag) of the sRsrc_Flags field of the sResource data structure and the
MinorBaseOS or MajorBaseOS field of the sResource data structure.
The DCE data structure is described in Device Manager . The sResource
data structure is described in Designing Cards and Drivers for the
Macintosh Family, second edition.
This routine can return the non-fatal error:
smBadRefId (-330) Reference ID was not found in the given sResource
list.
smBadsList (-331) The IDs in the sResource list are not in ascending
order.
smReservedErr (-332) A reserved field was not zero.
smSlotOOBErr (-337) The given slot was out of bounds (or does not exist).
smNoMoresRsrcs (-344) No more sResources.
smBadsPtrErr (-346) A bad sPointer was presented to sCalcsPointer.
smByteLanesErr (-347) NumByteLanes was determined to be zero.
The following Table shows how the Slot Manager determines what format
to use for this address.
Address Address Rsrc_Flags
MinorBaseOS MajorBaseOS format type
Field missing 0xxxxxx Any or none 0xFssx xxxx 1 MB address
space; can be
used in either
24-bit or
32-bit mode
Field missing None 0xxxxxxx 0xsxxx xxxx Superslot space
Bit 2 is 0 0xxxxxx Any or none 0xFssx xxxx 1 MB slot space
Bit 2 is 0 None 0xxxxxxx 0xsxxx xxxx Superslot space
Bit 2 is 1 0xxxxxxx Any or none 0xFsxx xxxx Standard slot
space (32-bit
minor base
address)
Bit 2 is 1 None 0xxxxxxxx 0xsxxx xxxx Superslot space
(32-bit major
base address)
Note: In a hexadecimal number in this table, x is any value and s is
a slot number.