private void CheckResult() { uint nNumberOfBytesTransferred = 0; if (this.writeCount > 0) { if (Win32Com.GetOverlappedResult(this.hPort, this.ptrUWO, out nNumberOfBytesTransferred, this.checkSends)) { if (this.checkSends) { this.writeCount -= (int)nNumberOfBytesTransferred; if (this.writeCount != 0) { this.ThrowException("Send Timeout"); } this.writeCount = 0; } } else if (Marshal.GetLastWin32Error() != 0x3e4L) { this.ThrowException("Write Error"); } } }