FreeRDP
include/winpr/comm.h File Reference
#include <winpr/collections.h>
#include <winpr/file.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
This graph shows which files directly or indirectly include this file:

Data Structures

struct  DCB
 
struct  COMMCONFIG
 
struct  COMMPROP
 
struct  COMMTIMEOUTS
 
struct  COMSTAT
 
struct  _SERIAL_IOCTL_NAME
 

Macros

#define NOPARITY   0
 
#define ODDPARITY   1
 
#define EVENPARITY   2
 
#define MARKPARITY   3
 
#define SPACEPARITY   4
 
#define ONESTOPBIT   0
 
#define ONE5STOPBITS   1
 
#define TWOSTOPBITS   2
 
#define IGNORE   0
 
#define CBR_110   110
 
#define CBR_300   300
 
#define CBR_600   600
 
#define CBR_1200   1200
 
#define CBR_2400   2400
 
#define CBR_4800   4800
 
#define CBR_9600   9600
 
#define CBR_14400   14400
 
#define CBR_19200   19200
 
#define CBR_38400   38400
 
#define CBR_56000   56000
 
#define CBR_57600   57600
 
#define CBR_115200   115200
 
#define CBR_128000   128000
 
#define CBR_256000   256000
 
#define CE_RXOVER   0x0001
 
#define CE_OVERRUN   0x0002
 
#define CE_RXPARITY   0x0004
 
#define CE_FRAME   0x0008
 
#define CE_BREAK   0x0010
 
#define CE_TXFULL   0x0100
 
#define CE_PTO   0x0200
 
#define CE_IOE   0x0400
 
#define CE_DNS   0x0800
 
#define CE_OOP   0x1000
 
#define CE_MODE   0x8000
 
#define IE_BADID   (-1)
 
#define IE_OPEN   (-2)
 
#define IE_NOPEN   (-3)
 
#define IE_MEMORY   (-4)
 
#define IE_DEFAULT   (-5)
 
#define IE_HARDWARE   (-10)
 
#define IE_BYTESIZE   (-11)
 
#define IE_BAUDRATE   (-12)
 
#define EV_RXCHAR   0x0001
 
#define EV_RXFLAG   0x0002
 
#define EV_TXEMPTY   0x0004
 
#define EV_CTS   0x0008
 
#define EV_DSR   0x0010
 
#define EV_RLSD   0x0020
 
#define EV_BREAK   0x0040
 
#define EV_ERR   0x0080
 
#define EV_RING   0x0100
 
#define EV_PERR   0x0200
 
#define EV_RX80FULL   0x0400
 
#define EV_EVENT1   0x0800
 
#define EV_EVENT2   0x1000
 
#define SETXOFF   1
 
#define SETXON   2
 
#define SETRTS   3
 
#define CLRRTS   4
 
#define SETDTR   5
 
#define CLRDTR   6
 
#define RESETDEV   7
 
#define SETBREAK   8
 
#define CLRBREAK   9
 
#define PURGE_TXABORT   0x0001
 
#define PURGE_RXABORT   0x0002
 
#define PURGE_TXCLEAR   0x0004
 
#define PURGE_RXCLEAR   0x0008
 
#define LPTx   0x80
 
#define MS_CTS_ON   ((DWORD)0x0010)
 
#define MS_DSR_ON   ((DWORD)0x0020)
 
#define MS_RING_ON   ((DWORD)0x0040)
 
#define MS_RLSD_ON   ((DWORD)0x0080)
 
#define SP_SERIALCOMM   ((DWORD)0x00000001)
 
#define PST_UNSPECIFIED   ((DWORD)0x00000000)
 
#define PST_RS232   ((DWORD)0x00000001)
 
#define PST_PARALLELPORT   ((DWORD)0x00000002)
 
#define PST_RS422   ((DWORD)0x00000003)
 
#define PST_RS423   ((DWORD)0x00000004)
 
#define PST_RS449   ((DWORD)0x00000005)
 
#define PST_MODEM   ((DWORD)0x00000006)
 
#define PST_FAX   ((DWORD)0x00000021)
 
#define PST_SCANNER   ((DWORD)0x00000022)
 
#define PST_NETWORK_BRIDGE   ((DWORD)0x00000100)
 
#define PST_LAT   ((DWORD)0x00000101)
 
#define PST_TCPIP_TELNET   ((DWORD)0x00000102)
 
#define PST_X25   ((DWORD)0x00000103)
 
#define PCF_DTRDSR   ((DWORD)0x0001)
 
#define PCF_RTSCTS   ((DWORD)0x0002)
 
#define PCF_RLSD   ((DWORD)0x0004)
 
#define PCF_PARITY_CHECK   ((DWORD)0x0008)
 
#define PCF_XONXOFF   ((DWORD)0x0010)
 
#define PCF_SETXCHAR   ((DWORD)0x0020)
 
#define PCF_TOTALTIMEOUTS   ((DWORD)0x0040)
 
#define PCF_INTTIMEOUTS   ((DWORD)0x0080)
 
#define PCF_SPECIALCHARS   ((DWORD)0x0100)
 
#define PCF_16BITMODE   ((DWORD)0x0200)
 
#define SP_PARITY   ((DWORD)0x0001)
 
#define SP_BAUD   ((DWORD)0x0002)
 
#define SP_DATABITS   ((DWORD)0x0004)
 
#define SP_STOPBITS   ((DWORD)0x0008)
 
#define SP_HANDSHAKING   ((DWORD)0x0010)
 
#define SP_PARITY_CHECK   ((DWORD)0x0020)
 
