Commit 41374ef1 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

server: Don't block ConnectNamedPipe for pipe in PIPE_NOWAIT mode.

parent 91c4e9bf
...@@ -4026,7 +4026,7 @@ static void test_nowait(void) ...@@ -4026,7 +4026,7 @@ static void test_nowait(void)
ol.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); ol.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ok(ConnectNamedPipe(pipewrite, &ol) == FALSE, "ConnectNamedPipe should fail\n"); 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) if (GetLastError() == ERROR_IO_PENDING)
CancelIo(pipewrite); CancelIo(pipewrite);
...@@ -4044,7 +4044,7 @@ static void test_nowait(void) ...@@ -4044,7 +4044,7 @@ static void test_nowait(void)
ok(DisconnectNamedPipe(pipewrite) == TRUE, "DisconnectNamedPipe should succeed\n"); ok(DisconnectNamedPipe(pipewrite) == TRUE, "DisconnectNamedPipe should succeed\n");
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ok(ConnectNamedPipe(pipewrite,&ol) == FALSE, "ConnectNamedPipe should fail\n"); 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) if (GetLastError() == ERROR_IO_PENDING)
CancelIo(pipewrite); CancelIo(pipewrite);
ok(CloseHandle(ol.hEvent), "CloseHandle for the event failed\n"); ok(CloseHandle(ol.hEvent), "CloseHandle for the event failed\n");
......
...@@ -1106,6 +1106,11 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as ...@@ -1106,6 +1106,11 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
return 0; return 0;
} }
if (server->pipe_end.flags & NAMED_PIPE_NONBLOCKING_MODE)
{
set_error( STATUS_PIPE_LISTENING );
return 0;
}
queue_async( &server->listen_q, async ); queue_async( &server->listen_q, async );
async_wake_up( &server->pipe_end.pipe->waiters, STATUS_SUCCESS ); async_wake_up( &server->pipe_end.pipe->waiters, STATUS_SUCCESS );
set_error( STATUS_PENDING ); set_error( STATUS_PENDING );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment