Message24338
Some ideas of possible solutions for this bug:
1) As Roger Upole suggests, throw an readable error when GetStdHandle fails. This would not really change much, besides of subprocess being a little less confusing.
2) Automatically create PIPEs for those handles that fails. The PIPE could either be left open or closed. A WriteFile in the child would get ERROR_BROKEN_PIPE, if the parent has closed it. Not as good as ERROR_INVALID_HANDLE, but pretty close. (Or should I say pretty closed? :-)
3) Try to attach the handles to a NUL device, as 1238747 suggests.
4) Hope for the best and actually pass invalid handles in startupinfo.hStdInput, startupinfo.hStdOutput, or
startupinfo.hStdError. It would be nice if this was possible: If GetStdHandle fails in the current process, it makes sense that GetStdHandle will fail in the child as well. But, as far as I understand, it's not possible or safe to pass invalid handles in the startupinfo structure.
Currently, I'm leaning towards solution 2), with closing the parents PIPE ends. |
|
Date |
User |
Action |
Args |
2007-08-23 14:29:37 | admin | link | issue1124861 messages |
2007-08-23 14:29:37 | admin | create | |
|