![]() |
PATH![]() |
The ATA_FindRefNum function allows an application to determine whether a driver has been installed for a given device. You pass in a device ID and the function returns the current driver reference number registered for the given device. A value of 0 indicates that no driver has been registered. The deviceNextID field contains a device ID of the next device in the list. The end of the list is indicated with a value of 0xFF .
To create a list of all drivers for the attached devices, pass in 0xFF for deviceID . This causes deviceNextID to be filled with the first device in the list. Each successive driver can be found by moving the value returned in deviceNextID into deviceID until the function returns 0xFF in deviceNextID , which indicates the end of the list.
The manager function code for the ATA_FindRefNum function is $86.
The parameter block associated with this function for ataPBVers version 1 is defined as follows:
typedef | struct | Driver registration for */ /* ataPBVers version 1 */ |
|
{ | |||
ataPBHdr | /* ataPBHdr parameter block */ | ||
SInt16 | drvrRefNum; | /* <-- Contains the */ /* driver refNum */ |
|
UInt16 | FlagReserved; | /* Reserved */ | |
UInt16 | deviceNextID; | /* <-- Contains the next */ /* drive ID */ |
|
SInt16 | Reserved[21]; | /* Reserved */ | |
} ataDrvrRegister; |
The parameter block associated with this function for ataPBVer version 2 is defined as follows:
See Table A-1 for possible result codes returned by the ATA Manager.
typedef
struct
/* Driver registration for */
/* ataPBVers version 2 */
/* or greater */
{
ataPBHdr
/* ataPBHdr parameter block */
SInt16
drvrRefNum;
/* <-- Driver reference number */
UInt16
drvrFlags;
/* --> Reserved, set to 0 */
UInt16
deviceNextID;
/* Used to specify the next */
/* drive ID */
SInt16
Reserved;
/* Reserved (should be 0) */
ProcPtr
ataEHandlerPtr;
/* <-- Event handler routine */
/* pointer */
SInt32
drvrContext;
/* <-- Value to pass in with */
/* event handler */
UInt32
ataEventMask;
/* <-- Current setting of the */
/* mask of various events */
/* for event handler */
SInt16
Reserved[14];
/* Reserved */
} ataDrvrRegister;
Field descriptions
RESULT CODES
© 1999 Apple Computer, Inc.