/*
 *  ntddser.h   Serial port device I/O control codes
 *
 * =========================================================================
 *
 *                          Open Watcom Project
 *
 * Copyright (c) 2004-2026 The Open Watcom Contributors. All Rights Reserved.
 *
 *    This file is automatically generated. Do not edit directly.
 *
 * =========================================================================
 */

#ifdef DEFINE_GUID

/* GUIDs */
DEFINE_GUID( GUID_DEVINTERFACE_COMPORT, 0x86E0D1E0, 0x8089, 0x11D0, 0x9C, 0xE4, 0x08, 0x00, 0x3E, 0x30, 0x1F, 0x73 );
DEFINE_GUID( GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18 );

/* Old names for compatibility */
#define GUID_CLASS_COMPORT          GUID_DEVINTERFACE_COMPORT
#define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR

#endif /* DEFINE_GUID */

#ifndef _NTDDSER_
#define _NTDDSER_

#ifndef _ENABLE_AUTODEPEND
 #pragma read_only_file
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* Physical address data type alias */
#undef PHYSICAL_ADDRESS
#define PHYSICAL_ADDRESS    LARGE_INTEGER

/* Serial port device I/O control codes */
#define IOCTL_SERIAL_SET_BUAD_RATE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_QUEUE_SIZE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 2, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_LINE_CONTROL \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 3, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_BREAK_ON \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 4, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_BREAK_OFF \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 5, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_IMMEDIATE_CHAR \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 6, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_TIMEOUTS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 7, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_TIMEOUTS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 8, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_DIR \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 9, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_CLR_DTR \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 10, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_RESET_DEVICE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_RTS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_CLR_RTS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_XOFF \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_XON \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_WAIT_MASK \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 16, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_WAIT_MASK \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_WAIT_ON_MASK \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 18, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_PURGE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 19, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_BAUD_RATE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_LINE_CONTROL \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_CHARS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_CHARS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 23, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_HANDFLOW \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 24, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_HANDFLOW \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 25, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_MODEMSTATUS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 26, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_COMMSTATUS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 27, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_XOFF_COUNTER \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 28, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_PROPERTIES \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 29, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_DTRRTS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 30, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_LSRMST_INSERT \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 31, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_CONFIG_SIZE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 32, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_COMMCONFIG \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 33, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_COMMCONFIG \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 34, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_STATS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 35, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_CLEAR_STATS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 36, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_GET_MODEM_CONTROL \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 37, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_MODEM_CONTROL \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 38, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_SET_FIFO_CONTROL \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 39, METHOD_BUFFERED, FILE_ANY_ACCESS )

