Jacek Caban : server: Don' t change iosb without associated async in wake_message.

Alexandre Julliard julliard at winehq.org
Thu Mar 29 19:13:28 CDT 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Mar 28 22:46:27 2018 +0200

server: Don't change iosb without associated async in wake_message.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/named_pipe.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/server/named_pipe.c b/server/named_pipe.c
index c77b07f..a6f5fb6 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -356,13 +356,12 @@ static void wake_message( struct pipe_message *message )
     struct async *async = message->async;
 
     message->async = NULL;
+    if (!async) return;
+
     message->iosb->status = STATUS_SUCCESS;
     message->iosb->result = message->iosb->in_size;
-    if (async)
-    {
-        async_terminate( async, message->iosb->result ? STATUS_ALERTED : STATUS_SUCCESS );
-        release_object( async );
-    }
+    async_terminate( async, message->iosb->result ? STATUS_ALERTED : STATUS_SUCCESS );
+    release_object( async );
 }
 
 static void free_message( struct pipe_message *message )
@@ -768,7 +767,7 @@ static void reselect_write_queue( struct pipe_end *pipe_end )
         else
         {
             avail += message->iosb->in_size - message->read_pos;
-            if (message->iosb->status == STATUS_PENDING && (avail <= reader->buffer_size || !message->iosb->in_size))
+            if (message->async && (avail <= reader->buffer_size || !message->iosb->in_size))
                 wake_message( message );
         }
     }




More information about the wine-cvs mailing list