Important: The information in this document is obsolete and should not be used for new development.
SCSICreateRefNumXref
You use theSCSICreateRefNumXreffunction to register a device driver with the XPT.
OSErr SCSIAction(SCSIDriverPB *scsiPB);
- scsiPB
- A pointer to a SCSI driver identification parameter block, which is described on page 4-35.
--> scsiPBLength UInt16 The size of the parameter block. --> scsiFunctionCode UInt8 The SCSICreateRefNumXreffunction selector code (0x85).<-- scsiResult OSErr The returned result code. --> scsiDevice DeviceIdent The device identification record. --> scsiCompletion CallbackProc Unused. Must be set to nil.--> scsiDriver SInt16 The driver reference number. --> scsiDriverFlags UInt16 Optional driver flags. DESCRIPTION
TheSCSICreateRefNumXreffunction adds an element to the XPT's driver registration table. You specify a device identification record in thescsiDevicefield and a driver reference number in thescsiDriverfield. ThescsiDriverFlagsfield provides information about the driver that other clients can access using theSCSILookupRefNumXreffunction. The XPT does not interpret these flags.A device identification record can have only one driver reference number associated with it, but a driver reference number may be registered to multiple devices. This function returns the
scsiDeviceConflictresult code if a driver is already registered to the specified device identification record.Because this function is always executed synchronously, the
scsiCompletionfield must be set tonil.SPECIAL CONSIDERATIONS
TheSCSICreateRefNumXreffunction is executed synchronously and may move memory; you should not call it at interrupt time.RESULT CODES
noErr 0 No error scsiQLinkInvalid -7881 The qLinkfield was not 0scsiDeviceConflict -7883 Attempt to register more than one driver to a device SEE ALSO
See "Loading and Initializing a Driver," beginning on page 4-11, for more information about how device drivers are registered with the XPT.