Important: The information in this document is obsolete and should not be used for new development.
SReadDrvrName
You can use theSReadDrvrNamefunction 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.
--> spSlotSignedByte The slot number. --> spIDSignedByte The sResource ID. --> spResultPtr A pointer to the driver name. X spSizeLongInt X spsPointerPtr DESCRIPTION
TheSReadDrvrNamefunction 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'sOpenDriverfunction.You indicate an sResource by identifying the slot number and sResource ID in the
spSlotandspIDfields 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 thespResultfield.The
SReadDrvrNamefunction returns the driver name by copying it into the string pointed to by thespResultfield.SPECIAL CONSIDERATIONS
This function may alter the values of thespSizeandspsPointerfields 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 theSReadDrvrNamefunction 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
_SlotManagerreturns, 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.