[PATCH v2] ntdll: Finish serial reads of size 0 immediately.

Alexandre Julliard julliard at winehq.org
Wed Feb 24 07:41:50 CST 2016


Alex Henrie <alexhenrie24 at gmail.com> writes:

> @@ -854,11 +857,11 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
>              goto done;
>          }
>      }
> -    else if (type == FD_TYPE_SERIAL || type == FD_TYPE_DEVICE)
> +    else if (type == FD_TYPE_SERIAL)
>      {
> -        if (async_read && (!offset || offset->QuadPart < 0))
> +        if (!length)
>          {
> -            status = STATUS_INVALID_PARAMETER;
> +            status = STATUS_SUCCESS;
>              goto done;

I think it would be cleaner to use the same code path as the other types
(calling read() first) instead of adding a special case for serial.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list