PBControlSync
PBControl
Send control information to the device driver Boolean async ; 0=await completion; 1=immediate return PBControl sends control information from memory to an open device driver (ioRefNum) on the drive specified by ioVRefNum. 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 Control or status 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.
noErr (0) No error
controlErr (-17) 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.