PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

FindDriversForDevice

FindDriversForDevice finds the driver from a file and from a device tree property that represents the "best" driver for a device--that is, the latest version of the most appropriate driver, regardless of whether it is file-based or property-based. The algorithm for determining the best driver is described in Matching Drivers With Devices.

OSErr FindDriversForDevice(
                     RegEntryIDPtr device,
                     FSSpec *fragmentSpec,
                     DriverDescription *fileDriverDesc,
                     Ptr *memAddr,
                     long *length,
                     StringPtr fragName,
                     DriverDescription *memDriverDesc);
device
Device ID.
fragmentSpec
Pointer to a file system specification.
fileDriverDesc
Pointer to the driver description of driver in a file.
memAddr
Pointer to driver address.
length
Length of driver code.
fragName
Name of driver fragment.
memDriverDesc
Pointer to the driver description of driver in memory.
DESCRIPTION

Given a pointer to the RegEntryID value of a device, FindDriversForDevice finds the most suitable driver for that device. If the driver is located in a file, it returns a pointer to the driver's file system specification in fragmentSpec and a pointer to its driver description in fileDriverDesc. If the driver is a fragment located in memory, FindDriversForDevice returns a pointer to its address in memAddr, its length in length, its name in fragName, and a pointer to its driver description in memDriverDesc. FindDriversForDevice initializes all outputs to nil before searching for drivers.

The fragName parameter that FindDriversForDevice returns can be passed to GetDriverMemoryFragment or GetDriverDiskFragment.

RESULT CODES
noErr 0 No error
fnfErr -43 File not found
All CFM errors (see Inside Macintosh: PowerPC System Software)

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)