When communications events occur or queue thresholds are reached, port drivers may notify VCOMM clients by calling client-defined callback functions. If possible, port drivers should also maintain the values of two variables: the modem status shadow and the event variable.
The modem status shadow is a byte that contains the current state, and the change in state, of the modem control lines: clear to send (CTS), data set ready (DSR), ring indicator, and receive line signal detect (RLSD). The value of the modem status shadow is the same as the value of the modem status register for an 8250 or similar UART.
The event variable is a 32-bit variable that contains enabled communications events that have been detected. For a list of communications events, see the description of the CommNotifyProc function.
A client application or VxD enables a specific type of notification by calling a VCOMM service, causing VCOMM to call the appropriate port driver function: PortEnableNotification, PortSetReadCallback, or PortSetWriteCallback. These functions register callback functions that the port driver is to call at interrupt time under the appropriate circumstances. For non-VxD clients, the callback function is a function within VCOMM that notifies the appropriate Windows application.
CommNotifyProc, PortEnableNotification, PortSetReadCallback, PortSetWriteCallback