Jinoh Kang (@iamahuman) commented about server/named_pipe.c:
pipe_info->ReadDataAvailable = pipe_end_get_avail( pipe_end ); pipe_info->OutboundQuota = pipe->outsize;
pipe_info->WriteQuotaAvailable = 0; /* FIXME */ pipe_info->NamedPipeState = pipe_end->state; pipe_info->NamedPipeEnd = pipe_end->obj.ops == &pipe_server_ops ? FILE_PIPE_SERVER_END : FILE_PIPE_CLIENT_END;
pipe_info->WriteQuotaAvailable = pipe_info->NamedPipeEnd == FILE_PIPE_CLIENT_END
? pipe_info->InboundQuota : pipe_info->OutboundQuota;
Since you're removing the FIXME, you need to account for the number of outstanding (written but unread) bytes from the available write quota to be correct.
For example, if the pipe is full (no space left), this should be 0. To implement this, you could subtract `pipe_end_get_avail( pipe_end->connection )` from the quota so it reflects the remaining available space. You should also check how native handles disconnected pipes (`pipe_end->connection == NULL`).
Also, tests would be nice: it seems like the "outstanding message not read by the other end" case is missing from the tests.
If cumbersome, you can ignore what I said; just keep the FIXME and remove the `proper` wording from the commit message.