server: Improve FSCTL_PIPE_TRANSCEIVE error handling.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-08-08 22:01:02 +02:00 committed by Alexandre Julliard
parent 7038b9ef15
commit 41e39c6a63
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -937,6 +937,12 @@ static int pipe_end_transceive( struct pipe_end *pipe_end, struct async *async )
struct pipe_message *message;
struct iosb *iosb;
if (!pipe_end->connection)
{
set_error( STATUS_INVALID_PIPE_STATE );
return 0;
}
if ((pipe_end->flags & (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
!= (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
{
@ -944,12 +950,6 @@ static int pipe_end_transceive( struct pipe_end *pipe_end, struct async *async )
return 0;
}
if (!pipe_end->connection)
{
set_error( STATUS_PIPE_BROKEN );
return 0;
}
/* not allowed if we already have read data buffered */
if (!list_empty( &pipe_end->message_queue ))
{