Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/kernel32/tests/pipe.c | 4 ++-- server/named_pipe.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 370073a8a7..65888fdca4 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -3995,7 +3995,7 @@ static void test_nowait(void) ol.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); SetLastError(0xdeadbeef); ok(ConnectNamedPipe(pipewrite, &ol) == FALSE, "ConnectNamedPipe should fail\n"); - todo_wine ok(GetLastError() == ERROR_PIPE_LISTENING, "got %d should be ERROR_PIPE_LISTENING\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_LISTENING, "got %d should be ERROR_PIPE_LISTENING\n", GetLastError()); if (GetLastError() == ERROR_IO_PENDING) CancelIo(pipewrite);
@@ -4013,7 +4013,7 @@ static void test_nowait(void) ok(DisconnectNamedPipe(pipewrite) == TRUE, "DisconnectNamedPipe should succeed\n"); SetLastError(0xdeadbeef); ok(ConnectNamedPipe(pipewrite,&ol) == FALSE, "ConnectNamedPipe should fail\n"); - todo_wine ok(GetLastError() == ERROR_PIPE_LISTENING, "got %d should be ERROR_PIPE_LISTENING\n", GetLastError()); + ok(GetLastError() == ERROR_PIPE_LISTENING, "got %d should be ERROR_PIPE_LISTENING\n", GetLastError()); if (GetLastError() == ERROR_IO_PENDING) CancelIo(pipewrite); ok(CloseHandle(ol.hEvent), "CloseHandle for the event failed\n"); diff --git a/server/named_pipe.c b/server/named_pipe.c index f3251439b2..d40810a8ce 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -1108,6 +1108,12 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as return 0; }
+ if (server->pipe_end.flags & NAMED_PIPE_NONBLOCKING_MODE) + { + set_error( STATUS_PIPE_LISTENING ); + return 0; + } + queue_async( &server->listen_q, async ); async_wake_up( &server->pipe_end.pipe->waiters, STATUS_SUCCESS ); set_error( STATUS_PENDING );