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:
parent
7038b9ef15
commit
41e39c6a63
|
@ -1301,7 +1301,7 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
|
||||||
buf, 1, buf+1, 1);
|
buf, 1, buf+1, 1);
|
||||||
if (!status || status == STATUS_PENDING)
|
if (!status || status == STATUS_PENDING)
|
||||||
status = io.Status;
|
status = io.Status;
|
||||||
todo_wine
|
todo_wine_if(expected_status == STATUS_PIPE_DISCONNECTED)
|
||||||
ok(status == expected_status,
|
ok(status == expected_status,
|
||||||
"NtFsControlFile(FSCTL_PIPE_TRANSCEIVE) failed in %s state %u: %x\n",
|
"NtFsControlFile(FSCTL_PIPE_TRANSCEIVE) failed in %s state %u: %x\n",
|
||||||
is_server ? "server" : "client", state, status);
|
is_server ? "server" : "client", state, status);
|
||||||
|
|
|
@ -937,6 +937,12 @@ static int pipe_end_transceive( struct pipe_end *pipe_end, struct async *async )
|
||||||
struct pipe_message *message;
|
struct pipe_message *message;
|
||||||
struct iosb *iosb;
|
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))
|
if ((pipe_end->flags & (NAMED_PIPE_MESSAGE_STREAM_WRITE | NAMED_PIPE_MESSAGE_STREAM_READ))
|
||||||
!= (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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pipe_end->connection)
|
|
||||||
{
|
|
||||||
set_error( STATUS_PIPE_BROKEN );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* not allowed if we already have read data buffered */
|
/* not allowed if we already have read data buffered */
|
||||||
if (!list_empty( &pipe_end->message_queue ))
|
if (!list_empty( &pipe_end->message_queue ))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue