title: Closing & then opening the serial port driver hangs Windows CE 6.0
body: <p>Problem Iam facing closely related to the an old thread here:</p>
  
  <p><a href="https://stackoverflow.com/questions/702524/serialport-open-freezes-the-system-if-data-was-received-previously-compact-fr">SerialPort.Open() freezes the system if data was received previously (Compact Framework)</a></p>
  
  <ol>
  <li><p>Windows embedded CE 6.0 running on a x86 based SBC having 4 serial ports based on 16550 UART(part of the x86 SoC itself).</p></li>
  <li><p>Connect a field device to a serial port that transmits at regular periods.</p></li>
  <li><p>Open this serial port in a native app and keep reading data from the connected device.
  The native app uses the standard Win CE serial Communication API(CreateFile(), SetCommState(), ReadFile() etc.</p></li>
  <li><p>Close this serial port. But serial data is still getting into the Windows CE system.</p></li>
  <li><p>After some time try to open this serial port again. The whole  Windows CE system HANGS.</p></li>
  </ol>
  
  <p>After debugging the Windows CE kernel the hangup seems to be happening because of an infinite loop created in the Serial PDD driver after the port re-open. Still debugging...</p>
  
  <p>Anyone has come across this problem already?</p>
  
  <p>P.S> The same hang problem happens even if .Net CF SerialPort class is used &amp; the same steps are followed(using a C# SmartDevice Console type app built in VS2008).</p>