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 1 - Device Manager / Device Manager Reference
Device Manager Functions


Opening and Closing Device Drivers

A device driver must be open before your application can communicate with it. You can use the OpenDriver or PBOpen function to open closed drivers or to determine the driver reference number of a driver that is already open. You use the OpenSlot function to open drivers that serve slot devices. To open a desk accessory or other Apple menu item from within your application, use the OpenDeskAcc 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 or PBClose function to close a driver. You use the CloseDeskAcc function to close a desk accessory.

The PBOpen and PBClose functions use the IOParam union of the Device Manager parameter block. The OpenSlot function uses the IOParam union fields and some additional fields that apply only to slot devices.

IMPORTANT
Device drivers cannot be opened or closed asynchronously. The PBOpen, PBClose, and OpenSlot functions include an asynchronous option because they share code with the File Manager. The async parameter must be set to false when these functions are used to open or close a device driver.

Subtopics
OpenDriver
PBOpen
OpenSlot
OpenDeskAcc
CloseDriver
PBClose
CloseDeskAcc

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996