Hi to all.
I'm working on code which needs sometimes to call some helper 3rd
party command line tools so I need to redirect child's std. input/
output streams.
I found this demo code on MSDN:
http://msdn2.microsoft.com/en-us/library/ms682499.aspx
I extended it so the parent process can post some data to stdin of the
the child process as well. However I have still problems with that:
-- How the parent process can check if there is something in the pipe
buffer to read of if there is enough room to write (in case of child's
stdin)?
-- How to keep order of childs request on stdout/stderr/stdin?
-- How to prevent parent to block in ReadFile() if there is just few
bytes? Of course I don't want to read byte by byte..
In other words, I would need something similar to select() or poll()
syscall on Unix, which waits until any file descriptor in set is ready
to read and/or write.
Unfortunately I could not find any reasonable solution on MSDN nor
Google...