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


Status

You can use the Status 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
The Status function returns information about the device driver specified by the refNum parameter. The value you pass in the csCode parameter and the received 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 Status function is a high-level synchronous version of the low-level PBStatus function. Use the PBStatus 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 a csCode 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 the Status 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
statusErr-18Driver does not respond to this status 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 monitoring device drivers, see the next section, which describes the PBStatus function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996