Well there is such a thing as
- checking for errors
- reading the manual, say -> SetCommState function (Windows)

This is exactly what you have in YOUR DCB.

I suggest you use GetCommState()...