#define SP_RLSD   ((DWORD)0x0040)
 
#define BAUD_075   ((DWORD)0x00000001)
 
#define BAUD_110   ((DWORD)0x00000002)
 
#define BAUD_134_5   ((DWORD)0x00000004)
 
#define BAUD_150   ((DWORD)0x00000008)
 
#define BAUD_300   ((DWORD)0x00000010)
 
#define BAUD_600   ((DWORD)0x00000020)
 
#define BAUD_1200   ((DWORD)0x00000040)
 
#define BAUD_1800   ((DWORD)0x00000080)
 
#define BAUD_2400   ((DWORD)0x00000100)
 
#define BAUD_4800   ((DWORD)0x00000200)
 
#define BAUD_7200   ((DWORD)0x00000400)
 
#define BAUD_9600   ((DWORD)0x00000800)
 
#define BAUD_14400   ((DWORD)0x00001000)
 
#define BAUD_19200   ((DWORD)0x00002000)
 
#define BAUD_38400   ((DWORD)0x00004000)
 
#define BAUD_56K   ((DWORD)0x00008000)
 
#define BAUD_128K   ((DWORD)0x00010000)
 
#define BAUD_115200   ((DWORD)0x00020000)
 
#define BAUD_57600   ((DWORD)0x00040000)
 
#define BAUD_USER   ((DWORD)0x10000000)
 
#define DATABITS_5   ((WORD)0x0001)
 
#define DATABITS_6   ((WORD)0x0002)
 
#define DATABITS_7   ((WORD)0x0004)
 
#define DATABITS_8   ((WORD)0x0008)
 
#define DATABITS_16   ((WORD)0x0010)
 
#define DATABITS_16X   ((WORD)0x0020)
 
#define STOPBITS_10   ((WORD)0x0001)
 
#define STOPBITS_15   ((WORD)0x0002)
 
#define STOPBITS_20   ((WORD)0x0004)
 
#define PARITY_NONE   ((WORD)0x0100)
 
#define PARITY_ODD   ((WORD)0x0200)
 
#define PARITY_EVEN   ((WORD)0x0400)
 
#define PARITY_MARK   ((WORD)0x0800)
 
#define PARITY_SPACE   ((WORD)0x1000)
 
#define COMMPROP_INITIALIZED   ((DWORD)0xE73CF52E)
 
#define DTR_CONTROL_DISABLE   0x00
 
#define DTR_CONTROL_ENABLE   0x01
 
#define DTR_CONTROL_HANDSHAKE   0x02
 
#define RTS_CONTROL_DISABLE   0x00
 
#define RTS_CONTROL_ENABLE   0x01
 
#define RTS_CONTROL_HANDSHAKE   0x02
 
#define RTS_CONTROL_TOGGLE   0x03
 
#define BuildCommDCB   BuildCommDCBA
 
#define BuildCommDCBAndTimeouts   BuildCommDCBAndTimeoutsA
 
#define CommConfigDialog   CommConfigDialogA
 
#define GetDefaultCommConfig   GetDefaultCommConfigA
 
#define SetDefaultCommConfig   SetDefaultCommConfigA
 
#define MAXULONG   (4294967295UL)
 
#define IOCTL_SERIAL_SET_BAUD_RATE   0x001B0004
 
#define IOCTL_SERIAL_GET_BAUD_RATE   0x001B0050
 
#define IOCTL_SERIAL_SET_LINE_CONTROL   0x001B000C
 
#define IOCTL_SERIAL_GET_LINE_CONTROL   0x001B0054
 
#define IOCTL_SERIAL_SET_TIMEOUTS   0x001B001C
 
#define IOCTL_SERIAL_GET_TIMEOUTS   0x001B0020
 
#define IOCTL_SERIAL_GET_CHARS   0x001B0058
 
#define IOCTL_SERIAL_SET_CHARS   0x001B005C
 
#define IOCTL_SERIAL_SET_DTR   0x001B0024
 
#define IOCTL_SERIAL_CLR_DTR   0x001B0028
 
#define IOCTL_SERIAL_RESET_DEVICE   0x001B002C
 
#define IOCTL_SERIAL_SET_RTS   0x001B0030
 
#define IOCTL_SERIAL_CLR_RTS   0x001B0034
 
#define IOCTL_SERIAL_SET_XOFF   0x001B0038
 
#define IOCTL_SERIAL_SET_XON   0x001B003C
 
#define IOCTL_SERIAL_SET_BREAK_ON   0x001B0010
 
#define IOCTL_SERIAL_SET_BREAK_OFF   0x001B0014
 
#define IOCTL_SERIAL_SET_QUEUE_SIZE   0x001B0008
 
#define IOCTL_SERIAL_GET_WAIT_MASK   0x001B0040
 
#define IOCTL_SERIAL_SET_WAIT_MASK   0x001B0044
 
#define IOCTL_SERIAL_WAIT_ON_MASK   0x001B0048
 
#define IOCTL_SERIAL_IMMEDIATE_CHAR   0x001B0018
 
#define IOCTL_SERIAL_PURGE   0x001B004C
 
#define IOCTL_SERIAL_GET_HANDFLOW   0x001B0060
 
#define IOCTL_SERIAL_SET_HANDFLOW   0x001B0064
 
#define IOCTL_SERIAL_GET_MODEMSTATUS   0x001B0068
 
#define IOCTL_SERIAL_GET_DTRRTS   0x001B0078
 
#define IOCTL_SERIAL_GET_COMMSTATUS   0x001B006C
 
#define IOCTL_SERIAL_GET_PROPERTIES   0x001B0074
 
