And I have a suggestion that the subroutine "pclose2" is prone to confuse.

Such as in winhttp.c, if the parent does not close pOut in time, the child will block on reading the pipe until his parent close the pOut.