Alex Henrie : ntdll: Finish serial reads of size 0 immediately.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Apr 12 06:45:25 CDT 2016
Module: wine
Branch: stable
Commit: e0752ba0fe3875a8329541e7a0bff59bd8d6e5e8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e0752ba0fe3875a8329541e7a0bff59bd8d6e5e8
Author: Alex Henrie <alexhenrie24 at gmail.com>
Date: Wed Feb 24 22:55:35 2016 -0700
ntdll: Finish serial reads of size 0 immediately.
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit f35c1b2dc123a834d365e0ddb441370b22b97cbc)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/kernel32/tests/comm.c | 4 ----
dlls/ntdll/file.c | 5 +++++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index 97ec794..6b0c3ed 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -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);
}
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 1027b54..e03d860 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -891,6 +891,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;
More information about the wine-cvs
mailing list