http://bugs.winehq.org/show_bug.cgi?id=58745
--- Comment #7 from Eric Pouech eric.pouech@gmail.com ---
Somebody is suggesting to DuplicateHandle() and set the PIPE_NOWAIT mode before trying a zero ReadFile().
quickly tested (on Wine & windows) for (anonymous) pipes, and as I feared, PIPE_NOWAIT is an attribute of the pipe kernel object not of the handle... so changing wait mode on the dup:ed handle also changes it on original handle (but ReadFile on either handles wouldn't block)
(there are ways to get read & write attributes out of a handle, but they only exist in ntdll and are not exposed to kernel32 nor kernelbase; so not sure that's suitable for this context)