00001 // 00002 // Boost.Process 00003 // ~~~~~~~~~~~~~ 00004 // 00005 // Copyright (c) 2006, 2007 Julio M. Merino Vidal 00006 // Copyright (c) 2008 Boris Schaeling 00007 // 00008 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00009 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00010 // 00011 00018 #ifndef BOOST_PROCESS_WIN32_CHILD_HPP 00019 #define BOOST_PROCESS_WIN32_CHILD_HPP 00020 00021 #include <boost/process/child.hpp> 00022 #include <boost/process/detail/file_handle.hpp> 00023 #include <windows.h> 00024 00025 namespace boost { 00026 namespace process { 00027 00047 class win32_child : public child 00048 { 00049 public: 00064 win32_child(const PROCESS_INFORMATION &pi, detail::file_handle fhstdin, detail::file_handle fhstdout, detail::file_handle fhstderr) 00065 : child(pi.dwProcessId, fhstdin, fhstdout, fhstderr, pi.hProcess), 00066 process_information_(pi), 00067 thread_handle_(process_information_.hThread) 00068 { 00069 } 00070 00080 HANDLE get_handle() const 00081 { 00082 return process_information_.hProcess; 00083 } 00084 00094 HANDLE get_primary_thread_handle() const 00095 { 00096 return process_information_.hThread; 00097 } 00098 00108 DWORD get_primary_thread_id() const 00109 { 00110 return process_information_.dwThreadId; 00111 } 00112 00113 private: 00117 PROCESS_INFORMATION process_information_; 00118 00122 detail::file_handle thread_handle_; 00123 }; 00124 00125 } 00126 } 00127 00128 #endif