SERIAL_COMMPROP structure

The SERIAL_COMMPROP structure specifies the properties of a serial port.

Syntax


typedef struct _SERIAL_COMMPROP {
  USHORT PacketLength;
  USHORT PacketVersion;
  ULONG  ServiceMask;
  ULONG  Reserved1;
  ULONG  MaxTxQueue;
  ULONG  MaxRxQueue;
  ULONG  MaxBaud;
  ULONG  ProvSubType;
  ULONG  ProvCapabilities;
  ULONG  SettableParams;
  ULONG  SettableBaud;
  USHORT SettableData;
  USHORT SettableStopParity;
  ULONG  CurrentTxQueue;
  ULONG  CurrentRxQueue;
  ULONG  ProvSpec1;
  ULONG  ProvSpec2;
  WCHAR  ProvChar[1];
} SERIAL_COMMPROP, *PSERIAL_COMMPROP;

Members

PacketLength

The size, in bytes, of the data packet that starts with this structure and that contains the requested property data. This size includes the SERIAL_COMMPROP structure and any additional ProvChar array elements that follow this structure.

PacketVersion

The version of this structure. The current version number is 2.

ServiceMask

A bitmask that indicates which services are implemented by this communications provider. This member is always set to SERIAL_SP_SERIALCOMM by serial communications providers, including modem providers. The ProvSubType member indicates the specific type of serial communications that are implemented (for example, modem).

Reserved1

Not used.

MaxTxQueue

Maximum transmit queue size. The maximum size, in bytes, of the serial controller driver's internal output buffer. A value of zero indicates that no maximum value is imposed by the serial provider.

MaxRxQueue

Maximum receive queue size. The maximum size, in bytes, of the serial controller driver's internal input buffer. A value of zero indicates that no maximum value is imposed by the serial provider.

MaxBaud

The maximum acceptable baud rate. An extension-based serial controller driver sets this member to a baud rate expressed in bits per second (bps). For example, if the serial controller supports a maximum baud rate of 115,200 bps, the driver sets MaxBaud = 115200.

However, Serial.sys and many older serial controller drivers set MaxBaud to one of the SERIAL_BAUD_XXX flag bits that are defined in the Ntddser.h header file. The following values are defined for this member.

ValueDescription
SERIAL_BAUD_07575 bps
SERIAL_BAUD_110110 bps
SERIAL_BAUD_134_5134.5 bps
SERIAL_BAUD_150150 bps
SERIAL_BAUD_300300 bps
SERIAL_BAUD_600600 bps
SERIAL_BAUD_12001,200 bps
SERIAL_BAUD_18001,800 bps
SERIAL_BAUD_24002,400 bps
SERIAL_BAUD_48004,800 bps
SERIAL_BAUD_72007,200 bps
SERIAL_BAUD_96009,600 bps
SERIAL_BAUD_1440014,400 bps
SERIAL_BAUD_1920019,200 bps
SERIAL_BAUD_3840038,400 bps
SERIAL_BAUD_56K56,000 bps
SERIAL_BAUD_5760057,600 bps
SERIAL_BAUD_115200115,200 bps
SERIAL_BAUD_128K128,000 bps
SERIAL_BAUD_USERProgrammable baud rates are available.

 

ProvSubType

The specific communications provider type. When the ServiceMask member is set to SERIAL_SP_SERIALCOMM, ProvSubType is set to one of the following values.

ValueMeaning
SERIAL_SP_UNSPECIFIEDUnspecified
SERIAL_SP_RS232RS-232 serial port
SERIAL_SP_PARALLELParallel port
SERIAL_SP_RS422RS-422 serial port
SERIAL_SP_RS423RS-423 serial port
SERIAL_SP_RS449RS-449 serial port
SERIAL_SP_MODEMModem device
SERIAL_SP_FAXFAX device
SERIAL_SP_SCANNERScanner device
SERIAL_SP_BRIDGEUnspecified network bridge
SERIAL_SP_LATLAT protocol
SERIAL_SP_TELNETTCP/IP Telnet® protocol
SERIAL_SP_X25X.25 standards

 

ProvCapabilities

The capabilities offered by the provider. This member is set to zero or to the bitwise-OR of one or more of the following flag bits.

ValueDescription
SERIAL_PCF_DTRDSRDTR (data terminal ready) and DSR (data set ready) are supported.
SERIAL_PCF_RTSCTSRTS (request to send) and CTS (clear to send) are supported.
SERIAL_PCF_CDCD (carrier detect) is supported.
SERIAL_PCF_PARITY_CHECKParity checking is supported.
SERIAL_PCF_XONXOFFXON (transmit on) and XOFF (transmit off) flow control are supported.
SERIAL_PCF_SETXCHARThe XON and XOFF characters are settable.
SERIAL_PCF_TOTALTIMEOUTSTotal-elapsed-time time-outs are supported.
SERIAL_PCF_INTTIMEOUTSInterval time-outs are supported.
SERIAL_PCF_SPECIALCHARSSpecial characters are supported.
SERIAL_PCF_16BITMODESpecial 16-bit mode is supported.

 

