PBStatusSync
PBStatus Send Status information to the device driver
#include <Devices.h> Device Manager
OSErr PBStatus(pb, async );
ParmBlkPtr pb ; address of a 50-byte CntrlParam structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PBStatus returns status information from an open device driver
(ioRefNum) on the drive specified by ioVRefNum to memory. The csCode
parameter identifies the type of control information that begins at csParam.
Both csCode and csParam depend on individual drivers for their values.
pb is the address of a 50-byte IOParam structure. The following fields
are relevant:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
-> ioRefNum short 2 24 Device reference number
-> csCode short 2 26 Type of information sent
<- csParam Record 22 28 Status or control information for the call
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
-> ioVRefNum short 2 22 Drive identification
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
statusErr (-18) Driver can't respond to Call
badUnitErr (-21) refNum doesn't match unit table
unitEmptyErr (-22) refNum specifies NIL handle in unit table
notOpenErr (-28) Driver not open

Notes: The values passed in csCode and csParam vary, depending on which driver
is being called. To store information in csParam you have to perform the
proper type coercion. csParam is declared as up to 22 bytes because its
actual contents can go up that high and will vary from one Control or Status
call to an other.