GetCommMask

This function retrieves the event mask value for a specified communication device.

BOOL GetCommMask(HANDLE hFile, 
LPDWORD lpEvtMask); 

Parameters

  • hFile
    [in] Handle to the communication device. The CreateFile function returns this handle.
  • lpEvtMask
    [out] Long pointer to the 32-bit variable to be filled with a mask of events currently enabled. This parameter can be one or more of the following values:
    Value Description
    EV_BREAK A break was detected on input.
    EV_CTS The CTS (Clear To Send) signal changed state.
    EV_DSR The DSR (Data Set Ready) signal changed state.
    EV_ERR A line-status error occurred. Line-status errors are CE_FRAME, CE_OVERRUN, and CE_RXPARITY.
    EV_RING A ring indicator was detected.
    EV_RLSD The RLSD (Receive Line Signal Detect) signal changed state.
    EV_RXCHAR A character was received and placed in the input buffer.
    EV_RXFLAG The event character was received and placed in the input buffer. The event character is specified in the device's DCB structure, which is applied to a serial port by using the SetCommState function.
    EV_TXEMPTY The last character in the output buffer was sent.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error data, call GetLastError.

Remarks

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.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 1.0 and later Wininet.h   Serdev.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CreateFile, DCB, SetCommMask, SetCommState, WaitCommEvent

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.