FreeRDP/FreeRDP — pull request #1902 by hardening (2014-06-12 21:12:31+00:00)
Title: Don't forget to SetLastError() on disconnection

Otherwise if the last error was a ERROR_NO_DATA we have no indication that the pipe has been closed.

And most of the time, the caller will enter an infinite read() loop.