Important: The information in this document is obsolete and should not be used for new development.
PBControl
You can use thePBControlfunction to send control information to a device driver.
pascal OSErr PBControl(ParmBlkPtr paramBlock, Boolean async);
paramBlock- A pointer to a
CntrlParamstructure of the Device Manager parameter block.
async- A Boolean value that indicates whether the request is asynchronous.
--> ioCompletion ProcPtr A pointer to a completion routine. <-- ioResult OSErr The device driver's result code. --> ioVRefNum short The drive number. --> ioCRefNum short The driver reference number. --> csCode short The type of control call. --> csParam short[11] The control information. DESCRIPTION
ThePBControlfunction sends information to the device driver specified by theioCRefNumfield. The value you pass in thecsCodefield and the type of information in thecsParamfield 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.SPECIAL CONSIDERATIONS
Do not call thePBControlfunction synchronously 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.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for thePBControlfunction is_Control(0xA004). Set bit 10 of the trap word to execute this routine asynchronously. Set bit 9 to execute it immediately.You must set up register A0 with the address of the parameter block. When
_Controlreturns, register D0 contains the result code. Register D0 is the only register affected by this routine.
Registers on entry A0 Address of the parameter block 
Registers on exit D0 Result code RESULT CODES
noErr 0 No error controlErr -17 Driver does not respond to this control 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 high-level function for controlling device drivers, see the description of theControlfunction on page 1-75. For an example of how to send control information to a device driver using thePBControlfunction, see Listing 1-5 on page 1-23.
 
  
  
 