Alex Henrie : ntdll: Skip synchronous read if a serial read interval timeout is set.

Alexandre Julliard julliard at winehq.org
Thu Jun 9 10:35:13 CDT 2016


Module: wine
Branch: master
Commit: 84fcaafb895f08b3513486f7b687882a2ffca1f8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=84fcaafb895f08b3513486f7b687882a2ffca1f8

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Thu May 26 23:34:26 2016 -0600

ntdll: Skip synchronous read if a serial read interval timeout is set.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/file.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 7d09c8f..7fbde50 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -904,6 +904,20 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
         }
     }
 
+    if (type == FD_TYPE_SERIAL && async_read && length)
+    {
+        /* an asynchronous serial port read with a read interval timeout needs to
+           skip the synchronous read to make sure that the server starts the read
+           interval timer after the first read */
+        if ((status = get_io_timeouts( hFile, type, length, TRUE, &timeouts ))) goto err;
+        if (timeouts.interval)
+        {
+            status = register_async_file_read( hFile, hEvent, apc, apc_user, io_status,
+                                               buffer, total, length, FALSE );
+            goto err;
+        }
+    }
+
     for (;;)
     {
         if ((result = read( unix_handle, (char *)buffer + total, length - total )) >= 0)




More information about the wine-cvs mailing list