Jacek Caban : server: Improve FSCTL_PIPE_TRANSCEIVE error handling.

Alexandre Julliard julliard at winehq.org
Wed Aug 15 14:39:54 CDT 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Aug  8 22:01:02 2018 +0200

server: Improve FSCTL_PIPE_TRANSCEIVE error handling.

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

---

 dlls/ntdll/tests/pipe.c |  2 +-
 server/named_pipe.c     | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c
index d8ccdd1..b312831 100644
--- a/dlls/ntdll/tests/pipe.c
+++ b/dlls/ntdll/tests/pipe.c
@@ -1301,7 +1301,7 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
                                  buf, 1, buf+1, 1);
         if (!status || status == STATUS_PENDING)
             status = io.Status;
-        todo_wine
+        todo_wine_if(expected_status == STATUS_PIPE_DISCONNECTED)
         ok(status == expected_status,
             "NtFsControlFile(FSCTL_PIPE_TRANSCEIVE) failed in %s state %u: %x\n",
             is_server ? "server" : "client", state, status);
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 0806d99..f7b8b54 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -937,16 +937,16 @@ static int pipe_end_transceive( struct pipe_end *pipe_end, struct async *async )
     struct pipe_message *message;
     struct iosb *iosb;
 
-    if ((pipe_end->flags & (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
-        != (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
+    if (!pipe_end->connection)
     {
-        set_error( STATUS_INVALID_READ_MODE );
+        set_error( STATUS_INVALID_PIPE_STATE );
         return 0;
     }
 
-    if (!pipe_end->connection)
+    if ((pipe_end->flags & (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
+        != (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
     {
-        set_error( STATUS_PIPE_BROKEN );
+        set_error( STATUS_INVALID_READ_MODE );
         return 0;
     }
 




More information about the wine-cvs mailing list