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 4 - SCSI Manager 4.3 / SCSI Manager 4.3 Reference
SCSI Manager 4.3 Functions / Client Functions


SCSILookupRefNumXref

You can use the SCSILookupRefNumXref function to determine if a driver is installed for a SCSI device.

OSErr SCSIAction(SCSIDriverPB *scsiPB);
scsiPB
A pointer to a SCSI driver identification parameter block, which is described on page 4-35.
-->scsiPBLengthUInt16The size of the parameter block.
-->scsiFunctionCodeUInt8The SCSILookupRefNumXref function selector code (0x86).
<--scsiResultOSErrThe returned result code.
-->scsiDeviceDeviceIdentThe device identification record.
-->scsiCompletionCallbackProcUnused. Must be set to nil.
<--scsiDriverSInt16The driver reference number.
<--scsiDriverFlagsUInt16Optional driver flags.
<--scsiNextDeviceDeviceIdentThe device identification record of the next device in the driver registration table.

DESCRIPTION
The SCSILookupRefNumXref function returns the driver reference number for a device. You specify a device identification record in the scsiDevice field, and the function returns the driver reference number in the scsiDriver field. If no driver is registered for the device, the function returns nil in the scsiDriver field.

The scsiDriverFlags field returns the flags that were set when the driver was registered. The scsiNextDevice field returns the device identification record of the next device in the driver registration table. If this is the last device in the table, the function returns 0xFF in the scsiNextDevice.bus field.

To find all registered drivers you should first call this function with a value of 0xFF in the scsiDevice.bus field. The function returns the device identification record of the first device in the list in the scsiNextDevice field. You can then find other drivers by moving the scsiNextDevice value into the scsiDevice field and repeating the operation until the function returns 0xFF in the scsiNextDevice.bus field.

Because this function is always executed synchronously, the scsiCompletion field must be set to nil.

RESULT CODES
noErr0No error
scsiQLinkInvalid-7881The qLink field was not 0

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996