Important: The information in this document is obsolete and should not be used for new development.
Control
You can use theControl
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
TheControl
function sends information to the device driver specified by therefNum
parameter. The value you pass in thecsCode
parameter and the type of information pointed to by thecsParamPtr
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-levelPBControl
function. Use thePBControl
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 theControl
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
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 nil
handle in unit tableabortErr -27 Request aborted by KillIO
notOpenErr -28 Driver not open SEE ALSO
For information about the low-level function for controlling device drivers, see the next section, which describes thePBControl
function.