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

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2016-05-26 23:34:26 -06:00 committed by Alexandre Julliard
parent 7a8ebc828e
commit 84fcaafb89
1 changed files with 14 additions and 0 deletions

View File

@ -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 (;;) for (;;)
{ {
if ((result = read( unix_handle, (char *)buffer + total, length - total )) >= 0) if ((result = read( unix_handle, (char *)buffer + total, length - total )) >= 0)