This function retrieves the event mask value for a specified communication device.
BOOL GetCommMask( HANDLE hFile, LPDWORD lpEvtMask );
[in] Handle to the communication device, returned by the CreateFile function.
[out] Long pointer to the 32-bit variable to be filled with a mask of events currently enabled. The following table shows possible values.
A break was detected on input.
The CTS (Clear To Send) signal changed state.
The DSR (Data Set Ready) signal changed state.
A line-status error occurred.
Line-status errors are CE_FRAME, CE_OVERRUN, and CE_RXPARITY.
A ring indicator was detected.
The RLSD (Receive Line Signal Detect) signal changed state.
A character was received and placed in the input buffer.
The event character was received and placed in the input buffer.
The last character in the output buffer was sent.
Nonzero indicates success. Zero indicates failure. To obtain extended error data, call the GetLastError function.
The GetCommMask function uses a 32-bit mask variable to indicate the set of events that can be monitored for a particular communication resource.
A handle to the communication resource can be specified in a call to the WaitCommEvent function, which waits for an event to occur.
To modify the event mask of a communication resource, use the SetCommMask function.