private void SetCommStateNative(ref SerialPortFixer.Dcb lpDcb) { int num = 0; SerialPortFixer.Comstat comstat = new SerialPortFixer.Comstat(); int num1 = 0; while (num1 < 10) { if (!SerialPortFixer.ClearCommError(this.m_Handle, ref num, ref comstat)) { SerialPortFixer.WinIoError(); } if (!SerialPortFixer.SetCommState(this.m_Handle, ref lpDcb)) { if (num1 == 9) { SerialPortFixer.WinIoError(); } num1++; } else { return; } } }
private static extern bool ClearCommError(SafeFileHandle hFile, ref int lpErrors, ref SerialPortFixer.Comstat lpStat);