http://bugs.winehq.org/show_bug.cgi?id=17195
--- Comment #5 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-31 09:19:59 --- Created an attachment (id=19124) --> (http://bugs.winehq.org/attachment.cgi?id=19124) added short read test
ok, this extra test is called shortread: ./msrpcd.exe & ./msrpc.exe -t shortread
it demonstrates that "short read" is actually very straightforward to implement. both ReadFile and PeekNamedPipe return the number of bytes requested - _if_ any are requested, and ERROR_MORE_DATA is returned if there are bytes remaining. the difference between ReadFile and PeekNamedPipe is that two extra params are tacked on the end: available and remaining. both are pointers and the sums should be:
read_this_time + remaining == available.
i need to do another test which does a short read using PeekNamedPipe followed by a ReadFile, to confirm that absolutely.