Important: The information in this document is obsolete and should not be used for new development.
Status
You can use theStatusfunction to obtain status information from a device driver.
pascal OSErr Status(short refNum, short csCode, void *csParamPtr);
refNum- The driver reference number.
csCode- A driver-dependent code specifying the type of information requested.
csParamPtr- A pointer to a
csParamarray where the status information will be returned.DESCRIPTION
TheStatusfunction returns information about the device driver specified by therefNumparameter. The value you pass in thecsCodeparameter and the received 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
Statusfunction is a high-level synchronous version of the low-levelPBStatusfunction. Use thePBStatusfunction if you need to specify a drive number or if you want the status request to be asynchronous.
- Note
- The Device Manager interprets a
csCodevalue of 1 as a special case. When the Device Manager receives a status request with acsCodevalue of 1, it returns a handle to the driver's device control entry.
This type of status request is not passed to the device driver.![]()
SPECIAL CONSIDERATIONS
Do not call theStatusfunction 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 statusErr -18 Driver does not respond to this status 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 monitoring device drivers, see the next section, which describes thePBStatusfunction.