Warning, file /include/boost/process/v1/detail/windows/null_out.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_NULL_OUT_HPP
0011 #define BOOST_PROCESS_WINDOWS_INITIALIZERS_NULL_OUT_HPP
0012
0013 #include <boost/winapi/process.hpp>
0014 #include <boost/winapi/handles.hpp>
0015 #include <boost/winapi/handle_info.hpp>
0016 #include <boost/process/v1/detail/handler_base.hpp>
0017 #include <boost/process/v1/detail/used_handles.hpp>
0018 #include <boost/process/v1/detail/windows/file_descriptor.hpp>
0019
0020 namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
0021
0022 template<int p1, int p2>
0023 struct null_out : public ::boost::process::v1::detail::handler_base, ::boost::process::v1::detail::uses_handles
0024 {
0025 file_descriptor sink {"NUL", file_descriptor::write};
0026
0027 ::boost::winapi::HANDLE_ get_used_handles() const { return sink.handle(); }
0028
0029 template <typename WindowsExecutor>
0030 void on_setup(WindowsExecutor &e) const;
0031 };
0032
0033 template<>
0034 template<typename WindowsExecutor>
0035 void null_out<1,-1>::on_setup(WindowsExecutor &e) const
0036 {
0037 boost::winapi::SetHandleInformation(sink.handle(),
0038 boost::winapi::HANDLE_FLAG_INHERIT_,
0039 boost::winapi::HANDLE_FLAG_INHERIT_);
0040
0041 e.startup_info.hStdOutput = sink.handle();
0042 e.startup_info.dwFlags |= ::boost::winapi::STARTF_USESTDHANDLES_;
0043 e.inherit_handles = true;
0044
0045 }
0046
0047 template<>
0048 template<typename WindowsExecutor>
0049 void null_out<2,-1>::on_setup(WindowsExecutor &e) const
0050 {
0051 boost::winapi::SetHandleInformation(sink.handle(),
0052 boost::winapi::HANDLE_FLAG_INHERIT_,
0053 boost::winapi::HANDLE_FLAG_INHERIT_);
0054
0055 e.startup_info.hStdError = sink.handle();
0056 e.startup_info.dwFlags |= ::boost::winapi::STARTF_USESTDHANDLES_;
0057 e.inherit_handles = true;
0058
0059 }
0060
0061 template<>
0062 template<typename WindowsExecutor>
0063 void null_out<1,2>::on_setup(WindowsExecutor &e) const
0064 {
0065 boost::winapi::SetHandleInformation(sink.handle(),
0066 boost::winapi::HANDLE_FLAG_INHERIT_,
0067 boost::winapi::HANDLE_FLAG_INHERIT_);
0068
0069 e.startup_info.hStdOutput = sink.handle();
0070 e.startup_info.hStdError = sink.handle();
0071 e.startup_info.dwFlags |= ::boost::winapi::STARTF_USESTDHANDLES_;
0072 e.inherit_handles = true;
0073
0074 }
0075
0076 }}}}}
0077
0078 #endif