mirror of
https://github.com/boostorg/process.git
synced 2026-01-19 16:32:15 +00:00
made v2 the default
This commit is contained in:
committed by
Klemens Morgenstern
parent
7874a04958
commit
2ccd97cd48
@@ -12,23 +12,18 @@
|
||||
#ifndef BOOST_PROCESS_HPP
|
||||
#define BOOST_PROCESS_HPP
|
||||
|
||||
/**
|
||||
* \file boost/process.hpp
|
||||
*
|
||||
* Convenience header which includes all public and platform-independent
|
||||
* boost.process header files.
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_PROCESS_VERSION)
|
||||
#define BOOST_PROCESS_VERSION 1
|
||||
#endif
|
||||
|
||||
#if BOOST_PROCESS_VERSION == 1
|
||||
#include <boost/process/v1.hpp>
|
||||
#elif BOOST_PROCESS_VERSION == 2
|
||||
#include <boost/process/v2.hpp>
|
||||
#else
|
||||
#error "Unknown boost process version"
|
||||
#endif
|
||||
#include <boost/process/bind_launcher.hpp>
|
||||
#include <boost/process/default_launcher.hpp>
|
||||
#include <boost/process/environment.hpp>
|
||||
#include <boost/process/error.hpp>
|
||||
#include <boost/process/execute.hpp>
|
||||
#include <boost/process/exit_code.hpp>
|
||||
#include <boost/process/ext.hpp>
|
||||
#include <boost/process/pid.hpp>
|
||||
#include <boost/process/popen.hpp>
|
||||
#include <boost/process/process.hpp>
|
||||
#include <boost/process/shell.hpp>
|
||||
#include <boost/process/start_dir.hpp>
|
||||
#include <boost/process/stdio.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/args.hpp>")
|
||||
#include <boost/process/v1/args.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/async.hpp>")
|
||||
#include <boost/process/v1/async.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/async_pipe.hpp>")
|
||||
#include <boost/process/v1/async_pipe.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/async_system.hpp>")
|
||||
#include <boost/process/v1/async_system.hpp>
|
||||
1
include/boost/process/bind_launcher.hpp
Normal file
1
include/boost/process/bind_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/bind_launcher.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/child.hpp>")
|
||||
#include <boost/process/v1/child.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/cmd.hpp>")
|
||||
#include <boost/process/v1/cmd.hpp>
|
||||
1
include/boost/process/cstring_ref.hpp
Normal file
1
include/boost/process/cstring_ref.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/cstring_ref.hpp>
|
||||
1
include/boost/process/default_launcher.hpp
Normal file
1
include/boost/process/default_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/default_launcher.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/env.hpp>")
|
||||
#include <boost/process/v1/env.hpp>
|
||||
@@ -1,9 +1 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/environment.hpp>")
|
||||
#include <boost/process/v1/environment.hpp>
|
||||
#include <boost/process/v2/environment.hpp>
|
||||
|
||||
@@ -1,9 +1 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/error.hpp>")
|
||||
#include <boost/process/v1/error.hpp>
|
||||
#include <boost/process/v2/error.hpp>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/exception.hpp>")
|
||||
#include <boost/process/v1/exception.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/exe.hpp>")
|
||||
#include <boost/process/v1/exe.hpp>
|
||||
1
include/boost/process/execute.hpp
Normal file
1
include/boost/process/execute.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/execute.hpp>
|
||||
1
include/boost/process/exit_code.hpp
Normal file
1
include/boost/process/exit_code.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/exit_code.hpp>
|
||||
1
include/boost/process/ext.hpp
Normal file
1
include/boost/process/ext.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/ext.hpp>
|
||||
1
include/boost/process/ext/cmd.hpp
Normal file
1
include/boost/process/ext/cmd.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/ext/cmd.hpp>
|
||||
1
include/boost/process/ext/cwd.hpp
Normal file
1
include/boost/process/ext/cwd.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/ext/cwd.hpp>
|
||||
1
include/boost/process/ext/env.hpp
Normal file
1
include/boost/process/ext/env.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/ext/env.hpp>
|
||||
1
include/boost/process/ext/exe.hpp
Normal file
1
include/boost/process/ext/exe.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/ext/exe.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/extend.hpp>")
|
||||
#include <boost/process/v1/extend.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/filesystem.hpp>")
|
||||
#include <boost/process/v1/filesystem.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/group.hpp>")
|
||||
#include <boost/process/v1/group.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/handles.hpp>")
|
||||
#include <boost/process/v1/handles.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/io.hpp>")
|
||||
#include <boost/process/v1/io.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/locale.hpp>")
|
||||
#include <boost/process/v1/locale.hpp>
|
||||
1
include/boost/process/pid.hpp
Normal file
1
include/boost/process/pid.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/pid.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/pipe.hpp>")
|
||||
#include <boost/process/v1/pipe.hpp>
|
||||
1
include/boost/process/popen.hpp
Normal file
1
include/boost/process/popen.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/popen.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/posix.hpp>")
|
||||
#include <boost/process/v1/posix.hpp>
|
||||
1
include/boost/process/posix/bind_fd.hpp
Normal file
1
include/boost/process/posix/bind_fd.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/bind_fd.hpp>
|
||||
1
include/boost/process/posix/default_launcher.hpp
Normal file
1
include/boost/process/posix/default_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/default_launcher.hpp>
|
||||
1
include/boost/process/posix/fork_and_forget_launcher.hpp
Normal file
1
include/boost/process/posix/fork_and_forget_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/fork_and_forget_launcher.hpp>
|
||||
1
include/boost/process/posix/pdfork_launcher.hpp
Normal file
1
include/boost/process/posix/pdfork_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/pdfork_launcher.hpp>
|
||||
1
include/boost/process/posix/vfork_launcher.hpp
Normal file
1
include/boost/process/posix/vfork_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/vfork_launcher.hpp>
|
||||
1
include/boost/process/process.hpp
Normal file
1
include/boost/process/process.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/process.hpp>
|
||||
1
include/boost/process/process_handle.hpp
Normal file
1
include/boost/process/process_handle.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/process_handle.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/search_path.hpp>")
|
||||
#include <boost/process/v1/search_path.hpp>
|
||||
@@ -1,9 +1 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/shell.hpp>")
|
||||
#include <boost/process/v1/shell.hpp>
|
||||
#include <boost/process/v2/shell.hpp>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/spawn.hpp>")
|
||||
#include <boost/process/v1/spawn.hpp>
|
||||
@@ -1,9 +1 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/start_dir.hpp>")
|
||||
#include <boost/process/v1/start_dir.hpp>
|
||||
#include <boost/process/v2/start_dir.hpp>
|
||||
|
||||
1
include/boost/process/stdio.hpp
Normal file
1
include/boost/process/stdio.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/stdio.hpp>
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/system.hpp>")
|
||||
#include <boost/process/v1/system.hpp>
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_PROCESS_V1_HPP
|
||||
#define BOOST_PROCESS_V1_HPP
|
||||
|
||||
#include <boost/process/v1/args.hpp>
|
||||
#include <boost/process/v1/async.hpp>
|
||||
#include <boost/process/v1/async_system.hpp>
|
||||
#include <boost/process/v1/group.hpp>
|
||||
#include <boost/process/v1/child.hpp>
|
||||
#include <boost/process/v1/cmd.hpp>
|
||||
#include <boost/process/v1/env.hpp>
|
||||
#include <boost/process/v1/environment.hpp>
|
||||
#include <boost/process/v1/error.hpp>
|
||||
#include <boost/process/v1/exe.hpp>
|
||||
#include <boost/process/v1/group.hpp>
|
||||
#include <boost/process/v1/handles.hpp>
|
||||
#include <boost/process/v1/io.hpp>
|
||||
#include <boost/process/v1/pipe.hpp>
|
||||
#include <boost/process/v1/shell.hpp>
|
||||
#include <boost/process/v1/search_path.hpp>
|
||||
#include <boost/process/v1/spawn.hpp>
|
||||
#include <boost/process/v1/system.hpp>
|
||||
#include <boost/process/v1/start_dir.hpp>
|
||||
|
||||
#endif //BOOST_PROCESS_V1_HPP
|
||||
@@ -1,19 +0,0 @@
|
||||
// Copyright (c) 2022 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_PROCESS_V2_HPP
|
||||
#define BOOST_PROCESS_V2_HPP
|
||||
|
||||
#include <boost/process/v2/error.hpp>
|
||||
#include <boost/process/v2/environment.hpp>
|
||||
#include <boost/process/v2/execute.hpp>
|
||||
#include <boost/process/v2/exit_code.hpp>
|
||||
#include <boost/process/v2/pid.hpp>
|
||||
#include <boost/process/v2/popen.hpp>
|
||||
#include <boost/process/v2/process_handle.hpp>
|
||||
#include <boost/process/v2/process.hpp>
|
||||
#include <boost/process/v2/start_dir.hpp>
|
||||
#include <boost/process/v2/stdio.hpp>
|
||||
|
||||
#endif //BOOST_PROCESS_V2_HPP
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright (c) 2024 Klemens D. Morgenstern
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("<boost/process/v1/windows.hpp>")
|
||||
#include <boost/process/v1/windows.hpp>
|
||||
1
include/boost/process/windows/as_user_launcher.hpp
Normal file
1
include/boost/process/windows/as_user_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/windows/as_user_launcher.hpp>
|
||||
1
include/boost/process/windows/creation_flags.hpp
Normal file
1
include/boost/process/windows/creation_flags.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/windows/creation_flags.hpp>
|
||||
1
include/boost/process/windows/default_launcher.hpp
Normal file
1
include/boost/process/windows/default_launcher.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#include <boost/process/v2/windows/default_launcher.hpp>
|
||||
53
include/boost/process/windows/show_window.hpp
Normal file
53
include/boost/process/windows/show_window.hpp
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// boost/process/v2/windows/default_launcher.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BOOST_PROCESS_V2_WINDOWS_SHOW_WINDOW_HPP
|
||||
#define BOOST_PROCESS_V2_WINDOWS_SHOW_WINDOW_HPP
|
||||
|
||||
#include <boost/process/v2/windows/default_launcher.hpp>
|
||||
|
||||
BOOST_PROCESS_V2_BEGIN_NAMESPACE
|
||||
namespace windows
|
||||
{
|
||||
|
||||
/// A templated initializer to add wShowWindow flags.
|
||||
template<DWORD Flags>
|
||||
struct process_show_window
|
||||
{
|
||||
constexpr process_show_window() {}
|
||||
|
||||
error_code on_setup(windows::default_launcher & launcher,
|
||||
const filesystem::path &,
|
||||
const std::wstring &) const
|
||||
{
|
||||
launcher.startup_info.StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
|
||||
launcher.startup_info.StartupInfo.wShowWindow |= Flags;
|
||||
|
||||
return error_code {};
|
||||
};
|
||||
};
|
||||
|
||||
///Hides the window and activates another window.
|
||||
constexpr static process_show_window<SW_HIDE > show_window_hide;
|
||||
///Activates the window and displays it as a maximized window.
|
||||
constexpr static process_show_window<SW_SHOWMAXIMIZED > show_window_maximized;
|
||||
///Activates the window and displays it as a minimized window.
|
||||
constexpr static process_show_window<SW_SHOWMINIMIZED > show_window_minimized;
|
||||
///Displays the window as a minimized window. This value is similar to `minimized`, except the window is not activated.
|
||||
constexpr static process_show_window<SW_SHOWMINNOACTIVE> show_window_minimized_not_active;
|
||||
///Displays a window in its most recent size and position. This value is similar to show_normal`, except that the window is not activated.
|
||||
constexpr static process_show_window<SW_SHOWNOACTIVATE > show_window_not_active;
|
||||
///Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
|
||||
constexpr static process_show_window<SW_SHOWNORMAL > show_window_normal;
|
||||
|
||||
}
|
||||
BOOST_PROCESS_V2_END_NAMESPACE
|
||||
|
||||
#endif // BOOST_PROCESS_V2_WINDOWS_SHOW_WINDOW_HPP
|
||||
140
include/boost/process/windows/with_logon_launcher.hpp
Normal file
140
include/boost/process/windows/with_logon_launcher.hpp
Normal file
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// boost/process/v2/windows/default_launcher.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BOOST_PROCESS_V2_WINDOWS_WITH_LOGON_LAUNCHER_HPP
|
||||
#define BOOST_PROCESS_V2_WINDOWS_WITH_LOGON_LAUNCHER_HPP
|
||||
|
||||
#include <boost/process/v2/windows/default_launcher.hpp>
|
||||
|
||||
BOOST_PROCESS_V2_BEGIN_NAMESPACE
|
||||
namespace windows
|
||||
{
|
||||
|
||||
/// A windows launcher using CreateProcessWithLogon instead of CreateProcess
|
||||
struct with_logon_launcher : default_launcher
|
||||
{
|
||||
std::wstring username, password, domain;
|
||||
DWORD logon_flags{0u};
|
||||
|
||||
with_logon_launcher(std::wstring username = L"",
|
||||
std::wstring password = L"",
|
||||
std::wstring domain = L"",
|
||||
DWORD logon_flags = 0u) :
|
||||
username(std::move(username)),
|
||||
password(std::move(password)),
|
||||
domain(std::move(domain)),
|
||||
logon_flags(logon_flags)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template<typename ExecutionContext, typename Args, typename ... Inits>
|
||||
auto operator()(ExecutionContext & context,
|
||||
error_code & ec,
|
||||
const typename std::enable_if<std::is_convertible<
|
||||
ExecutionContext&, net::execution_context&>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<typename ExecutionContext::executor_type>
|
||||
{
|
||||
return (*this)(context.get_executor(), ec, executable, std::forward<Args>(args), std::forward<Inits>(inits)...);
|
||||
}
|
||||
|
||||
|
||||
template<typename ExecutionContext, typename Args, typename ... Inits>
|
||||
auto operator()(ExecutionContext & context,
|
||||
const typename std::enable_if<std::is_convertible<
|
||||
ExecutionContext&, net::execution_context&>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<typename ExecutionContext::executor_type>
|
||||
{
|
||||
return (*this)(context.get_executor(), executable, std::forward<Args>(args), std::forward<Inits>(inits)...);
|
||||
}
|
||||
|
||||
template<typename Executor, typename Args, typename ... Inits>
|
||||
auto operator()(Executor exec,
|
||||
const typename std::enable_if<
|
||||
net::execution::is_executor<Executor>::value ||
|
||||
net::is_executor<Executor>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<Executor>
|
||||
{
|
||||
error_code ec;
|
||||
auto proc = (*this)(std::move(exec), ec, executable, std::forward<Args>(args), std::forward<Inits>(inits)...);
|
||||
|
||||
if (ec)
|
||||
v2::detail::throw_error(ec, "with_logon_launcher");
|
||||
|
||||
return proc;
|
||||
}
|
||||
|
||||
template<typename Executor, typename Args, typename ... Inits>
|
||||
auto operator()(Executor exec,
|
||||
error_code & ec,
|
||||
const typename std::enable_if<
|
||||
net::execution::is_executor<Executor>::value ||
|
||||
net::is_executor<Executor>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<Executor>
|
||||
{
|
||||
auto command_line = this->build_command_line(executable, args);
|
||||
|
||||
ec = detail::on_setup(*this, executable, command_line, inits...);
|
||||
if (ec)
|
||||
{
|
||||
detail::on_error(*this, executable, command_line, ec, inits...);
|
||||
return basic_process<Executor>(exec);
|
||||
}
|
||||
auto ok = ::CreateProcessWithLogonW(
|
||||
username.c_str(),
|
||||
domain.empty() ? nullptr : domain.c_str(),
|
||||
password.c_str(),
|
||||
logon_flags,
|
||||
executable.empty() ? nullptr : executable.c_str(),
|
||||
command_line.empty() ? nullptr : &command_line.front(),
|
||||
creation_flags,
|
||||
environment,
|
||||
current_directory.empty() ? nullptr : current_directory.c_str(),
|
||||
&startup_info.StartupInfo,
|
||||
&process_information);
|
||||
|
||||
|
||||
if (ok == 0)
|
||||
{
|
||||
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec);
|
||||
detail::on_error(*this, executable, command_line, ec, inits...);
|
||||
|
||||
if (process_information.hProcess != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(process_information.hProcess);
|
||||
if (process_information.hThread != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(process_information.hThread);
|
||||
|
||||
return basic_process<Executor>(exec);
|
||||
} else
|
||||
{
|
||||
detail::on_success(*this, executable, command_line, inits...);
|
||||
|
||||
if (process_information.hThread != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(process_information.hThread);
|
||||
|
||||
return basic_process<Executor>(exec,
|
||||
this->process_information.dwProcessId,
|
||||
this->process_information.hProcess);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
BOOST_PROCESS_V2_END_NAMESPACE
|
||||
|
||||
#endif // BOOST_PROCESS_V2_WINDOWS_WITH_LOGON_LAUNCHER_HPP
|
||||
135
include/boost/process/windows/with_token_launcher.hpp
Normal file
135
include/boost/process/windows/with_token_launcher.hpp
Normal file
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// boost/process/v2/windows/default_launcher.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef BOOST_PROCESS_V2_WINDOWS_WITH_TOKEN_LAUNCHER_HPP
|
||||
#define BOOST_PROCESS_V2_WINDOWS_WITH_TOKEN_LAUNCHER_HPP
|
||||
|
||||
#include <boost/process/v2/windows/default_launcher.hpp>
|
||||
|
||||
BOOST_PROCESS_V2_BEGIN_NAMESPACE
|
||||
namespace windows
|
||||
{
|
||||
|
||||
/// A windows launcher using CreateProcessWithToken instead of CreateProcess
|
||||
struct with_token_launcher : default_launcher
|
||||
{
|
||||
HANDLE token;
|
||||
DWORD logon_flags;
|
||||
with_token_launcher(HANDLE token = INVALID_HANDLE_VALUE,
|
||||
DWORD logon_flags = 0u) : token(token), logon_flags(logon_flags) {}
|
||||
|
||||
|
||||
template<typename ExecutionContext, typename Args, typename ... Inits>
|
||||
auto operator()(ExecutionContext & context,
|
||||
const typename std::enable_if<std::is_convertible<
|
||||
ExecutionContext&, net::execution_context&>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<typename ExecutionContext::executor_type>
|
||||
{
|
||||
error_code ec;
|
||||
auto proc = (*this)(context, ec, executable, std::forward<Args>(args), std::forward<Inits>(inits)...);
|
||||
|
||||
if (ec)
|
||||
v2::detail::throw_error(ec, "with_token_launcher");
|
||||
|
||||
return proc;
|
||||
}
|
||||
|
||||
|
||||
template<typename ExecutionContext, typename Args, typename ... Inits>
|
||||
auto operator()(ExecutionContext & context,
|
||||
error_code & ec,
|
||||
const typename std::enable_if<std::is_convertible<
|
||||
ExecutionContext&, net::execution_context&>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<typename ExecutionContext::executor_type>
|
||||
{
|
||||
return (*this)(context.get_executor(), ec, executable, std::forward<Args>(args), std::forward<Inits>(inits)...);
|
||||
}
|
||||
|
||||
template<typename Executor, typename Args, typename ... Inits>
|
||||
auto operator()(Executor exec,
|
||||
const typename std::enable_if<
|
||||
net::execution::is_executor<Executor>::value ||
|
||||
net::is_executor<Executor>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<Executor>
|
||||
{
|
||||
error_code ec;
|
||||
auto proc = (*this)(std::move(exec), ec, executable, std::forward<Args>(args), std::forward<Inits>(inits)...);
|
||||
|
||||
if (ec)
|
||||
detail::throw_error(ec, "with_token_launcher");
|
||||
|
||||
return proc;
|
||||
}
|
||||
|
||||
template<typename Executor, typename Args, typename ... Inits>
|
||||
auto operator()(Executor exec,
|
||||
error_code & ec,
|
||||
const typename std::enable_if<
|
||||
net::execution::is_executor<Executor>::value ||
|
||||
net::is_executor<Executor>::value,
|
||||
filesystem::path >::type & executable,
|
||||
Args && args,
|
||||
Inits && ... inits ) -> basic_process<Executor>
|
||||
{
|
||||
auto command_line = this->build_command_line(executable, args);
|
||||
|
||||
ec = detail::on_setup(*this, executable, command_line, inits...);
|
||||
if (ec)
|
||||
{
|
||||
detail::on_error(*this, executable, command_line, ec, inits...);
|
||||
return basic_process<Executor>(exec);
|
||||
}
|
||||
auto ok = ::CreateProcessWithTokenW(
|
||||
token,
|
||||
logon_flags,
|
||||
executable.empty() ? nullptr : executable.c_str(),
|
||||
command_line.empty() ? nullptr : &command_line.front(),
|
||||
creation_flags,
|
||||
environment,
|
||||
current_directory.empty() ? nullptr : current_directory.c_str(),
|
||||
&startup_info.StartupInfo,
|
||||
&process_information);
|
||||
|
||||
|
||||
if (ok == 0)
|
||||
{
|
||||
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec);
|
||||
detail::on_error(*this, executable, command_line, ec, inits...);
|
||||
|
||||
if (process_information.hProcess != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(process_information.hProcess);
|
||||
if (process_information.hThread != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(process_information.hThread);
|
||||
|
||||
return basic_process<Executor>(exec);
|
||||
} else
|
||||
{
|
||||
detail::on_success(*this, executable, command_line, inits...);
|
||||
|
||||
if (process_information.hThread != INVALID_HANDLE_VALUE)
|
||||
::CloseHandle(process_information.hThread);
|
||||
|
||||
return basic_process<Executor>(exec,
|
||||
this->process_information.dwProcessId,
|
||||
this->process_information.hProcess);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
BOOST_PROCESS_V2_END_NAMESPACE
|
||||
|
||||
#endif // BOOST_PROCESS_V2_WINDOWS_WITH_TOKEN_LAUNCHER_HPP
|
||||
@@ -3,5 +3,5 @@
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
alias v1-tests : v1//bare v1//with-valgrind v1//without-valgrind ;
|
||||
# alias v1-tests : v1//bare v1//with-valgrind v1//without-valgrind ;
|
||||
alias v2-tests : v2//standalone v2//with_target ;
|
||||
|
||||
Reference in New Issue
Block a user