Subject: | Win32::Process::Create() - No file handle inheritance in a service |
Date: | Thu, 8 Nov 2007 11:50:52 GMT |
To: | bug-libwin32 [...] rt.cpan.org |
From: | Terry Glanfield <terry.glanfield [...] printsoft.com> |
The appended patch to Process/Process.hpp fixes an issue with windows
services whereby the file handles weren't being inherited into the new
process. The same program run as a console application would work as
expected.
The patch would appear to be a noop as this is standard behaviour but
is clearly doing something extra when used as part of a service.
I don't have a small test-suite to demonstrate it. The application is
using POE and PerlSvc.
ActivePerl 5.8.8 Build 822
ActiveState Perl Dev Kit 7.0.0 Build 277058 to build the service.
38d37
< st.dwFlags = 0;
42a42,49
Show quoted text
> if (Inherit) {
> st.dwFlags = STARTF_USESTDHANDLES;
> st.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
> st.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
> st.hStdError = GetStdHandle(STD_ERROR_HANDLE);
> } else {
> st.dwFlags = 0;
> }