Lines 769-783
Link Here
|
769 |
*/ |
769 |
*/ |
770 |
EnterCriticalSection(&proc_lock); |
770 |
EnterCriticalSection(&proc_lock); |
771 |
|
771 |
|
|
|
772 |
si.hStdInput = si.hStdOutput = si.hStdError = INVALID_HANDLE_VALUE; |
773 |
|
772 |
if ((attr->child_in && attr->child_in->filehand) |
774 |
if ((attr->child_in && attr->child_in->filehand) |
773 |
|| (attr->child_out && attr->child_out->filehand) |
775 |
|| (attr->child_out && attr->child_out->filehand) |
774 |
|| (attr->child_err && attr->child_err->filehand)) |
776 |
|| (attr->child_err && attr->child_err->filehand)) |
775 |
{ |
777 |
{ |
776 |
si.dwFlags |= STARTF_USESTDHANDLES; |
778 |
si.dwFlags |= STARTF_USESTDHANDLES; |
777 |
|
779 |
|
778 |
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); |
|
|
779 |
if (attr->child_in && attr->child_in->filehand) |
780 |
if (attr->child_in && attr->child_in->filehand) |
780 |
{ |
781 |
{ |
|
|
782 |
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); |
781 |
if (GetHandleInformation(si.hStdInput, |
783 |
if (GetHandleInformation(si.hStdInput, |
782 |
&stdin_reset) |
784 |
&stdin_reset) |
783 |
&& (stdin_reset &= HANDLE_FLAG_INHERIT)) |
785 |
&& (stdin_reset &= HANDLE_FLAG_INHERIT)) |
Lines 789-797
Link Here
|
789 |
HANDLE_FLAG_INHERIT); |
791 |
HANDLE_FLAG_INHERIT); |
790 |
} |
792 |
} |
791 |
|
793 |
|
792 |
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); |
|
|
793 |
if (attr->child_out && attr->child_out->filehand) |
794 |
if (attr->child_out && attr->child_out->filehand) |
794 |
{ |
795 |
{ |
|
|
796 |
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); |
795 |
if (GetHandleInformation(si.hStdOutput, |
797 |
if (GetHandleInformation(si.hStdOutput, |
796 |
&stdout_reset) |
798 |
&stdout_reset) |
797 |
&& (stdout_reset &= HANDLE_FLAG_INHERIT)) |
799 |
&& (stdout_reset &= HANDLE_FLAG_INHERIT)) |
Lines 803-811
Link Here
|
803 |
HANDLE_FLAG_INHERIT); |
805 |
HANDLE_FLAG_INHERIT); |
804 |
} |
806 |
} |
805 |
|
807 |
|
806 |
si.hStdError = GetStdHandle(STD_ERROR_HANDLE); |
|
|
807 |
if (attr->child_err && attr->child_err->filehand) |
808 |
if (attr->child_err && attr->child_err->filehand) |
808 |
{ |
809 |
{ |
|
|
810 |
si.hStdError = GetStdHandle(STD_ERROR_HANDLE); |
809 |
if (GetHandleInformation(si.hStdError, |
811 |
if (GetHandleInformation(si.hStdError, |
810 |
&stderr_reset) |
812 |
&stderr_reset) |
811 |
&& (stderr_reset &= HANDLE_FLAG_INHERIT)) |
813 |
&& (stderr_reset &= HANDLE_FLAG_INHERIT)) |