Dmitry Timoshkov : ntdll: Make asynchronous WaitCommEvent report correct number of bytes returned.

Alexandre Julliard julliard at winehq.org
Thu Sep 26 15:44:06 CDT 2013


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Sep 26 11:51:40 2013 +0900

ntdll: Make asynchronous WaitCommEvent report correct number of bytes returned.

---

 dlls/kernel32/tests/comm.c |    2 --
 dlls/ntdll/serial.c        |   11 ++++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index 4e7fee5..7ec5fc5 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -863,7 +863,6 @@ todo_wine
     {
         res = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE);
         ok(res, "GetOverlappedResult reported error %d\n", GetLastError());
-todo_wine
         ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes);
         res = TRUE;
     }
@@ -2135,7 +2134,6 @@ todo_wine
                 last_event_time = after;
                 ret = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE);
                 ok(ret, "GetOverlappedResult reported error %d\n", GetLastError());
-todo_wine
                 ok(bytes == sizeof(evtmask), "expected sizeof(evtmask), got %u\n", bytes);
                 ok(evtmask & EV_RXCHAR, "EV_RXCHAR should be set\n");
 
diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index 5e6eaf4..db618f8 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -947,7 +947,16 @@ static DWORD CALLBACK wait_for_event(LPVOID arg)
         }
         if (needs_close) close( fd );
     }
-    if (commio->iosb) commio->iosb->u.Status = *commio->events ? STATUS_SUCCESS : STATUS_CANCELLED;
+    if (commio->iosb)
+    {
+        if (*commio->events)
+        {
+            commio->iosb->u.Status = STATUS_SUCCESS;
+            commio->iosb->Information = sizeof(DWORD);
+        }
+        else
+            commio->iosb->u.Status = STATUS_CANCELLED;
+    }
     if (commio->hEvent) NtSetEvent(commio->hEvent, NULL);
     RtlFreeHeap(GetProcessHeap(), 0, commio);
     return 0;




More information about the wine-cvs mailing list