Commit c488f291 authored by Bernhard Übelacker's avatar Bernhard Übelacker Committed by Alexandre Julliard

server: Return ReadDataAvailable value for FilePipeLocalInformation.

Makes Cygwin mintty.exe or script.exe show output, if the stack issues got worked around. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47808Signed-off-by: 's avatarBernhard Übelacker <bernhardu@mailbox.org> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 4be47ac4
......@@ -1888,8 +1888,16 @@ static void test_pipe_with_data_state(HANDLE pipe, BOOL is_server, DWORD state)
"NtQueryInformationFile(FilePipeLocalInformation) failed in %s state %u: %x\n",
is_server ? "server" : "client", state, status);
if (!status)
{
ok(local_info.NamedPipeState == state, "%s NamedPipeState = %u, expected %u\n",
is_server ? "server" : "client", local_info.NamedPipeState, state);
if (state != FILE_PIPE_DISCONNECTED_STATE && state != FILE_PIPE_LISTENING_STATE)
ok(local_info.ReadDataAvailable != 0, "ReadDataAvailable, expected non-zero, in %s state %u\n",
is_server ? "server" : "client", state);
else
ok(local_info.ReadDataAvailable == 0, "ReadDataAvailable, expected zero, in %s state %u\n",
is_server ? "server" : "client", state);
}
status = pNtQueryInformationFile(pipe, &io, &pipe_info, sizeof(pipe_info), FilePipeInformation);
if (!is_server && state == FILE_PIPE_DISCONNECTED_STATE)
......
......@@ -670,6 +670,8 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
case FilePipeLocalInformation:
{
FILE_PIPE_LOCAL_INFORMATION *pipe_info;
struct pipe_message *message;
data_size_t avail = 0;
if (!(get_handle_access( current->process, handle) & FILE_READ_ATTRIBUTES))
{
......@@ -706,7 +708,11 @@ static void pipe_end_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
pipe_info->MaximumInstances = pipe->maxinstances;
pipe_info->CurrentInstances = pipe->instances;
pipe_info->InboundQuota = pipe->insize;
pipe_info->ReadDataAvailable = 0; /* FIXME */
LIST_FOR_EACH_ENTRY( message, &pipe_end->message_queue, struct pipe_message, entry )
avail += message->iosb->in_size - message->read_pos;
pipe_info->ReadDataAvailable = avail;
pipe_info->OutboundQuota = pipe->outsize;
pipe_info->WriteQuotaAvailable = 0; /* FIXME */
pipe_info->NamedPipeState = pipe_end->state;
......
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