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


  

GetDriverForDevice

GetDriverForDevice loads the "best" driver for a device from memory. The algorithm for determining the best driver is described in Matching Drivers With Devices.

OSErr GetDriverForDevice(
                     RegEntryIDPtr device,
                     CFragConnectionID *fragmentConnID,
                     DriverEntryPointPtr *fragmentMain,
                     DriverDescriptionPtr *driverDesc);
device
Device ID.
fragmentConnID
Pointer to a fragment connection ID.
fragmentMain
Pointer to DoDriverIO.
driverDesc
Pointer to the driver description of driver.
DESCRIPTION

Given a pointer to the RegEntryID value of a device, GetDriverForDevice loads from memory the most suitable driver for that device. It returns the loaded driver's CFM connectionID value in fragmentConnID, a pointer to its DoDriverIO entry point in fragmentMain, and a pointer to its driver description in driverDesc.

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)