#define IOCTL_SERIAL_CONFIG_SIZE   0x001B0080
 
#define IOCTL_USBPRINT_GET_1284_ID   0x220034
 

Typedefs

typedef struct DCBLPDCB
 
typedef struct COMMCONFIGLPCOMMCONFIG
 
typedef struct COMMPROPLPCOMMPROP
 
typedef struct COMMTIMEOUTSLPCOMMTIMEOUTS
 
typedef struct COMSTATLPCOMSTAT
 

Enumerations

enum  SERIAL_DRIVER_ID { SerialDriverUnknown = 0 , SerialDriverSerialSys , SerialDriverSerCxSys , SerialDriverSerCx2Sys }
 

Functions

WINPR_API BOOL BuildCommDCBA (LPCSTR lpDef, LPDCB lpDCB)
 
WINPR_API BOOL BuildCommDCBW (LPCWSTR lpDef, LPDCB lpDCB)
 
WINPR_API BOOL BuildCommDCBAndTimeoutsA (LPCSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts)
 
WINPR_API BOOL BuildCommDCBAndTimeoutsW (LPCWSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts)
 
WINPR_API BOOL CommConfigDialogA (LPCSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC)
 
WINPR_API BOOL CommConfigDialogW (LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC)
 
WINPR_API BOOL GetCommConfig (HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize)
 
WINPR_API BOOL SetCommConfig (HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize)
 
WINPR_API BOOL GetCommMask (HANDLE hFile, PDWORD lpEvtMask)
 
WINPR_API BOOL SetCommMask (HANDLE hFile, DWORD dwEvtMask)
 
WINPR_API BOOL GetCommModemStatus (HANDLE hFile, PDWORD lpModemStat)
 
WINPR_API BOOL GetCommProperties (HANDLE hFile, LPCOMMPROP lpCommProp)
 
WINPR_API BOOL GetCommState (HANDLE hFile, LPDCB lpDCB)
 
WINPR_API BOOL SetCommState (HANDLE hFile, LPDCB lpDCB)
 
WINPR_API BOOL GetCommTimeouts (HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts)
 
WINPR_API BOOL SetCommTimeouts (HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts)
 
WINPR_API BOOL GetDefaultCommConfigA (LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize)
 
WINPR_API BOOL GetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize)
 
WINPR_API BOOL SetDefaultCommConfigA (LPCSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize)
 
WINPR_API BOOL SetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize)
 
WINPR_API BOOL SetCommBreak (HANDLE hFile)
 
WINPR_API BOOL ClearCommBreak (HANDLE hFile)
 
WINPR_API BOOL ClearCommError (HANDLE hFile, PDWORD lpErrors, LPCOMSTAT lpStat)
 
WINPR_API BOOL PurgeComm (HANDLE hFile, DWORD dwFlags)
 
WINPR_API BOOL SetupComm (HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue)
 
WINPR_API BOOL EscapeCommFunction (HANDLE hFile, DWORD dwFunc)
 
WINPR_API BOOL TransmitCommChar (HANDLE hFile, char cChar)
 
WINPR_API BOOL WaitCommEvent (HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped)
 
WINPR_API BOOL DefineCommDevice (LPCTSTR lpDeviceName, LPCTSTR lpTargetPath)
 
WINPR_API DWORD QueryCommDevice (LPCTSTR lpDeviceName, LPTSTR lpTargetPath, DWORD ucchMax)
 
WINPR_API BOOL IsCommDevice (LPCTSTR lpDeviceName)
 
WINPR_API HANDLE CommCreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
 
WINPR_API const char * _comm_serial_ioctl_name (ULONG number)
 
WINPR_API void _comm_setServerSerialDriver (HANDLE hComm, SERIAL_DRIVER_ID)
 
WINPR_API BOOL _comm_set_permissive (HANDLE hDevice, BOOL permissive)
 
