## Physical Device Driver Reference

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

### OS/2 Monitor Functions

An application process that monitors data passing through a character device uses the OS/2 monitor functions to:

Gain access to the data stream (DosMonOpen, DosMonReg)

Take data from the data stream (DosMonRead), and return filtered data to the data stream (DosMonWrite)

Relinquish access to the data stream (DosMonClose)

Monitor applications use the OS/2 monitor functions to communicate with a character device driver and to directly intercept data from a data stream belonging to the character device driver. The OS/2 monitor functions are part of the OS/2 monitor dispatcher. They are shipped with OS/2 2.1 (and later) as the MONCALLS dynamic link subroutine library. These routines are loaded at privilege level 2 and are callable from applications running at privilege level 2 or 3. Each OS/2 monitor function uses the OS/2 System Trace Facility, tracing entry, and exit parameters when tracing is enabled for monitors. This facility provides assistance for the monitor application developer during the debug phase of the application's development cycle.

OS/2 API standards require that a General Protection (GP) fault occurs when a null selector is passed as an address parameter to an API call. To conform to this standard, the monitor functions generate a GP fault when a null selector is passed as an address parameter. A pop-up message notifies the user that the process is being terminated.