Important: The information in this document is obsolete and should not be used for new development.
SReadDrvrName
You can use theSReadDrvrName
function to read the name of an sResource in a format you can use to open the driver with Device Manager routines.
FUNCTION SReadDrvrName (spBlkPtr: SpBlockPtr): OSErr;
- spBlkPtr
- A pointer to a Slot Manager parameter block.
--> spSlot
SignedByte The slot number. --> spID
SignedByte The sResource ID. --> spResult
Ptr A pointer to the driver name. X spSize
LongInt X spsPointer
Ptr DESCRIPTION
TheSReadDrvrName
function reads the name of an sResource, prefixes a period to the value, and converts it to typeStr255
. The final driver name is compatible with the Device Manager'sOpenDriver
function.You indicate an sResource by identifying the slot number and sResource ID in the
spSlot
andspID
fields of the Slot Manager parameter block you point to in the spBlkPtr parameter. In your program, you should declare a Pascal string variable and pass a pointer to it in thespResult
field.The
SReadDrvrName
function returns the driver name by copying it into the string pointed to by thespResult
field.SPECIAL CONSIDERATIONS
This function may alter the values of thespSize
andspsPointer
fields of the parameter block. Your application should not depend on the values returned in these fields.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSReadDrvrName
function are
Trap macro Selector _SlotManager $0019 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 $0019
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For more information about the device control entry and device driver reference numbers, see the chapter "Device Manager" in this book.