/* Serial port enumerator device I/O control codes */
#define IOCTL_SERENUM_EXPOSE_HARDWARE \
    CTL_CODE( FILE_DEVICE_SERENUM, 128, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERENUM_REMOVE_HARDWARE \
    CTL_CODE( FILE_DEVICE_SERENUM, 129, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERENUM_PORT_DESC \
    CTL_CODE( FILE_DEVICE_SERENUM, 130, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERENUM_GET_PORT_NAME \
    CTL_CODE( FILE_DEVICE_SERENUM, 131, METHOD_BUFFERED, FILE_ANY_ACCESS )

/* Serial port internal device I/O control codes */
#define IOCTL_SERIAL_INTERNAL_DO_WAIT_WAKE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_INTERNAL_CANCEL_WAIT_WAKE \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 2, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_INTERNAL_BASIC_SETTINGS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 3, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_SERIAL_INTERNAL_RESTORE_SETTINGS \
    CTL_CODE( FILE_DEVICE_SERIAL_PORT, 4, METHOD_BUFFERED, FILE_ANY_ACCESS )

/* Serial port enumerator internal device I/O control codes */
#define IOCTL_INTERNAL_SERENUM_REMOVE_SELF \
    CTL_CODE( FILE_DEVICE_SERENUM, 129, METHOD_NEITHER, FILE_ANY_ACCESS )

/* Serial event masks */
#define SERIAL_EV_RXCHAR    0x0001
#define SERIAL_EV_RXFLAG    0x0002
#define SERIAL_EV_TXEMPTY   0x0004
#define SERIAL_EV_CTS       0x0008
#define SERIAL_EV_DSR       0x0010
#define SERIAL_EV_RLSD      0x0020
#define SERIAL_EV_BREAK     0x0040
#define SERIAL_EV_ERR       0x0080
#define SERIAL_EV_RING      0x0100
#define SERIAL_EV_PERR      0x0200
#define SERIAL_EV_RX80FULL  0x0400
#define SERIAL_EV_EVENT1    0x0800
#define SERIAL_EV_EVENT2    0x1000

/* Serial purge masks */
#define SERIAL_PURGE_TXABORT    0x00000001L
#define SERIAL_PURGE_RXABORT    0x00000002L
#define SERIAL_PURGE_TXCLEAR    0x00000004L
#define SERIAL_PURGE_RXCLEAR    0x00000008L

/* Stop bits */
#define STOP_BIT_1      0
#define STOP_BITS_1_5   1
#define STOP_BITS_2     2

/* Parity values */
#define NO_PARITY       0
#define ODD_PARITY      1
#define EVEN_PARITY     2
#define MARK_PARITY     3
#define SPACE_PARITY    4

/* Serial handshake values */
#define SERIAL_DTR_MASK             0x00000003L
#define SERIAL_DTR_CONTROL          0x00000001L
#define SERIAL_DTR_HANDSHAKE        0x00000002L
#define SERIAL_CTS_HANDSHAKE        0x00000008L
#define SERIAL_DSR_HANDSHAKE        0x00000010L
#define SERIAL_DCD_HANDSHAKE        0x00000020L
#define SERIAL_OUT_HANDSHAKEMASK    0x00000038L
#define SERIAL_DSR_SENSITIVITY      0x00000040L
#define SERIAL_ERROR_ABORT          0x80000000L
#define SERIAL_CONTROL_INVALID      0x7FFFFF84L
#define SERIAL_AUTO_TRANSMIT        0x00000001L
#define SERIAL_AUTO_RECEIVE         0x00000002L
#define SERIAL_ERROR_CHAR           0x00000004L
#define SERIAL_NULL_STRIPPING       0x00000008L
#define SERIAL_BREAK_CHAR           0x00000010L
#define SERIAL_RTS_MASK             0x000000C0L
#define SERIAL_RTS_CONTROL          0x00000040L
#define SERIAL_RTS_HANDSHAKE        0x00000080L
#define SERIAL_TRANSMIT_TOGGLE      0x000000C0L
#define SERIAL_XOFF_CONTINUE        0x80000000L
#define SERIAL_FLOW_INVALID         0x7FFFFF20L

/* Serial hold reason flags */
#define SERIAL_TX_WAITING_FOR_CTS   0x00000001L
#define SERIAL_TX_WAITING_FOR_DSR   0x00000002L
#define SERIAL_TX_WAITING_FOR_DCD   0x00000004L
#define SERIAL_TX_WAITING_FOR_XON   0x00000008L
#define SERIAL_TX_WAITING_XOFF_SENT 0x00000010L
#define SERIAL_TX_WAITING_ON_BREAK  0x00000020L
#define SERIAL_RX_WAITING_FOR_DSR   0x00000040L

/* Serial error codes */
#define SERIAL_ERROR_BREAK          0x00000001L
#define SERIAL_ERROR_FRAMING        0x00000002L
#define SERIAL_ERROR_OVERRUN        0x00000004L
#define SERIAL_ERROR_QUEUEOVERRUN   0x00000008L
#define SERIAL_ERROR_PARITY         0x00000010L

/* Serial provider subtypes */
#define SERIAL_SP_SERIALCOMM    0x00000001L
#define SERIAL_SP_UNSPECIFIED   0x00000000L
#define SERIAL_SP_RS232         0x00000001L
#define SERIAL_SP_PARALLEL      0x00000002L
#define SERIAL_SP_RS422         0x00000003L
#define SERIAL_SP_RS423         0x00000004L
#define SERIAL_SP_RS449         0x00000005L
#define SERIAL_SP_MODEM         0x00000006L
#define SERIAL_SP_FAX           0x00000021L
#define SERIAL_SP_SCANNER       0x00000022L
#define SERIAL_SP_BRIDGE        0x00000100L
#define SERIAL_SP_LAT           0x00000101L
#define SERIAL_SP_TELNET        0x00000102L
#define SERIAL_SP_X25           0x00000103L

/* Serial provider capability flags */
#define SERIAL_PCF_DTRDSR           0x00000001L
#define SERIAL_PCF_RTSCTS           0x00000002L
#define SERIAL_PCF_CD               0x00000004L
#define SERIAL_PCF_PARITY_CHECK     0x00000008L
#define SERIAL_PCF_XONXOFF          0x00000010L
#define SERIAL_PCF_SETXCHAR         0x00000020L
#define SERIAL_PCF_TOTALTIMEOUTS    0x00000040L
#define SERIAL_PCF_INTTIMEOUTS      0x00000080L
#define SERIAL_PCF_SPECIALCHARS     0x00000100L
#define SERIAL_PCF_16BITMODE        0x00000200L

/* Serial settable parameters */
#define SERIAL_SP_PARITY            0x00000001L
#define SERIAL_SP_BAUD              0x00000002L
#define SERIAL_SP_DATABITS          0x00000004L
#define SERIAL_SP_STOPBITS          0x00000008L
#define SERIAL_SP_HANDSHAKING       0x00000010L
#define SERIAL_SP_PARITY_CHECK      0x00000020L
#define SERIAL_SP_CARRIER_DETECT    0x00000040L

/* Serial baud rates */
#define SERIAL_BAUD_075     0x00000001L
#define SERIAL_BAUD_110     0x00000002L
#define SERIAL_BAUD_134_5   0x00000004L
#define SERIAL_BAUD_150     0x00000008L
#define SERIAL_BAUD_300     0x00000010L
#define SERIAL_BAUD_600     0x00000020L
#define SERIAL_BAUD_1200    0x00000040L
#define SERIAL_BAUD_1800    0x00000080L
#define SERIAL_BAUD_2400    0x00000100L
#define SERIAL_BAUD_4800    0x00000200L
#define SERIAL_BAUD_7200    0x00000400L
#define SERIAL_BAUD_9600    0x00000800L
#define SERIAL_BAUD_14400   0x00001000L
#define SERIAL_BAUD_19200   0x00002000L
#define SERIAL_BAUD_38400   0x00004000L
#define SERIAL_BAUD_56K     0x00008000L
#define SERIAL_BAUD_128K    0x00010000L
#define SERIAL_BAUD_115200  0x00020000L
#define SERIAL_BAUD_57600   0x00040000L
#define SERIAL_BAUD_USER    0x00080000L

/* Serial data bits */
#define SERIAL_DATABITS_5   0x0001
#define SERIAL_DATABITS_6   0x0002
#define SERIAL_DATABITS_7   0x0004
#define SERIAL_DATABITS_8   0x0008
#define SERIAL_DATABITS_16  0x0010
#define SERIAL_DATABITS_16X 0x0020

/* Serial stop and parity bits */
#define SERIAL_STOPBITS_10  0x0001
#define SERIAL_STOPBITS_15  0x0002
#define SERIAL_STOPBITS_20  0x0004
#define SERIAL_PARITY_NONE  0x0100
#define SERIAL_PARITY_ODD   0x0200
#define SERIAL_PARITY_EVEN  0x0400
#define SERIAL_PARITY_MARK  0x0800
#define SERIAL_PARITY_SPACE 0x1000

/* Serial RS232 masks */
#define SERIAL_DTR_STATE    0x00000001L
#define SERIAL_RTS_STATE    0x00000002L
#define SERIAL_CTS_STATE    0x00000010L
#define SERIAL_DSR_STATE    0x00000020L
#define SERIAL_RI_STATE     0x00000040L
#define SERIAL_DCD_STATE    0x00000080L

/* Serial data special values */
#define SERIAL_LSRMST_ESCAPE        0x00
#define SERIAL_LSRMST_LSR_DATA      0x01
#define SERIAL_LSRMST_LSR_NODATA    0x02
#define SERIAL_LSRMST_MST           0x03

/* Serial FIFO control register values */
#define SERIAL_IOC_FCR_FIFO_ENABLE      0x00000001L
#define SERIAL_IOC_FCR_RCVR_RESET       0x00000002L
#define SERIAL_IOC_FCR_XMIT_RESET       0x00000004L
#define SERIAL_IOC_FCR_DMA_MODE         0x00000008L
#define SERIAL_IOC_FCR_RES1             0x00000010L
#define SERIAL_IOC_FCR_RES2             0x00000020L
#define SERIAL_IOC_FCR_RCVR_TRIGGER_LSB 0x00000040L
#define SERIAL_IOC_FCR_RCVR_TRIGGER_MSB 0x00000080L

/* Modem control register values */
#define SERIAL_IOC_MCR_DTR  0x00000001L
#define SERIAL_IOC_MCR_RTS  0x00000002L
#define SERIAL_IOC_MCR_OUT1 0x00000004L
#define SERIAL_IOC_MCR_OUT2 0x00000008L
#define SERIAL_IOC_MCR_LOOP 0x00000010L

/* Serial performance statistics */
typedef struct _SERIALPERF_STATS {
    ULONG   ReceivedCount;
    ULONG   TransmittedCount;
    ULONG   FrameErrorCount;
    ULONG   SerialOverrunErrorCount;
    ULONG   BufferOverrunErrorCount;
    ULONG   ParityErrorCount;
} SERIALPERF_STATS;
typedef SERIALPERF_STATS    *PSERIALPERF_STATS;

/* Serial configuration */
typedef struct _SERIALCONFIG {
    ULONG   Size;
    USHORT  Version;
    ULONG   SubType;
    ULONG   ProvOffset;
    ULONG   ProviderSize;
    WCHAR   ProviderData[1];
} SERIALCONFIG;
typedef SERIALCONFIG    *PSERIALCONFIG;

/* Serial line control */
typedef struct _SERIAL_LINE_CONTROL {
    UCHAR   StopBits;
    UCHAR   Parity;
    UCHAR   WordLength;
} SERIAL_LINE_CONTROL;
typedef SERIAL_LINE_CONTROL *PSERIAL_LINE_CONTROL;

/* Serial timeouts */
typedef struct _SERIAL_TIMEOUTS {
    ULONG   ReadIntervalTimeout;
    ULONG   ReadTotalTimeoutMultiplier;
    ULONG   ReadTotalTimeoutConstant;
    ULONG   WriteTotalTimeoutMultiplier;
    ULONG   WriteTotalTimeoutConstant;
} SERIAL_TIMEOUTS;
typedef SERIAL_TIMEOUTS *PSERIAL_TIMEOUTS;

/* Serial queue size */
typedef struct _SERIAL_QUEUE_SIZE {
    ULONG   InSize;
    ULONG   OutSize;
} SERIAL_QUEUE_SIZE;
typedef SERIAL_QUEUE_SIZE   *PSERIAL_QUEUE_SIZE;

/* Serial baud rate */
typedef struct _SERIAL_BAUD_RATE {
    ULONG   BuadRate;
} SERIAL_BAUD_RATE;
typedef SERIAL_BAUD_RATE    *PSERIAL_BAUD_RATE;

/* Serial characters */
typedef struct _SERIAL_CHARS {
    UCHAR   EofChar;
    UCHAR   ErrorChar;
    UCHAR   BreakChar;
    UCHAR   EventChar;
    UCHAR   XonChar;
    UCHAR   XoffChar;
} SERIAL_CHARS;
typedef SERIAL_CHARS    *PSERIAL_CHARS;

/* Serial handflow */
typedef struct _SERIAL_HANDFLOW {
    ULONG   ControlHandShake;
    ULONG   FlowReplace;
    LONG    XonLimit;
    LONG    XoffLimit;
} SERIAL_HANDFLOW;
typedef SERIAL_HANDFLOW *PSERIAL_HANDFLOW;

/* Serial basic settings */
typedef struct _SERIAL_BASIC_SETTINGS {
    SERIAL_TIMEOUTS Timeouts;
    SERIAL_HANDFLOW HandFlow;
    ULONG           RxFifo;
    ULONG           TxFifo;
} SERIAL_BASIC_SETTINGS;
typedef SERIAL_BASIC_SETTINGS   *PSERIAL_BASIC_SETTINGS;

/* Serial status */
typedef struct _SERIAL_STATUS {
    ULONG   Errors;
    ULONG   HoldReasons;
    ULONG   AmountInInQueue;
    ULONG   AmountInOutQueue;
    BOOLEAN EofReceived;
    BOOLEAN WaitForImmediate;
} SERIAL_STATUS;
typedef SERIAL_STATUS   *PSERIAL_STATUS;

/* Serial Xoff counter */
typedef struct _SERIAL_XOFF_COUNTER {
    ULONG   Timeout;
    LONG    Counter;
    UCHAR   XoffChar;
} SERIAL_XOFF_COUNTER;
typedef SERIAL_XOFF_COUNTER *PSERIAL_XOFF_COUNTER;

/* Serial communication property */
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;
typedef SERIAL_COMMPROP *PSERIAL_COMMPROP;

/* Serial port enumerator port description */
typedef struct _SERENUM_PORT_DESC {
    ULONG               Size;
    PVOID               PortHandle;
    PHYSICAL_ADDRESS    PortAddress;
    USHORT              Reserved[1];
} SERENUM_PORT_DESC;
typedef SERENUM_PORT_DESC   *PSERENUM_PORT_DESC;

/* Serial port enumerator callbacks */
typedef UCHAR (NTAPI *PSERENUM_READPORT)( PVOID );
typedef VOID (NTAPI *PSERENUM_WRITEPORT)( PVOID, UCHAR );

/* Serial port enumerator portions */
typedef enum _SERENUM_PORTION {
    SerenumFirstHalf    = 0,
    SerenumSecondHalf   = 1,
    SerenumWhole        = 2
} SERENUM_PORTION;

/* Serial port enumerator port parameters */
typedef struct _SERENUM_PORT_PARAMETERS {
    ULONG               Size;
    PSERENUM_READPORT   ReadAccessor;
    PSERENUM_WRITEPORT  WriteAccessor;
    PVOID               SerPortAddress;
    PVOID               HardwareHandle;
    SERENUM_PORTION     Portion;
    USHORT              NumberAxis;
    USHORT              Reserved[3];
} SERENUM_PORT_PARAMETERS;
typedef SERENUM_PORT_PARAMETERS *PSERENUM_PORT_PARAMETERS;

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* _NTDDSER_ */
