32
32
#include <process.h>
35
/* We have very carefully excluded volumes of definitions from the
36
* Microsoft Platform SDK, which kill the build time performance.
37
* These the sole constants we borrow from WinBase.h and WinUser.h
35
39
#ifndef LOGON32_LOGON_NETWORK
36
40
#define LOGON32_LOGON_NETWORK 3
83
87
in = APR_READ_BLOCK;
84
88
else if (in == APR_PARENT_BLOCK)
85
89
in = APR_WRITE_BLOCK;
86
stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, in,
91
stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in,
93
if (stat == APR_SUCCESS) {
98
apr_file_pipe_timeout_set(attr->parent_in, 0);
100
case APR_WRITE_BLOCK:
101
apr_file_pipe_timeout_set(attr->child_in, 0);
104
apr_file_pipe_timeout_set(attr->child_in, 0);
105
apr_file_pipe_timeout_set(attr->parent_in, 0);
88
108
if (stat == APR_SUCCESS)
89
109
stat = apr_file_inherit_unset(attr->parent_in);
91
111
if (out && stat == APR_SUCCESS) {
92
stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, out,
112
stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out,
114
if (stat == APR_SUCCESS) {
118
case APR_PARENT_BLOCK:
119
apr_file_pipe_timeout_set(attr->child_out, 0);
121
case APR_CHILD_BLOCK:
122
apr_file_pipe_timeout_set(attr->parent_out, 0);
125
apr_file_pipe_timeout_set(attr->child_out, 0);
126
apr_file_pipe_timeout_set(attr->parent_out, 0);
94
129
if (stat == APR_SUCCESS)
95
130
stat = apr_file_inherit_unset(attr->parent_out);
97
132
if (err && stat == APR_SUCCESS) {
98
stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, err,
133
stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err,
135
if (stat == APR_SUCCESS) {
139
case APR_PARENT_BLOCK:
140
apr_file_pipe_timeout_set(attr->child_err, 0);
142
case APR_CHILD_BLOCK:
143
apr_file_pipe_timeout_set(attr->parent_err, 0);
146
apr_file_pipe_timeout_set(attr->child_err, 0);
147
apr_file_pipe_timeout_set(attr->parent_err, 0);
100
150
if (stat == APR_SUCCESS)
101
151
stat = apr_file_inherit_unset(attr->parent_err);
776
826
si.dwFlags |= STARTF_USESTDHANDLES;
778
828
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
829
if (GetHandleInformation(si.hStdInput, &stdin_reset)
830
&& (stdin_reset &= HANDLE_FLAG_INHERIT))
831
SetHandleInformation(si.hStdInput,
832
HANDLE_FLAG_INHERIT, 0);
779
834
if (attr->child_in && attr->child_in->filehand)
781
if (GetHandleInformation(si.hStdInput,
783
&& (stdin_reset &= HANDLE_FLAG_INHERIT))
784
SetHandleInformation(si.hStdInput,
785
HANDLE_FLAG_INHERIT, 0);
787
836
si.hStdInput = attr->child_in->filehand;
788
837
SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT,
789
838
HANDLE_FLAG_INHERIT);
841
si.hStdInput = INVALID_HANDLE_VALUE;
792
843
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
844
if (GetHandleInformation(si.hStdOutput, &stdout_reset)
845
&& (stdout_reset &= HANDLE_FLAG_INHERIT))
846
SetHandleInformation(si.hStdOutput,
847
HANDLE_FLAG_INHERIT, 0);
793
849
if (attr->child_out && attr->child_out->filehand)
795
if (GetHandleInformation(si.hStdOutput,
797
&& (stdout_reset &= HANDLE_FLAG_INHERIT))
798
SetHandleInformation(si.hStdOutput,
799
HANDLE_FLAG_INHERIT, 0);
801
851
si.hStdOutput = attr->child_out->filehand;
802
852
SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT,
803
853
HANDLE_FLAG_INHERIT);
856
si.hStdOutput = INVALID_HANDLE_VALUE;
806
858
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
859
if (GetHandleInformation(si.hStdError, &stderr_reset)
860
&& (stderr_reset &= HANDLE_FLAG_INHERIT))
861
SetHandleInformation(si.hStdError,
862
HANDLE_FLAG_INHERIT, 0);
807
864
if (attr->child_err && attr->child_err->filehand)
809
if (GetHandleInformation(si.hStdError,
811
&& (stderr_reset &= HANDLE_FLAG_INHERIT))
812
SetHandleInformation(si.hStdError,
813
HANDLE_FLAG_INHERIT, 0);
815
866
si.hStdError = attr->child_err->filehand;
816
867
SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT,
817
HANDLE_FLAG_INHERIT);
868
HANDLE_FLAG_INHERIT);
871
si.hStdError = INVALID_HANDLE_VALUE;
820
873
if (attr->user_token) {
821
874
/* XXX: for terminal services, handles can't be cannot be