Get number of bytes available in PeekNamedPipe (take 2)
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Thu Jul 25 02:51:18 CDT 2002
>>>>> "Alexandre" == Alexandre Julliard <julliard at winehq.com> writes:
Alexandre> Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de> writes:
>> As I don't have a test target, I don't feel yet like filling
>> lpvBuffer and I don't yet have an idea how to do that. I looked at
>> the kernel sources and lseek unconditionally returns error on
>> pipe. So how can we read the pipe and get the filepointer back to the
>> original position afterwards?
Alexandre> You can't use lseek, you have to make the pipe a socket pair
Alexandre> and use recv(MSG_PEEK).
>> wine/server/protocol.def Define a FD_TYPE_PIPE wine/server/file.c:
>> get_handle_fd On type FD_TYPE_PIPE check other end of type
Alexandre> If this is really necessary it should be done on the client
Alexandre> side. I'm not sure I see the point though.
PeekNamedPipe must report when the pipe is broken, otherwise some programs
wait forever for a message from the already disappeared program. Without
checking for a broken other end, FIONREAD always reports "0 bytes". I don't
see how I can doi that on the client side, beside exporting the
pipe(_user)_get_fd functions directly. Programming hints are welcome.
Bye
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
More information about the wine-devel
mailing list