ntdll: Finish serial reads of size 0 immediately.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2016-02-24 22:55:35 -07:00 committed by Alexandre Julliard
parent 97b9ff81b8
commit f35c1b2dc1
2 changed files with 5 additions and 4 deletions

View File

@ -2151,13 +2151,9 @@ static void test_read_write(void)
iob.Information = -1;
offset.QuadPart = (LONGLONG)i;
status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, &offset, NULL);
/* FIXME: Remove once Wine is fixed */
if (status == STATUS_PENDING) WaitForSingleObject(hcom, TIMEOUT);
if (i >= 0)
{
todo_wine
ok(status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, status);
todo_wine
ok(U(iob).Status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, U(iob).Status);
ok(iob.Information == 0, "%d: expected 0, got %lu\n", i, iob.Information);
}

View File

@ -883,6 +883,11 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
status = length ? STATUS_END_OF_FILE : STATUS_SUCCESS;
goto done;
case FD_TYPE_SERIAL:
if (!length)
{
status = STATUS_SUCCESS;
goto done;
}
break;
default:
status = STATUS_PIPE_BROKEN;