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


PBKillIO

You can use the PBKillIO function to terminate all current and pending I/O requests for a device driver.

pascal OSErr PBKillIO(ParmBlkPtr paramBlock, Boolean async); 
paramBlock
A pointer to a CntrlParam structure of the Device Manager parameter block.
async
A Boolean value that indicates whether the request is asynchronous. You must set this field to false because the PBKillIO function does not support asynchronous requests.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe device driver's result code.
-->ioCRefNumshortThe driver reference number.

DESCRIPTION
The PBKillIO function stops any current I/O request being processed by the driver specified by the ioCRefNum field, and removes all pending requests from the I/O queue for that driver. The Device Manager calls the completion routine, if any, for each pending request, and sets the ioResult field of each request equal to the result code abortErr.

The Device Manager passes PBKillIO requests to a device driver only if the driver is open and enabled for control calls. If the driver returns an error, the I/O queue is left unchanged and no completion routines are called.

WARNING
The PBKillIO function terminates all pending I/O requests for a driver, including requests initiated by other applications.
SPECIAL CONSIDERATIONS
The Device Manager always executes the PBKillIO function immediately; that is, it never places a PBKillIO request in the I/O queue. However, you should not call this function immediately--always call the PBKillIO function synchronously.

Although the Device Manager imposes no restrictions on calling PBKillIO at interrupt time, you should consult a device driver's documentation to determine if it supports this.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for the PBKillIO function is _KillIO (0xA006). You must set up register A0 with the address of the parameter block. When _KillIO returns, register D0 contains the result code. Register D0 is the only register affected by this function.
Registers on entry
A0Address of the parameter block
Registers on exit
D0Result code

RESULT CODES
noErr0No error
controlErr-17Driver does not respond to this control request
badUnitErr-21Driver reference number does not match unit table
unitEmptyErr-22Driver reference number specifies a nil handle in unit table
notOpenErr-28Driver not open
SEE ALSO
For information about the high-level function for terminating current and pending I/O requests for a driver, see the description of the KillIO function on page 1-80.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996