Closed Richyeoh closed 1 month ago
typedef struct _DCB {
DWORD DCBlength;
DWORD BaudRate;
DWORD fBinary : 1;
DWORD fParity : 1;
DWORD fOutxCtsFlow : 1;
DWORD fOutxDsrFlow : 1;
DWORD fDtrControl : 2;
DWORD fDsrSensitivity : 1;
DWORD fTXContinueOnXoff : 1;
DWORD fOutX : 1;
DWORD fInX : 1;
DWORD fErrorChar : 1;
DWORD fNull : 1;
DWORD fRtsControl : 2;
DWORD fAbortOnError : 1;
DWORD fDummy2 : 17;
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar;
char XoffChar;
char ErrorChar;
char EofChar;
char EvtChar;
WORD wReserved1;
} DCB, *LPDCB;
#[repr(C)]
pub struct DCB {
pub DCBlength: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html),
pub BaudRate: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html),
pub _bitfield: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html),
pub wReserved: [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html),
pub XonLim: [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html),
pub XoffLim: [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html),
pub ByteSize: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html),
pub Parity: [DCB_PARITY](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Devices/Communication/struct.DCB_PARITY.html),
pub StopBits: [DCB_STOP_BITS](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Devices/Communication/struct.DCB_STOP_BITS.html),
pub XonChar: [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html),
pub XoffChar: [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html),
pub ErrorChar: [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html),
pub EofChar: [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html),
pub EvtChar: [i8](https://doc.rust-lang.org/nightly/std/primitive.i8.html),
pub wReserved1: [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html),
}
It's packed in _bitfield
- note that bitfields aren't supported yet: https://github.com/microsoft/windows-rs/issues/2942.
Closing as duplicate of #2942
Suggestion
Windows Communication DCB dismiss fOutxCtsFlow fOutxDsrFlow fOutX fInX etc field.