Important: The information in this document is obsolete and should not be used for new development.
Status
You can use theStatus
function 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
csParam
array where the status information will be returned.DESCRIPTION
TheStatus
function returns information about the device driver specified by therefNum
parameter. The value you pass in thecsCode
parameter and the received 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
Status
function is a high-level synchronous version of the low-levelPBStatus
function. Use thePBStatus
function if you need to specify a drive number or if you want the status request to be asynchronous.
- Note
- The Device Manager interprets a
csCode
value of 1 as a special case. When the Device Manager receives a status request with acsCode
value 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 theStatus
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 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 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 monitoring device drivers, see the next section, which describes thePBStatus
function.