Important: The information in this document is obsolete and should not be used for new development.
Opening and Closing Device Drivers
A device driver must be open before your application can communicate with it. You can use theOpenDriver
orPBOpen
function to open closed drivers or to determine the driver reference number of a driver that is already open. You use theOpenSlot
function to open drivers that serve slot devices. To open a desk accessory or other Apple menu item from within your application, use theOpenDeskAcc
function.When you finish communicating with a device driver, you can close it if you are sure no other application or part of the system needs to use it. You can use the
CloseDriver
orPBClose
function to close a driver. You use theCloseDeskAcc
function to close a desk accessory.The
PBOpen
andPBClose
functions use theIOParam
union of the Device Manager parameter block. TheOpenSlot
function uses theIOParam
union fields and some additional fields that apply only to slot devices.
- IMPORTANT
- Device drivers cannot be opened or closed asynchronously. The
PBOpen
,PBClose
, andOpenSlot
functions include an asynchronous option because they share code with the File Manager. Theasync
parameter must be set tofalse
when these functions are used to open or close a device driver.
Subtopics
- OpenDriver
- PBOpen
- OpenSlot
- OpenDeskAcc
- CloseDriver
- PBClose
- CloseDeskAcc