LLDB mainline
ProcessLauncherWindows.h
Go to the documentation of this file.
1//===-- ProcessLauncherWindows.h --------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef lldb_Host_windows_ProcessLauncherWindows_h_
10#define lldb_Host_windows_ProcessLauncherWindows_h_
11
14#include "llvm/Support/ErrorOr.h"
15
16namespace lldb_private {
17
19
21public:
23 Status &error) override;
24
25protected:
26 HANDLE GetStdioHandle(const ProcessLaunchInfo &launch_info, int fd);
27
28 /// Get the list of Windows handles that should be inherited by the child
29 /// process and update `STARTUPINFOEXW` with the handle list.
30 ///
31 /// If no handles need to be inherited, an empty vector is returned.
32 ///
33 /// Otherwise, the function populates the
34 /// `PROC_THREAD_ATTRIBUTE_HANDLE_LIST` attribute in `startupinfoex` with the
35 /// collected handles using `UpdateProcThreadAttribute`. On success, the
36 /// vector of inherited handles is returned.
37 ///
38 /// \param launch_info
39 /// The process launch configuration.
40 ///
41 /// \param startupinfoex
42 /// The extended STARTUPINFO structure for the process being created.
43 ///
44 /// \param stdout_handle
45 /// \param stderr_handle
46 /// \param stdin_handle
47 /// Optional explicit standard stream handles to use for the child process.
48 ///
49 /// \returns
50 /// `std::vector<HANDLE>` containing all handles that the child must
51 /// inherit.
52 llvm::ErrorOr<std::vector<HANDLE>>
53 GetInheritedHandles(const ProcessLaunchInfo &launch_info,
54 STARTUPINFOEXW &startupinfoex,
55 HANDLE stdout_handle = NULL, HANDLE stderr_handle = NULL,
56 HANDLE stdin_handle = NULL);
57};
58}
59
60#endif
static llvm::raw_ostream & error(Stream &strm)
HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info, Status &error) override
llvm::ErrorOr< std::vector< HANDLE > > GetInheritedHandles(const ProcessLaunchInfo &launch_info, STARTUPINFOEXW &startupinfoex, HANDLE stdout_handle=NULL, HANDLE stderr_handle=NULL, HANDLE stdin_handle=NULL)
Get the list of Windows handles that should be inherited by the child process and update STARTUPINFOE...
HANDLE GetStdioHandle(const ProcessLaunchInfo &launch_info, int fd)
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.