Event Functions and Extended Functions

VCOMM clients can request that they be notified when communications events occur or when queue thresholds reach specified limits. In addition, VCOMM clients can enable or disable specific events and specify the location of the event variable.

To support event notification, a port driver provides the PortEnableNotification function. This function registers a callback function that the port driver calls when enabled events occur. Enabled events are specified by a 32-bit variable called the event mask. A port driver's PortSetEventMask and PortGetEventMask functions set and retrieve the event mask, and may also specify the location of the event variable. The PortSetModemStatusShadow function may also set the event mask.

To support queue threshold notifications, a port driver provides the PortSetReadCallback and PortSetWriteCallback functions. These functions set the notification thresholds for the receive and transmit queues, respectively, and register callback functions that the port driver calls when these thresholds are reached.

The PortEscapeFunction function enables port drivers to define extended functions. A set of common extended functions is defined in VCOMM.INC in the Windows 95 DDK. By defining additional extended functions, a port driver can expose capabilities of a device that are not otherwise defined by the communications API. Extended functions can be used in conjunction with driver-defined events to facilitate two-way message passing between a VCOMM client and a port driver.

See Also

_PORTDATA, PortEnableNotification, PortEscapeFunction, PortGetEventMask, PortSetEventMask, PortSetModemStatusShadow, PortSetReadCallback, PortSetWriteCallback, _VCOMM_GetModemStatus