Important: The information in this document is obsolete and should not be used for new development.
Control
You can use theControlfunction 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
TheControlfunction sends information to the device driver specified by therefNumparameter. The value you pass in thecsCodeparameter and the type of information pointed to by thecsParamPtrparameter 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
Controlfunction is a high-level synchronous version of the low-levelPBControlfunction. Use thePBControlfunction if you need to specify a drive number or if you want the control request to be executed asynchronously.SPECIAL CONSIDERATIONS
Do not call theControlfunction 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
noErr 0 No error controlErr -17 Driver does not respond to this control request badUnitErr -21 Driver reference number does not match unit table unitEmptyErr -22 Driver reference number specifies a nilhandle in unit tableabortErr -27 Request aborted by KillIOnotOpenErr -28 Driver not open SEE ALSO
For information about the low-level function for controlling device drivers, see the next section, which describes thePBControlfunction.