SettableParams

A bitmask that indicates the communication parameter that can be changed. This member is set to zero or to the bitwise-OR of one or more of the following flag bits.

ValueDescription
SERIAL_SP_PARITYParity type (even or odd)
SERIAL_SP_BAUDBaud rate
SERIAL_SP_DATABITSData bits
SERIAL_SP_STOPBITSStop bits
SERIAL_SP_HANDSHAKINGHandshaking (flow control)
SERIAL_SP_PARITY_CHECKParity checking
SERIAL_SP_CARRIER_DETECTCarrier detect

 

SettableBaud

A bitmask that indicates the baud rates that can be used. For a table that describes the SERIAL_BAUD_XXX flag bits that are defined for this member, see the description of the MaxBaud member. SettableBaud is set to zero or to the bitwise-OR or one or more of these flag bits.

Serial controller drivers set the SERIAL_BAUD_USER flag bit in the SettableBaud bitmask value to indicate that they support higher baud rates than those that can be expressed by the other SERIAL_BAUD_XXX flag bits. For example, a driver that supports baud rates of 57600, 115200, 230400, and 460800 bps sets SettableBaud = (SERIAL_BAUD_57600 | SERIAL_BAUD_115200 | SERIAL_BAUD_USER).

SettableData

The number of data bits that can be set. This member is set to zero or to the bitwise-OR of one or more of the following flag bits.

ValueDescription
SERIAL_DATABITS_55 data bits
SERIAL_DATABITS_66 data bits
SERIAL_DATABITS_77 data bits
SERIAL_DATABITS_88 data bits
SERIAL_DATABITS_1616 data bits
SERIAL_DATABITS_16XSpecial wide path through serial hardware lines

 

SettableStopParity

The stop-bit and parity settings that can be selected. This member is set to zero or to the bitwise-OR of one or more of the following flag bits.

ValueDescription
SERIAL_STOPBITS_10One stop bit.
SERIAL_STOPBITS_15One and a half stop bits.
SERIAL_STOPBITS_20Two stop bits.
SERIAL_PARITY_NONENo parity bit is used.
SERIAL_PARITY_ODDOdd parity. The parity bit is 1 if the number of 1s in the character value is even. Otherwise, the parity bit is 0.
SERIAL_PARITY_EVENEven parity. The parity bit is 1 if the number of 1s in the character value is odd. Otherwise, the parity bit is 0.
SERIAL_PARITY_MARKThe parity bit is always set to 1.
SERIAL_PARITY_SPACEThe parity bit is always set to 0.

 

CurrentTxQueue

Transmit queue size. This member specifies the size, in bytes, of the serial controller driver's internal output buffer. A value of zero indicates that the buffer size is unavailable.

For SerCx2 and SerCx, the associated serial controller driver typically sets this member to zero. Serial.sys sets this member to a nonzero value that indicates the output buffer size.

CurrentRxQueue

Receive queue size. This member specifies the size, in bytes, of the serial controller driver's internal input buffer. A value of zero indicates that the buffer size is unavailable.

For SerCx2 and SerCx, this member is set by the associated serial controller driver. For SerCx2, the driver typically sets this member to zero. For SerCx, the driver typically sets this member to the size of the ring buffer that SerCx uses to buffer received data. This driver can call the SerCxGetRingBufferUtilization method to get the ring buffer size from SerCx.

Serial.sys sets this member to a nonzero value that indicates the input buffer size.

ProvSpec1

Provider-specific data. Applications should ignore this member unless provider-specific data about the data format required by the serial port is available.

ProvSpec2

Provider-specific data. Applications should ignore this member unless provider-specific data about the data format required by the serial port is available.

ProvChar

Provider-specific data. Applications should ignore this member unless provider-specific data about the data format required by the serial port is available. This member is the first element in a wide-character array of one or more elements. Any additional elements immediately follow this member. The PacketLength member specifies the size of the SERIAL_COMMPROP structure plus any additional ProvChar array elements that follow this structure.

Remarks

This structure is used by the IOCTL_SERIAL_GET_PROPERTIES request.

Requirements

Header

Ntddser.h

See also

IOCTL_SERIAL_GET_PROPERTIES

 

 

Send comments about this topic to Microsoft

Show: