## Physical Device Driver Reference

[prev][next][parent][TOC]

### MonFlush

A character device driver sometimes requires that all data placed into a monitor chain has passed through all monitors in the chain and has been returned to the physical device driver. A character device driver can call on the monitor dispatcher to flush all buffers in a monitor chain (that is, remove all data from all monitor buffers by calling the DevHlp_MonFlush. This service can be called at task time). On calling MonFlush, the physical device driver places the parameters to the call in the register as illustrated in the table below. The physical device driver specifies the handle of the monitor chain to be flushed.

    /-------------------------------------------------------------\

    |Register       |Parameter Description                        |

    |---------------+---------------------------------------------|

    |AX             |Device Driver's Handle for Monitor Chain     |

    \-------------------------------------------------------------/

The monitor dispatcher places a flush record (a single WORD data record with the third bit of the first byte set) into the monitor chain. To guarantee that all data has been removed from all buffers in the monitor chain, the monitor dispatcher prevents the physical device driver from placing additional data into the data stream until the flush record has passed through all monitors in the monitor chain.

Note: If the flush record is not returned to the data stream, the data stream will be severely and permanently affected. Because placement of data into the monitor chain is suspended while a flush record passes through a monitor chain, monitors should not consume flush records. Flush records obtained from the data stream from a call to DosMonRead must be returned to the data stream on a call to DosMonWrite.

The action to be taken by a monitor application in response to the flush record varies with the type of device and type of support required.