Alex Henrie : ntdll: Finish serial reads of size 0 immediately.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 25 10:56:04 CST 2016


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

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>

---

 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 3883e5a..46fea51 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -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;




More information about the wine-cvs mailing list