Mike Kaplinskiy : ntdll: Remember to set the iosb status if using a worker thread for serial wait.

Alexandre Julliard julliard at winehq.org
Tue Sep 8 08:53:59 CDT 2009


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

Author: Mike Kaplinskiy <mike.kaplinskiy at gmail.com>
Date:   Thu Sep  3 21:47:32 2009 -0400

ntdll: Remember to set the iosb status if using a worker thread for serial wait.

---

 dlls/ntdll/serial.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index dfb00e1..2aff6fc 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -851,6 +851,7 @@ typedef struct async_commio
 {
     HANDLE              hDevice;
     DWORD*              events;
+    IO_STATUS_BLOCK*    iosb;
     HANDLE              hEvent;
     DWORD               evtmask;
     DWORD               mstat;
@@ -985,12 +986,13 @@ 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->hEvent) NtSetEvent(commio->hEvent, NULL);
     RtlFreeHeap(GetProcessHeap(), 0, commio);
     return 0;
 }
 
-static NTSTATUS wait_on(HANDLE hDevice, int fd, HANDLE hEvent, DWORD* events)
+static NTSTATUS wait_on(HANDLE hDevice, int fd, HANDLE hEvent, PIO_STATUS_BLOCK piosb, DWORD* events)
 {
     async_commio*       commio;
     NTSTATUS            status;
@@ -1003,6 +1005,7 @@ static NTSTATUS wait_on(HANDLE hDevice, int fd, HANDLE hEvent, DWORD* events)
 
     commio->hDevice = hDevice;
     commio->events  = events;
+    commio->iosb    = piosb;
     commio->hEvent  = hEvent;
     get_wait_mask(commio->hDevice, &commio->evtmask);
 
@@ -1301,7 +1304,7 @@ static inline NTSTATUS io_control(HANDLE hDevice,
     case IOCTL_SERIAL_WAIT_ON_MASK:
         if (lpOutBuffer && nOutBufferSize == sizeof(DWORD))
         {
-            if (!(status = wait_on(hDevice, fd, hEvent, lpOutBuffer)))
+            if (!(status = wait_on(hDevice, fd, hEvent, piosb, lpOutBuffer)))
                 sz = sizeof(DWORD);
         }
         else




More information about the wine-cvs mailing list