Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 2 - Slot Manager / Slot Manager Reference
Slot Manager Routines / Getting Information From sResources


SReadDrvrName

You can use the SReadDrvrName 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.
-->spSlotSignedByteThe slot number.
-->spIDSignedByteThe sResource ID.
-->spResultPtrA pointer to the driver name.
XspSizeLongInt 
XspsPointerPtr 

DESCRIPTION
The SReadDrvrName function reads the name of an sResource, prefixes a period to the value, and converts it to type Str255. The final driver name is compatible with the Device Manager's OpenDriver function.

You indicate an sResource by identifying the slot number and sResource ID in the spSlot and spID 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 the spResult field.

The SReadDrvrName function returns the driver name by copying it into the string pointed to by the spResult field.

SPECIAL CONSIDERATIONS
This function may alter the values of the spSize and spsPointer 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 the SReadDrvrName function are
Trap macroSelector
_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
A0Address of the parameter block
D0$0019
Registers on exit
D0Result code

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996