Specifically handle the case when an overlapped ReadFile call fails with ERROR_MORE_DATA. This enables a hack where a windows::stream_handle can be used with a message-oriented named pipe.
diff --git a/asio/include/asio/detail/win_iocp_handle_service.hpp b/asio/include/asio/detail/win_iocp_handle_service.hpp index 99c472c..315b9c0 100644 --- a/asio/include/asio/detail/win_iocp_handle_service.hpp +++ b/asio/include/asio/detail/win_iocp_handle_service.hpp
@@ -762,7 +762,7 @@ static_cast<DWORD>(asio::buffer_size(buffer)), &bytes_transferred, ptr.get()); DWORD last_error = ::GetLastError(); - if (!ok && last_error != ERROR_IO_PENDING) + if (!ok && last_error != ERROR_IO_PENDING && last_error != ERROR_MORE_DATA) { asio::io_service::work work(this->get_io_service()); ptr.reset();