CommNotifyProc

cCall [CommNotifyProc], <hPort, lReferenceData,     lEvent, lSubEvent>
 

Client-defined callback function that VCOMM calls when the transmit or receive queue passes a specified threshold or a communications event occurs.

hPort
Handle of the communications resource.
lReferenceData
32-bit variable passed to _VCOMM_EnableCommNotification.
lEvent
Event type. Can be one of these values:
Value Meaning
CN_RECEIVED The number of bytes in the receive queue has reached the notification threshold for the receive queue.
CN_TRANSMIT The number of bytes in the transmit queue has fallen below the notification threshold for the transmit queue.
CN_EVENT An enabled communications event occurred.

Notification thresholds are set by the _VCOMM_EnableCommNotification service. Events are enabled by the _VCOMM_SetCommEventMask service.

lSubEvent
Enabled communications events that were detected, if the lEvent parameter is CN_EVENT. Otherwise, this parameter is ignored. Can be one or more of these values:
Value Meaning
EV_BREAK BREAK received.
EV_CTS CTS changed state.
EV_CTSS CTS state, as reported in Windows 3.1. To accurately identify the CTS state, use EV_CTSS2.
EV_CTSS2 CTS state.
EV_DSR DSR changed state.
EV_DSRS DSR state, as reported in Windows 3.1. To accurately identify the DSR state, use EV_DSRS2.
EV_DSRS2 DSR state.
EV_ERR Line status error occurred.
EV_PERR Printer error occurred.
EV_RING Ring signal detected, as reported in Windows 3.1. To accurately identify the ring signal event, use EV_RING2.
EV_RING2 Ring signal detected.
EV_RingTe Ring trailing edge indicator.
EV_RLSD RLSD changed state.
EV_RLSDS RLSD state.
EV_RXCHAR Any character received.
EV_RXFLAG1 Received the event character specified by the EvtChar1 field of _DCB.
EV_RXFLAG2 Received the event character specified by the EvtChar2 field of _DCB.
EV_TXEMPTY Transmit queue empty.
EV_TXCHAR Any character transmitted.

This function is called at interrupt time with interrupts enabled. Therefore, it must call only asynchronous VxD services and must be reentrant. If you need to disable interrupts, do so for as short a time as possible; otherwise, system performance deteriorates and characters may be lost. For time-consuming operations, it is best to schedule events and have event handlers do most of the processing.

The name CommNotifyProc is a placeholder; this function may have any name. For more information, see _VCOMM_EnableCommNotification.

See Also

_VCOMM_EnableCommNotification, _VCOMM_SetCommEventMask