WINPR_API BOOL CommDeviceIoControl (HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
 
WINPR_API BOOL CommReadFile (HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
 
WINPR_API BOOL CommWriteFile (HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
 

Macro Definition Documentation

◆ BAUD_075

#define BAUD_075   ((DWORD)0x00000001)

◆ BAUD_110

#define BAUD_110   ((DWORD)0x00000002)

◆ BAUD_115200

#define BAUD_115200   ((DWORD)0x00020000)

◆ BAUD_1200

#define BAUD_1200   ((DWORD)0x00000040)

◆ BAUD_128K

#define BAUD_128K   ((DWORD)0x00010000)

◆ BAUD_134_5

#define BAUD_134_5   ((DWORD)0x00000004)

◆ BAUD_14400

#define BAUD_14400   ((DWORD)0x00001000)

◆ BAUD_150

#define BAUD_150   ((DWORD)0x00000008)

◆ BAUD_1800

#define BAUD_1800   ((DWORD)0x00000080)

◆ BAUD_19200

#define BAUD_19200   ((DWORD)0x00002000)

◆ BAUD_2400

#define BAUD_2400   ((DWORD)0x00000100)

◆ BAUD_300

#define BAUD_300   ((DWORD)0x00000010)

◆ BAUD_38400

#define BAUD_38400   ((DWORD)0x00004000)

◆ BAUD_4800

#define BAUD_4800   ((DWORD)0x00000200)

◆ BAUD_56K

#define BAUD_56K   ((DWORD)0x00008000)

◆ BAUD_57600

#define BAUD_57600   ((DWORD)0x00040000)

◆ BAUD_600

#define BAUD_600   ((DWORD)0x00000020)

◆ BAUD_7200

#define BAUD_7200   ((DWORD)0x00000400)

◆ BAUD_9600

#define BAUD_9600   ((DWORD)0x00000800)

◆ BAUD_USER

#define BAUD_USER   ((DWORD)0x10000000)

◆ BuildCommDCB

#define BuildCommDCB   BuildCommDCBA

◆ BuildCommDCBAndTimeouts

#define BuildCommDCBAndTimeouts   BuildCommDCBAndTimeoutsA

◆ CBR_110

#define CBR_110   110

◆ CBR_115200

#define CBR_115200   115200

◆ CBR_1200

#define CBR_1200   1200

◆ CBR_128000

#define CBR_128000   128000

◆ CBR_14400

#define CBR_14400   14400

◆ CBR_19200

#define CBR_19200   19200

◆ CBR_2400

#define CBR_2400   2400

◆ CBR_256000

#define CBR_256000   256000

◆ CBR_300

#define CBR_300   300

◆ CBR_38400

#define CBR_38400   38400

◆ CBR_4800

#define CBR_4800   4800

◆ CBR_56000

#define CBR_56000   56000

◆ CBR_57600

#define CBR_57600   57600

◆ CBR_600

#define CBR_600   600

◆ CBR_9600

#define CBR_9600   9600

◆ CE_BREAK

#define CE_BREAK   0x0010

◆ CE_DNS

#define CE_DNS   0x0800

◆ CE_FRAME

#define CE_FRAME   0x0008

◆ CE_IOE

#define CE_IOE   0x0400

◆ CE_MODE

#define CE_MODE   0x8000

◆ CE_OOP

#define CE_OOP   0x1000

◆ CE_OVERRUN

#define CE_OVERRUN   0x0002

◆ CE_PTO

#define CE_PTO   0x0200

◆ CE_RXOVER

#define CE_RXOVER   0x0001

◆ CE_RXPARITY

#define CE_RXPARITY   0x0004

◆ CE_TXFULL

#define CE_TXFULL   0x0100

◆ CLRBREAK

#define CLRBREAK   9

◆ CLRDTR

#define CLRDTR   6

◆ CLRRTS

#define CLRRTS   4

◆ CommConfigDialog

#define CommConfigDialog   CommConfigDialogA

◆ COMMPROP_INITIALIZED

#define COMMPROP_INITIALIZED   ((DWORD)0xE73CF52E)

◆ DATABITS_16

#define DATABITS_16   ((WORD)0x0010)

◆ DATABITS_16X

#define DATABITS_16X   ((WORD)0x0020)

◆ DATABITS_5

#define DATABITS_5   ((WORD)0x0001)

◆ DATABITS_6

#define DATABITS_6   ((WORD)0x0002)

◆ DATABITS_7

#define DATABITS_7   ((WORD)0x0004)

◆ DATABITS_8

#define DATABITS_8   ((WORD)0x0008)

◆ DTR_CONTROL_DISABLE

#define DTR_CONTROL_DISABLE   0x00

◆ DTR_CONTROL_ENABLE

#define DTR_CONTROL_ENABLE   0x01

◆ DTR_CONTROL_HANDSHAKE

#define DTR_CONTROL_HANDSHAKE   0x02

◆ EV_BREAK

#define EV_BREAK   0x0040

◆ EV_CTS

#define EV_CTS   0x0008

◆ EV_DSR

#define EV_DSR   0x0010

◆ EV_ERR

#define EV_ERR   0x0080

◆ EV_EVENT1

#define EV_EVENT1   0x0800

◆ EV_EVENT2

#define EV_EVENT2   0x1000

◆ EV_PERR

#define EV_PERR   0x0200

◆ EV_RING

#define EV_RING   0x0100

◆ EV_RLSD

#define EV_RLSD   0x0020

◆ EV_RX80FULL

#define EV_RX80FULL   0x0400

◆ EV_RXCHAR

#define EV_RXCHAR   0x0001

◆ EV_RXFLAG

#define EV_RXFLAG   0x0002

◆ EV_TXEMPTY

#define EV_TXEMPTY   0x0004

◆ EVENPARITY

#define EVENPARITY   2

◆ GetDefaultCommConfig

#define GetDefaultCommConfig   GetDefaultCommConfigA

◆ IE_BADID

#define IE_BADID   (-1)

◆ IE_BAUDRATE

#define IE_BAUDRATE   (-12)

◆ IE_BYTESIZE

#define IE_BYTESIZE   (-11)

◆ IE_DEFAULT

#define IE_DEFAULT   (-5)

◆ IE_HARDWARE

#define IE_HARDWARE   (-10)

◆ IE_MEMORY

#define IE_MEMORY   (-4)

◆ IE_NOPEN

#define IE_NOPEN   (-3)

◆ IE_OPEN

#define IE_OPEN   (-2)

◆ IGNORE

#define IGNORE   0

◆ IOCTL_SERIAL_CLR_DTR

#define IOCTL_SERIAL_CLR_DTR   0x001B0028

◆ IOCTL_SERIAL_CLR_RTS

#define IOCTL_SERIAL_CLR_RTS   0x001B0034

◆ IOCTL_SERIAL_CONFIG_SIZE

#define IOCTL_SERIAL_CONFIG_SIZE   0x001B0080

◆ IOCTL_SERIAL_GET_BAUD_RATE

#define IOCTL_SERIAL_GET_BAUD_RATE   0x001B0050

◆ IOCTL_SERIAL_GET_CHARS

#define IOCTL_SERIAL_GET_CHARS   0x001B0058

◆ IOCTL_SERIAL_GET_COMMSTATUS

#define IOCTL_SERIAL_GET_COMMSTATUS   0x001B006C

◆ IOCTL_SERIAL_GET_DTRRTS

#define IOCTL_SERIAL_GET_DTRRTS   0x001B0078

◆ IOCTL_SERIAL_GET_HANDFLOW

#define IOCTL_SERIAL_GET_HANDFLOW   0x001B0060

◆ IOCTL_SERIAL_GET_LINE_CONTROL

#define IOCTL_SERIAL_GET_LINE_CONTROL   0x001B0054

◆ IOCTL_SERIAL_GET_MODEMSTATUS

#define IOCTL_SERIAL_GET_MODEMSTATUS   0x001B0068

◆ IOCTL_SERIAL_GET_PROPERTIES

#define IOCTL_SERIAL_GET_PROPERTIES   0x001B0074

◆ IOCTL_SERIAL_GET_TIMEOUTS

#define IOCTL_SERIAL_GET_TIMEOUTS   0x001B0020

◆ IOCTL_SERIAL_GET_WAIT_MASK

#define IOCTL_SERIAL_GET_WAIT_MASK   0x001B0040

◆ IOCTL_SERIAL_IMMEDIATE_CHAR

#define IOCTL_SERIAL_IMMEDIATE_CHAR   0x001B0018

◆ IOCTL_SERIAL_PURGE

#define IOCTL_SERIAL_PURGE   0x001B004C

◆ IOCTL_SERIAL_RESET_DEVICE

#define IOCTL_SERIAL_RESET_DEVICE   0x001B002C

◆ IOCTL_SERIAL_SET_BAUD_RATE

#define IOCTL_SERIAL_SET_BAUD_RATE   0x001B0004

◆ IOCTL_SERIAL_SET_BREAK_OFF

#define IOCTL_SERIAL_SET_BREAK_OFF   0x001B0014

◆ IOCTL_SERIAL_SET_BREAK_ON

#define IOCTL_SERIAL_SET_BREAK_ON   0x001B0010

◆ IOCTL_SERIAL_SET_CHARS

#define IOCTL_SERIAL_SET_CHARS   0x001B005C

◆ IOCTL_SERIAL_SET_DTR

#define IOCTL_SERIAL_SET_DTR   0x001B0024

◆ IOCTL_SERIAL_SET_HANDFLOW

#define IOCTL_SERIAL_SET_HANDFLOW   0x001B0064

◆ IOCTL_SERIAL_SET_LINE_CONTROL

#define IOCTL_SERIAL_SET_LINE_CONTROL   0x001B000C

◆ IOCTL_SERIAL_SET_QUEUE_SIZE

#define IOCTL_SERIAL_SET_QUEUE_SIZE   0x001B0008

◆ IOCTL_SERIAL_SET_RTS

#define IOCTL_SERIAL_SET_RTS   0x001B0030

◆ IOCTL_SERIAL_SET_TIMEOUTS

#define IOCTL_SERIAL_SET_TIMEOUTS   0x001B001C

◆ IOCTL_SERIAL_SET_WAIT_MASK

#define IOCTL_SERIAL_SET_WAIT_MASK   0x001B0044

◆ IOCTL_SERIAL_SET_XOFF

#define IOCTL_SERIAL_SET_XOFF   0x001B0038

◆ IOCTL_SERIAL_SET_XON

#define IOCTL_SERIAL_SET_XON   0x001B003C

◆ IOCTL_SERIAL_WAIT_ON_MASK

#define IOCTL_SERIAL_WAIT_ON_MASK   0x001B0048

◆ IOCTL_USBPRINT_GET_1284_ID

#define IOCTL_USBPRINT_GET_1284_ID   0x220034

◆ LPTx

#define LPTx   0x80

◆ MARKPARITY

#define MARKPARITY   3

◆ MAXULONG

#define MAXULONG   (4294967295UL)

◆ MS_CTS_ON

#define MS_CTS_ON   ((DWORD)0x0010)

◆ MS_DSR_ON

#define MS_DSR_ON   ((DWORD)0x0020)

◆ MS_RING_ON

#define MS_RING_ON   ((DWORD)0x0040)

◆ MS_RLSD_ON

#define MS_RLSD_ON   ((DWORD)0x0080)

◆ NOPARITY

#define NOPARITY   0

WinPR: Windows Portable Runtime Serial Communication API

Copyright 2011 O.S. Systems Software Ltda. Copyright 2011 Eduardo Fiss Beloni belon.nosp@m.i@os.nosp@m.syste.nosp@m.ms.c.nosp@m.om.br Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2014 Hewlett-Packard Development Company, L.P.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ ODDPARITY

#define ODDPARITY   1

◆ ONE5STOPBITS

#define ONE5STOPBITS   1

◆ ONESTOPBIT

#define ONESTOPBIT   0

◆ PARITY_EVEN

#define PARITY_EVEN   ((WORD)0x0400)

◆ PARITY_MARK

#define PARITY_MARK   ((WORD)0x0800)

◆ PARITY_NONE

#define PARITY_NONE   ((WORD)0x0100)

◆ PARITY_ODD

#define PARITY_ODD   ((WORD)0x0200)

◆ PARITY_SPACE

#define PARITY_SPACE   ((WORD)0x1000)

◆ PCF_16BITMODE

#define PCF_16BITMODE   ((DWORD)0x0200)

◆ PCF_DTRDSR

#define PCF_DTRDSR   ((DWORD)0x0001)

◆ PCF_INTTIMEOUTS

#define PCF_INTTIMEOUTS   ((DWORD)0x0080)

◆ PCF_PARITY_CHECK

#define PCF_PARITY_CHECK   ((DWORD)0x0008)

◆ PCF_RLSD

#define PCF_RLSD   ((DWORD)0x0004)

◆ PCF_RTSCTS

#define PCF_RTSCTS   ((DWORD)0x0002)

◆ PCF_SETXCHAR

#define PCF_SETXCHAR   ((DWORD)0x0020)

◆ PCF_SPECIALCHARS

#define PCF_SPECIALCHARS   ((DWORD)0x0100)

◆ PCF_TOTALTIMEOUTS

#define PCF_TOTALTIMEOUTS   ((DWORD)0x0040)

◆ PCF_XONXOFF

#define PCF_XONXOFF   ((DWORD)0x0010)

◆ PST_FAX

#define PST_FAX   ((DWORD)0x00000021)

◆ PST_LAT

#define PST_LAT   ((DWORD)0x00000101)

◆ PST_MODEM

#define PST_MODEM   ((DWORD)0x00000006)

◆ PST_NETWORK_BRIDGE

#define PST_NETWORK_BRIDGE   ((DWORD)0x00000100)

◆ PST_PARALLELPORT

#define PST_PARALLELPORT   ((DWORD)0x00000002)

◆ PST_RS232

#define PST_RS232   ((DWORD)0x00000001)

◆ PST_RS422

#define PST_RS422   ((DWORD)0x00000003)

◆ PST_RS423

#define PST_RS423   ((DWORD)0x00000004)

◆ PST_RS449

#define PST_RS449   ((DWORD)0x00000005)

◆ PST_SCANNER

#define PST_SCANNER   ((DWORD)0x00000022)

◆ PST_TCPIP_TELNET

#define PST_TCPIP_TELNET   ((DWORD)0x00000102)

◆ PST_UNSPECIFIED

#define PST_UNSPECIFIED   ((DWORD)0x00000000)

◆ PST_X25

#define PST_X25   ((DWORD)0x00000103)

◆ PURGE_RXABORT

#define PURGE_RXABORT   0x0002

◆ PURGE_RXCLEAR

#define PURGE_RXCLEAR   0x0008

◆ PURGE_TXABORT

#define PURGE_TXABORT   0x0001

◆ PURGE_TXCLEAR

#define PURGE_TXCLEAR   0x0004

◆ RESETDEV

#define RESETDEV   7

◆ RTS_CONTROL_DISABLE

#define RTS_CONTROL_DISABLE   0x00

◆ RTS_CONTROL_ENABLE

#define RTS_CONTROL_ENABLE   0x01

◆ RTS_CONTROL_HANDSHAKE

#define RTS_CONTROL_HANDSHAKE   0x02

◆ RTS_CONTROL_TOGGLE

#define RTS_CONTROL_TOGGLE   0x03

◆ SETBREAK

#define SETBREAK   8

◆ SetDefaultCommConfig

#define SetDefaultCommConfig   SetDefaultCommConfigA

◆ SETDTR

#define SETDTR   5

◆ SETRTS

#define SETRTS   3

◆ SETXOFF

#define SETXOFF   1

◆ SETXON

#define SETXON   2

◆ SP_BAUD

#define SP_BAUD   ((DWORD)0x0002)

◆ SP_DATABITS

#define SP_DATABITS   ((DWORD)0x0004)

◆ SP_HANDSHAKING

#define SP_HANDSHAKING   ((DWORD)0x0010)

◆ SP_PARITY

#define SP_PARITY   ((DWORD)0x0001)

◆ SP_PARITY_CHECK

#define SP_PARITY_CHECK   ((DWORD)0x0020)

◆ SP_RLSD

#define SP_RLSD   ((DWORD)0x0040)

◆ SP_SERIALCOMM

#define SP_SERIALCOMM   ((DWORD)0x00000001)

◆ SP_STOPBITS

#define SP_STOPBITS   ((DWORD)0x0008)

◆ SPACEPARITY

#define SPACEPARITY   4

◆ STOPBITS_10

#define STOPBITS_10   ((WORD)0x0001)

◆ STOPBITS_15

#define STOPBITS_15   ((WORD)0x0002)

◆ STOPBITS_20

#define STOPBITS_20   ((WORD)0x0004)

◆ TWOSTOPBITS

#define TWOSTOPBITS   2

Typedef Documentation

◆ LPCOMMCONFIG

typedef struct COMMCONFIG * LPCOMMCONFIG

◆ LPCOMMPROP

typedef struct COMMPROP * LPCOMMPROP

◆ LPCOMMTIMEOUTS

typedef struct COMMTIMEOUTS * LPCOMMTIMEOUTS

◆ LPCOMSTAT

typedef struct COMSTAT * LPCOMSTAT

◆ LPDCB

typedef struct DCB * LPDCB

Enumeration Type Documentation

◆ SERIAL_DRIVER_ID

IOCTLs table according the server's serial driver: http://msdn.microsoft.com/en-us/library/windows/hardware/dn265347%28v=vs.85%29.aspx

Enumerator
SerialDriverUnknown 
SerialDriverSerialSys 
SerialDriverSerCxSys 
SerialDriverSerCx2Sys 

Function Documentation

◆ _comm_serial_ioctl_name()

WINPR_API const char* _comm_serial_ioctl_name ( ULONG  number)

FIXME: got a proper function name and place

Here is the caller graph for this function:

◆ _comm_set_permissive()

WINPR_API BOOL _comm_set_permissive ( HANDLE  hDevice,
BOOL  permissive 
)

FIXME: got a proper function name and place

permissive mode is disabled by default.

WinPR: Windows Portable Runtime Serial Communication API

Copyright 2014 Hewlett-Packard Development Company, L.P.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _comm_setServerSerialDriver()

WINPR_API void _comm_setServerSerialDriver ( HANDLE  hComm,
SERIAL_DRIVER_ID  driverId 
)

FIXME: got a proper function name and place

Sets

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildCommDCBA()

WINPR_API BOOL BuildCommDCBA ( LPCSTR  lpDef,
LPDCB  lpDCB 
)
Here is the call graph for this function:

◆ BuildCommDCBAndTimeoutsA()

WINPR_API BOOL BuildCommDCBAndTimeoutsA ( LPCSTR  lpDef,
LPDCB  lpDCB,
LPCOMMTIMEOUTS  lpCommTimeouts 
)
Here is the call graph for this function:

◆ BuildCommDCBAndTimeoutsW()

WINPR_API BOOL BuildCommDCBAndTimeoutsW ( LPCWSTR  lpDef,
LPDCB  lpDCB,
LPCOMMTIMEOUTS  lpCommTimeouts 
)
Here is the call graph for this function:

◆ BuildCommDCBW()

WINPR_API BOOL BuildCommDCBW ( LPCWSTR  lpDef,
LPDCB  lpDCB 
)
Here is the call graph for this function:

◆ ClearCommBreak()

WINPR_API BOOL ClearCommBreak ( HANDLE  hFile)
Here is the call graph for this function:

◆ ClearCommError()

WINPR_API BOOL ClearCommError ( HANDLE  hFile,
PDWORD  lpErrors,
LPCOMSTAT  lpStat 
)
Here is the call graph for this function:

◆ CommConfigDialogA()

WINPR_API BOOL CommConfigDialogA ( LPCSTR  lpszName,
HWND  hWnd,
LPCOMMCONFIG  lpCC 
)
Here is the call graph for this function:

◆ CommConfigDialogW()

WINPR_API BOOL CommConfigDialogW ( LPCWSTR  lpszName,
HWND  hWnd,
LPCOMMCONFIG  lpCC 
)
Here is the call graph for this function:

◆ CommCreateFileA()

WINPR_API HANDLE CommCreateFileA ( LPCSTR  lpDeviceName,
DWORD  dwDesiredAccess,
DWORD  dwShareMode,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
DWORD  dwCreationDisposition,
DWORD  dwFlagsAndAttributes,
HANDLE  hTemplateFile 
)

A handle can only be created on defined devices with DefineCommDevice(). This also ensures that CommCreateFileA() has been registered through RegisterHandleCreator().

http://msdn.microsoft.com/en-us/library/windows/desktop/aa363198%28v=vs.85%29.aspx

Parameters
lpDeviceNamee.g. COM1, ...
dwDesiredAccessexpects GENERIC_READ | GENERIC_WRITE, a warning message is printed otherwise. TODO: better support.
dwShareModemust be zero, INVALID_HANDLE_VALUE is returned otherwise and GetLastError() should return ERROR_SHARING_VIOLATION.
lpSecurityAttributesNULL expected, a warning message is printed otherwise. TODO: better support.
dwCreationDispositionmust be OPEN_EXISTING. If the communication device doesn't exist INVALID_HANDLE_VALUE is returned and GetLastError() returns ERROR_FILE_NOT_FOUND.
dwFlagsAndAttributeszero expected, a warning message is printed otherwise.
hTemplateFilemust be NULL.
Returns
INVALID_HANDLE_VALUE on error.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommDeviceIoControl()

WINPR_API BOOL CommDeviceIoControl ( HANDLE  hDevice,
DWORD  dwIoControlCode,
LPVOID  lpInBuffer,
DWORD  nInBufferSize,
LPVOID  lpOutBuffer,
DWORD  nOutBufferSize,
LPDWORD  lpBytesReturned,
LPOVERLAPPED  lpOverlapped 
)

FIXME: to be moved in comm_ioctl.h

FIXME: to be used through winpr-io's DeviceIoControl

Any previous error as returned by GetLastError is cleared.

ERRORS: ERROR_INVALID_HANDLE ERROR_INVALID_PARAMETER ERROR_NOT_SUPPORTED lpOverlapped is not supported ERROR_INSUFFICIENT_BUFFER ERROR_CALL_NOT_IMPLEMENTED unimplemented ioctl

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommReadFile()

WINPR_API BOOL CommReadFile ( HANDLE  hDevice,
LPVOID  lpBuffer,
DWORD  nNumberOfBytesToRead,
LPDWORD  lpNumberOfBytesRead,
LPOVERLAPPED  lpOverlapped 
)

FIXME: to be moved in comm_io.h

ERRORS: ERROR_INVALID_HANDLE ERROR_NOT_SUPPORTED ERROR_INVALID_PARAMETER ERROR_TIMEOUT ERROR_IO_DEVICE ERROR_BAD_DEVICE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommWriteFile()

WINPR_API BOOL CommWriteFile ( HANDLE  hDevice,
LPCVOID  lpBuffer,
DWORD  nNumberOfBytesToWrite,
LPDWORD  lpNumberOfBytesWritten,
LPOVERLAPPED  lpOverlapped 
)

FIXME: to be moved in comm_io.h

ERRORS: ERROR_INVALID_HANDLE ERROR_NOT_SUPPORTED ERROR_INVALID_PARAMETER ERROR_BAD_DEVICE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineCommDevice()

WINPR_API BOOL DefineCommDevice ( LPCTSTR  lpDeviceName,
LPCTSTR  lpTargetPath 
)

Returns TRUE on success, FALSE otherwise. To get extended error information, call GetLastError.

ERRORS: ERROR_DLL_INIT_FAILED ERROR_OUTOFMEMORY was not possible to get mappings. ERROR_INVALID_DATA was not possible to add the device.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EscapeCommFunction()

WINPR_API BOOL EscapeCommFunction ( HANDLE  hFile,
DWORD  dwFunc 
)
Here is the call graph for this function:

◆ GetCommConfig()

WINPR_API BOOL GetCommConfig ( HANDLE  hCommDev,
LPCOMMCONFIG  lpCC,
LPDWORD  lpdwSize 
)
Here is the call graph for this function:

◆ GetCommMask()

WINPR_API BOOL GetCommMask ( HANDLE  hFile,
PDWORD  lpEvtMask 
)
Here is the call graph for this function:

◆ GetCommModemStatus()

WINPR_API BOOL GetCommModemStatus ( HANDLE  hFile,
PDWORD  lpModemStat 
)
Here is the call graph for this function:

◆ GetCommProperties()

WINPR_API BOOL GetCommProperties ( HANDLE  hFile,
LPCOMMPROP  lpCommProp 
)

ERRORS: ERROR_DLL_INIT_FAILED ERROR_INVALID_HANDLE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCommState()

WINPR_API BOOL GetCommState ( HANDLE  hFile,
LPDCB  lpDCB 
)

ERRORS: ERROR_INVALID_HANDLE ERROR_INVALID_DATA ERROR_IO_DEVICE ERROR_OUTOFMEMORY

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCommTimeouts()

WINPR_API BOOL GetCommTimeouts ( HANDLE  hFile,
LPCOMMTIMEOUTS  lpCommTimeouts 
)

ERRORS: ERROR_INVALID_HANDLE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDefaultCommConfigA()

WINPR_API BOOL GetDefaultCommConfigA ( LPCSTR  lpszName,
LPCOMMCONFIG  lpCC,
LPDWORD  lpdwSize 
)
Here is the call graph for this function:

◆ GetDefaultCommConfigW()

WINPR_API BOOL GetDefaultCommConfigW ( LPCWSTR  lpszName,
LPCOMMCONFIG  lpCC,
LPDWORD  lpdwSize 
)
Here is the call graph for this function:

◆ IsCommDevice()

WINPR_API BOOL IsCommDevice ( LPCTSTR  lpDeviceName)

Checks whether lpDeviceName is a valid and registered Communication device.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PurgeComm()

WINPR_API BOOL PurgeComm ( HANDLE  hFile,
DWORD  dwFlags 
)
Here is the call graph for this function:

◆ QueryCommDevice()

WINPR_API DWORD QueryCommDevice ( LPCTSTR  lpDeviceName,
LPTSTR  lpTargetPath,
DWORD  ucchMax 
)

Returns the number of target paths in the buffer pointed to by lpTargetPath.

The current implementation returns in any case 0 and 1 target path. A NULL lpDeviceName is not supported yet to get all the paths.

ERRORS: ERROR_SUCCESS ERROR_DLL_INIT_FAILED ERROR_OUTOFMEMORY was not possible to get mappings. ERROR_NOT_SUPPORTED equivalent QueryDosDevice feature not supported. ERROR_INVALID_DATA was not possible to retrieve any device information. ERROR_INSUFFICIENT_BUFFER too small lpTargetPath

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCommBreak()

WINPR_API BOOL SetCommBreak ( HANDLE  hFile)
Here is the call graph for this function:

◆ SetCommConfig()

WINPR_API BOOL SetCommConfig ( HANDLE  hCommDev,
LPCOMMCONFIG  lpCC,
DWORD  dwSize 
)
Here is the call graph for this function:

◆ SetCommMask()

WINPR_API BOOL SetCommMask ( HANDLE  hFile,
DWORD  dwEvtMask 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCommState()

WINPR_API BOOL SetCommState ( HANDLE  hFile,
LPDCB  lpDCB 
)
Returns
TRUE on success, FALSE otherwise.

As of today, SetCommState() can fail half-way with some settings applied and some others not. SetCommState() returns on the first failure met. FIXME: or is it correct?

ERRORS: ERROR_INVALID_HANDLE ERROR_IO_DEVICE

ioctl calls stage

upcomingTermios stage

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCommTimeouts()

WINPR_API BOOL SetCommTimeouts ( HANDLE  hFile,
LPCOMMTIMEOUTS  lpCommTimeouts 
)

ERRORS: ERROR_INVALID_HANDLE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDefaultCommConfigA()

WINPR_API BOOL SetDefaultCommConfigA ( LPCSTR  lpszName,
LPCOMMCONFIG  lpCC,
DWORD  dwSize 
)
Here is the call graph for this function:

◆ SetDefaultCommConfigW()

WINPR_API BOOL SetDefaultCommConfigW ( LPCWSTR  lpszName,
LPCOMMCONFIG  lpCC,
DWORD  dwSize 
)
Here is the call graph for this function:

◆ SetupComm()

WINPR_API BOOL SetupComm ( HANDLE  hFile,
DWORD  dwInQueue,
DWORD  dwOutQueue 
)
Here is the call graph for this function:

◆ TransmitCommChar()

WINPR_API BOOL TransmitCommChar ( HANDLE  hFile,
char  cChar 
)
Here is the call graph for this function:

◆ WaitCommEvent()

WINPR_API BOOL WaitCommEvent ( HANDLE  hFile,
PDWORD  lpEvtMask,
LPOVERLAPPED  lpOverlapped 
)
Here is the call graph for this function:
Here is the caller graph for this function: