#include <win32_child.hpp>
Public Member Functions | |
win32_child (const PROCESS_INFORMATION &pi, detail::file_handle fhstdin, detail::file_handle fhstdout, detail::file_handle fhstderr) | |
HANDLE | get_handle () const |
HANDLE | get_primary_thread_handle () const |
DWORD | get_primary_thread_id () const |
The win32_child class implements the Child concept in a Windows operating system.
A Windows child differs from a regular child (represented by a child object) in that it holds additional information about a process. Aside from the standard handle, it also includes a handle to the process' main thread, together with identifiers to both entities.
This class is built on top of the generic child so as to allow its trivial adoption. When a program is changed to use the Windows-specific context (win32_context), it will most certainly need to migrate its use of the child class to win32_child. Doing so is only a matter of redefining the appropriate object and later using the required extra features: there should be no need to modify the existing code (e.g. method calls) in any other way.
boost::process::win32_child::win32_child | ( | const PROCESS_INFORMATION & | pi, | |
detail::file_handle | fhstdin, | |||
detail::file_handle | fhstdout, | |||
detail::file_handle | fhstderr | |||
) | [inline] |
Constructs a new Windows child object representing a just spawned child process.
Creates a new child object that represents the process described by the pi structure.
The fhstdin, fhstdout and fhstderr parameters hold the communication streams used to interact with the child process if the launcher configured redirections. See the parent class' constructor for more details on these.
HANDLE boost::process::win32_child::get_handle | ( | ) | const [inline] |
HANDLE boost::process::win32_child::get_primary_thread_handle | ( | ) | const [inline] |
Returns the primary thread's handle.
Returns a handle to the primary thread of the new process. This is the value of the hThread field in the PROCESS_INFORMATION structure returned by CreateProcess().
DWORD boost::process::win32_child::get_primary_thread_id | ( | ) | const [inline] |
Returns the primary thread's identifier.
Returns a system-wide value that identifies the process's primary thread. This is the value of the dwThreadId field in the PROCESS_INFORMATION structure returned by CreateProcess().