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 / Controlling and Monitoring Device Drivers


Control

You can use the Control function to send control information to a device driver.

pascal OSErr Control(short refNum, short csCode,
                     const void *csParamPtr); 
refNum
The driver reference number.
csCode
A driver-dependent code specifying the type of information sent.
csParamPtr
A pointer to the control information.
DESCRIPTION
The Control function sends information to the device driver specified by the refNum parameter. The value you pass in the csCode parameter and the type of information pointed to by the csParamPtr parameter are defined by the driver you are calling. For more information, see the appropriate chapters for the standard device drivers in this book and other books in the Inside Macintosh series.

The Control function is a high-level synchronous version of the low-level PBControl function. Use the PBControl function if you need to specify a drive number or if you want the control request to be executed asynchronously.

SPECIAL CONSIDERATIONS
Do not call the Control function at interrupt time. Synchronous requests at interrupt time may block other pending I/O requests and cause the Device Manager to loop indefinitely while it waits for the device driver to complete the interrupted requests.

RESULT CODES
noErr0No error
controlErr-17Driver does not respond to this control request
badUnitErr-21Driver reference number does not match unit table
unitEmptyErr-22Driver reference number specifies a nil handle in unit table
abortErr-27Request aborted by KillIO
notOpenErr-28Driver not open
SEE ALSO
For information about the low-level function for controlling device drivers, see the next section, which describes the PBControl function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996