[patch] rpcrt4_conn_np_read needs to expect and accept ERROR_MORE_DATA

Luke Kenneth Casson Leighton luke.leighton at googlemail.com
Fri Feb 6 09:30:18 CST 2009


On Fri, Feb 6, 2009 at 12:35 PM, Juan Lang <juan.lang at gmail.com> wrote:
> Hi Luke,
>
> @@ -382,7 +382,14 @@ static int rpcrt4_conn_np_read(RpcConnection *Connection,

> Style nit:  it would be simpler to do:
>     DWORD bytes_read;
>     ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, NULL);
> +    if (!ret && GetLastError() == ERROR_MORE_DATA)
> +        ret = TRUE;
>     if (!ret || !bytes_read)
>         break;
>
> Don't you think?

... oh yeah :)  well, i wanted to know what was going on, so i added
the TRACE.  rob, this is clearly much better.

 oh - the nice thing that you should find is that given that the
current wine NtReadFile() implementation never returns
ERROR_MORE_DATA, is that all checks that you add to treat
ERROR_MORE_DATA as "not actually an error but actually to be expected"
should have _zero_ impact.  until NamedPipes messagemode gets fixed,
of course.

l.



More information about the wine-devel mailing list