File indexing completed on 2025-01-18 09:50:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_NULL_IN_HPP
0011 #define BOOST_PROCESS_WINDOWS_INITIALIZERS_NULL_IN_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/detail/handler_base.hpp>
0017 #include <boost/process/detail/used_handles.hpp>
0018 #include <boost/process/detail/windows/file_descriptor.hpp>
0019
0020 namespace boost { namespace process { namespace detail { namespace windows {
0021
0022 struct null_in : public ::boost::process::detail::handler_base, ::boost::process::detail::uses_handles
0023 {
0024 file_descriptor source{"NUL", file_descriptor::read};
0025
0026 ::boost::winapi::HANDLE_ get_used_handles() const { return source.handle(); }
0027
0028
0029 public:
0030 template <class WindowsExecutor>
0031 void on_setup(WindowsExecutor &e) const
0032 {
0033 boost::winapi::SetHandleInformation(source.handle(),
0034 boost::winapi::HANDLE_FLAG_INHERIT_,
0035 boost::winapi::HANDLE_FLAG_INHERIT_);
0036
0037 e.startup_info.hStdInput = source.handle();
0038 e.startup_info.dwFlags |= boost::winapi::STARTF_USESTDHANDLES_;
0039 e.inherit_handles = true;
0040 }
0041 };
0042
0043 }}}}
0044
0045 #endif