Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:11

0001 //
0002 // boost/process/v2/windows/default_launcher.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_PROCESS_V2_WINDOWS_CREATION_FLAGS_HPP
0012 #define BOOST_PROCESS_V2_WINDOWS_CREATION_FLAGS_HPP
0013 
0014 #include <boost/process/v2/windows/default_launcher.hpp>
0015 
0016 BOOST_PROCESS_V2_BEGIN_NAMESPACE
0017 namespace windows
0018 {
0019 
0020 
0021 /// An initializers to add to the dwFlags in the startup-info
0022 /**
0023  * @tparam Flags The flags to be set.
0024  */
0025 template<DWORD Flags>
0026 struct process_creation_flags
0027 {
0028   constexpr process_creation_flags () {}
0029   
0030   error_code on_setup(windows::default_launcher & launcher,
0031                       const filesystem::path &, 
0032                       const std::wstring &) const
0033   {
0034     launcher.creation_flags |= Flags;
0035     return error_code {};
0036   };
0037 };
0038 
0039 
0040 
0041 /// A flag to create a new process group. Necessary to allow interrupts for the subprocess.
0042 constexpr static process_creation_flags<CREATE_NEW_PROCESS_GROUP> create_new_process_group;
0043 
0044 constexpr static process_creation_flags<CREATE_BREAKAWAY_FROM_JOB> create_breakaway_from_job;
0045 constexpr static process_creation_flags<CREATE_NEW_CONSOLE>        create_new_console;
0046 
0047 }
0048 BOOST_PROCESS_V2_END_NAMESPACE
0049 
0050 #endif //  BOOST_PROCESS_V2_WINDOWS_CREATION_FLAGS_HPP