mirror of
https://github.com/boostorg/process.git
synced 2026-01-19 04:22:15 +00:00
moved the winapi out of the repo, not tested!
This is because of the current attempt to pull the winapi stuff into the boost/winapi repo. Here's the [pull request](https://github.com/boostorg/winapi/pull/16)
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* GetSystemDirectory.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETSYSTEMDIRECTORY_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_GETSYSTEMDIRECTORY_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/tchar.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
using ::GetSystemDirectoryA;
|
||||
using ::GetSystemDirectoryW;
|
||||
#else
|
||||
|
||||
__declspec(dllimport) unsigned int WINAPI GetSystemDirectoryA (LPSTR_ lpBuffer, unsigned int uSize);
|
||||
__declspec(dllimport) unsigned int WINAPI GetSystemDirectoryW (LPWSTR_ lpBuffer, unsigned int uSize);
|
||||
|
||||
|
||||
#if defined(UNICODE) && !defined(GetSystemDirectory)
|
||||
inline unsigned int GetSystemDirectory (LPWSTR_ lpBuffer, unsigned int uSize)
|
||||
{
|
||||
return GetSystemDirectoryW(lpBuffer, uSize);
|
||||
}
|
||||
|
||||
|
||||
#elif !defined(GetSystemDirectory)
|
||||
inline unsigned int GetSystemDirectory (LPSTR_ lpBuffer, unsigned int uSize)
|
||||
{
|
||||
return GetSystemDirectoryA(lpBuffer, uSize);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_GETSYSTEMDIRECTORY_HPP_ */
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* environment.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens Morgenstern
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
const DWORD_ debug_process = DEBUG_PROCESS ;
|
||||
const DWORD_ debug_only_this_process = DEBUG_ONLY_THIS_PROCESS ;
|
||||
const DWORD_ create_suspended = CREATE_SUSPENDED ;
|
||||
const DWORD_ detached_process = DETACHED_PROCESS ;
|
||||
const DWORD_ create_new_console = CREATE_NEW_CONSOLE ;
|
||||
const DWORD_ normal_priority_class = NORMAL_PRIORITY_CLASS ;
|
||||
const DWORD_ idle_priority_class = IDLE_PRIORITY_CLASS ;
|
||||
const DWORD_ high_priority_class = HIGH_PRIORITY_CLASS ;
|
||||
const DWORD_ realtime_priority_class = REALTIME_PRIORITY_CLASS ;
|
||||
const DWORD_ create_new_process_group = CREATE_NEW_PROCESS_GROUP ;
|
||||
const DWORD_ create_unicode_environment = CREATE_UNICODE_ENVIRONMENT ;
|
||||
const DWORD_ create_separate_wow_vdm = CREATE_SEPARATE_WOW_VDM ;
|
||||
const DWORD_ create_shared_wow_vdm = CREATE_SHARED_WOW_VDM ;
|
||||
const DWORD_ create_forcedos = CREATE_FORCEDOS ;
|
||||
const DWORD_ below_normal_priority_class = BELOW_NORMAL_PRIORITY_CLASS ;
|
||||
const DWORD_ above_normal_priority_class = ABOVE_NORMAL_PRIORITY_CLASS ;
|
||||
const DWORD_ inherit_parent_affinity = INHERIT_PARENT_AFFINITY ;
|
||||
const DWORD_ inherit_caller_priority = INHERIT_CALLER_PRIORITY ;
|
||||
const DWORD_ create_protected_process = CREATE_PROTECTED_PROCESS ;
|
||||
const DWORD_ extended_startupinfo_present = EXTENDED_STARTUPINFO_PRESENT ;
|
||||
const DWORD_ process_mode_background_begin = PROCESS_MODE_BACKGROUND_BEGIN ;
|
||||
const DWORD_ process_mode_background_end = PROCESS_MODE_BACKGROUND_END ;
|
||||
const DWORD_ create_breakaway_from_job = CREATE_BREAKAWAY_FROM_JOB ;
|
||||
const DWORD_ create_preserve_code_authz_level = CREATE_PRESERVE_CODE_AUTHZ_LEVEL;
|
||||
const DWORD_ create_default_error_mode = CREATE_DEFAULT_ERROR_MODE ;
|
||||
const DWORD_ create_no_window = CREATE_NO_WINDOW ;
|
||||
const DWORD_ profile_user = PROFILE_USER ;
|
||||
const DWORD_ profile_kernel = PROFILE_KERNEL ;
|
||||
const DWORD_ profile_server = PROFILE_SERVER ;
|
||||
const DWORD_ create_ignore_system_default = CREATE_IGNORE_SYSTEM_DEFAULT ;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ debug_process = 0x1 ;
|
||||
const DWORD_ debug_only_this_process = 0x2 ;
|
||||
const DWORD_ create_suspended = 0x4 ;
|
||||
const DWORD_ detached_process = 0x8 ;
|
||||
const DWORD_ create_new_console = 0x10 ;
|
||||
const DWORD_ normal_priority_class = 0x20 ;
|
||||
const DWORD_ idle_priority_class = 0x40 ;
|
||||
const DWORD_ high_priority_class = 0x80 ;
|
||||
const DWORD_ realtime_priority_class = 0x100 ;
|
||||
const DWORD_ create_new_process_group = 0x200 ;
|
||||
const DWORD_ create_unicode_environment = 0x400 ;
|
||||
const DWORD_ create_separate_wow_vdm = 0x800 ;
|
||||
const DWORD_ create_shared_wow_vdm = 0x1000 ;
|
||||
const DWORD_ create_forcedos = 0x2000 ;
|
||||
const DWORD_ below_normal_priority_class = 0x4000 ;
|
||||
const DWORD_ above_normal_priority_class = 0x8000 ;
|
||||
const DWORD_ inherit_parent_affinity = 0x10000 ;
|
||||
const DWORD_ inherit_caller_priority = 0x20000 ;
|
||||
const DWORD_ create_protected_process = 0x40000 ;
|
||||
const DWORD_ extended_startupinfo_present = 0x80000 ;
|
||||
const DWORD_ process_mode_background_begin = 0x100000 ;
|
||||
const DWORD_ process_mode_background_end = 0x200000 ;
|
||||
const DWORD_ create_breakaway_from_job = 0x1000000 ;
|
||||
const DWORD_ create_preserve_code_authz_level = 0x2000000 ;
|
||||
const DWORD_ create_default_error_mode = 0x4000000 ;
|
||||
const DWORD_ create_no_window = 0x8000000 ;
|
||||
const DWORD_ profile_user = 0x10000000 ;
|
||||
const DWORD_ profile_kernel = 0x20000000 ;
|
||||
const DWORD_ profile_server = 0x40000000 ;
|
||||
const DWORD_ create_ignore_system_default = 0x80000000 ;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_ */
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* handleapi.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens Morgenstern
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_HANDLEAPI_HPP_
|
||||
#define BOOST_DETAIL_HANDLEAPI_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
using ::GetHandleInformation;
|
||||
using ::SetHandleInformation;
|
||||
|
||||
const DWORD_ handle_flag_inherit = HANDLE_FLAG_INHERIT;
|
||||
const DWORD_ handle_flag_protect_from_close = HANDLE_FLAG_PROTECT_FROM_CLOSE;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ handle_flag_inherit = 0x1;
|
||||
const DWORD_ handle_flag_protect_from_close = 0x2;
|
||||
|
||||
__declspec(dllimport) int WINAPI GetHandleInformation (HANDLE_ hObject, DWORD_* lpdwFlags);
|
||||
__declspec(dllimport) int WINAPI SetHandleInformation (HANDLE_ hObject, DWORD_ dwMask, DWORD_ dwFlags);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_HANDLEAPI_HPP_ */
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* namepd_pipe_api.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens Morgenstern
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_NAMED_PIPE_API_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_NAMED_PIPE_API_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/detail/winapi/security.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::ImpersonateNamedPipeClient;
|
||||
using ::CreatePipe;
|
||||
using ::ConnectNamedPipe;
|
||||
using ::DisconnectNamedPipe;
|
||||
using ::SetNamedPipeHandleState;
|
||||
using ::PeekNamedPipe;
|
||||
using ::TransactNamedPipe;
|
||||
using ::CreateNamedPipeW;
|
||||
using ::WaitNamedPipeW;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
using ::GetNamedPipeClientComputerNameW;
|
||||
#endif
|
||||
typedef ::OVERLAPPED OVERLAPPED_;
|
||||
typedef ::LPOVERLAPPED LPOVERLAPPED_;
|
||||
#else
|
||||
|
||||
struct OVERLAPPED_ {
|
||||
ULONG_PTR_ Internal;
|
||||
ULONG_PTR_ InternalHigh;
|
||||
union {
|
||||
struct {
|
||||
DWORD_ Offset;
|
||||
DWORD_ OffsetHigh;
|
||||
} ;
|
||||
PVOID_ Pointer;
|
||||
} ;
|
||||
HANDLE_ hEvent;
|
||||
};
|
||||
|
||||
typedef OVERLAPPED_ *LPOVERLAPPED_;
|
||||
|
||||
__declspec(dllimport) int WINAPI ImpersonateNamedPipeClient (HANDLE_ hNamedPipe);
|
||||
__declspec(dllimport) int WINAPI CreatePipe (HANDLE_* hReadPipe, HANDLE_* hWritePipe, LPSECURITY_ATTRIBUTES_ lpPipeAttributes, DWORD_ nSize);
|
||||
__declspec(dllimport) int WINAPI ConnectNamedPipe (HANDLE_ hNamedPipe, LPOVERLAPPED_ lpOverlapped);
|
||||
__declspec(dllimport) int WINAPI DisconnectNamedPipe (HANDLE_ hNamedPipe);
|
||||
__declspec(dllimport) int WINAPI SetNamedPipeHandleState (HANDLE_ hNamedPipe, DWORD_* lpMode, DWORD_* lpMaxCollectionCount, DWORD_* lpCollectDataTimeout);
|
||||
__declspec(dllimport) int WINAPI PeekNamedPipe (HANDLE_ hNamedPipe, LPVOID_ lpBuffer, DWORD_ nBufferSize, DWORD_* lpBytesRead, DWORD_* lpTotalBytesAvail, DWORD_* lpBytesLeftThisMessage);
|
||||
__declspec(dllimport) int WINAPI TransactNamedPipe (HANDLE_ hNamedPipe, LPVOID_ lpInBuffer, DWORD_ nInBufferSize, LPVOID_ lpOutBuffer, DWORD_ nOutBufferSize, DWORD_* lpBytesRead, LPOVERLAPPED_ lpOverlapped);
|
||||
__declspec(dllimport) HANDLE_ WINAPI CreateNamedPipeW (LPCWSTR_ lpName, DWORD_ dwOpenMode, DWORD_ dwPipeMode, DWORD_ nMaxInstances, DWORD_ nOutBufferSize, DWORD_ nInBufferSize, DWORD_ nDefaultTimeOut, LPSECURITY_ATTRIBUTES_ lpSecurityAttributes);
|
||||
__declspec(dllimport) int WINAPI WaitNamedPipeW (LPCWSTR_ lpNamedPipeName, DWORD_ nTimeOut);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
WINBASEAPI int WINAPI GetNamedPipeClientComputerNameW (HANDLE_ Pipe, LPWSTR_ ClientComputerName, ULONG_ ClientComputerNameLength);
|
||||
#endif
|
||||
|
||||
#if defined(UNICODE) && !defined(CreateNamedPipe) && !defined(WaitNamedPipe)
|
||||
inline HANDLE_ CreateNamedPipe(LPCWSTR_ lpName, DWORD_ dwOpenMode, DWORD_ dwPipeMode, DWORD_ nMaxInstances, DWORD_ nOutBufferSize, DWORD_ nInBufferSize, DWORD_ nDefaultTimeOut, LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
|
||||
{
|
||||
return CreateNamedPipeW(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
|
||||
}
|
||||
|
||||
inline int WaitNamedPipe(LPCWSTR_ lpNamedPipeName, DWORD_ nTimeOut)
|
||||
{
|
||||
return WaitNamedPipeW(lpNamedPipeName, nTimeOut);
|
||||
}
|
||||
#if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6) && !defined(GetNamedPipeClientComputerName)
|
||||
|
||||
inline int GetNamedPipeClientComputerName(HANDLE_ Pipe, LPWSTR ClientComputerName, ULONG ClientComputerNameLength)
|
||||
{
|
||||
return GetNamedPipeClientComputerNameW(Pipe, ClientComputerName, ClientComputerNameLength);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_NAMED_PIPE_API_HPP_ */
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* HANDLE_api.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens Morgenstern
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_PROCESS_API_HPP_
|
||||
#define BOOST_DETAIL_PROCESS_API_HPP_
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/security.hpp>
|
||||
#include <boost/detail/winapi/process_info.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
//|| defined( CreateProcess )
|
||||
using ::GetExitCodeProcess;
|
||||
using ::ExitProcess;
|
||||
using ::TerminateProcess;
|
||||
using ::CreateProcessA;
|
||||
using ::CreateProcessW;
|
||||
|
||||
#else
|
||||
|
||||
__declspec(dllimport) __declspec (noreturn) void WINAPI ExitProcess (unsigned int uExitCode);
|
||||
__declspec(dllimport) int WINAPI TerminateProcess (HANDLE_ hProcess, unsigned int uExitCode);
|
||||
__declspec(dllimport) int WINAPI GetExitCodeProcess (HANDLE_ hProcess, DWORD_* lpExitCode);
|
||||
|
||||
__declspec(dllimport) int WINAPI CreateProcessA (LPCSTR_ lpApplicationName, LPSTR_ lpCommandLine, LPSECURITY_ATTRIBUTES_ lpProcessAttributes, LPSECURITY_ATTRIBUTES_ lpThreadAttributes, int bInheritHandles, DWORD_ dwCreationFlags, LPVOID_ lpEnvironment, LPCSTR_ lpCurrentDirectory, STARTUPINFOA_* lpStartupInfo, PROCESS_INFORMATION_* lpProcessInformation);
|
||||
__declspec(dllimport) int WINAPI CreateProcessW (LPCWSTR_ lpApplicationName, LPWSTR_ lpCommandLine, LPSECURITY_ATTRIBUTES_ lpProcessAttributes, LPSECURITY_ATTRIBUTES_ lpThreadAttributes, int bInheritHandles, DWORD_ dwCreationFlags, LPVOID_ lpEnvironment, LPCWSTR_ lpCurrentDirectory, STARTUPINFOW_* lpStartupInfo, PROCESS_INFORMATION_* lpProcessInformation);
|
||||
|
||||
|
||||
|
||||
#if defined(UNICODE) && !defined(CreateProcess)
|
||||
inline static int CreateProcess (LPCWSTR_ lpApplicationName, LPWSTR_ lpCommandLine, LPSECURITY_ATTRIBUTES_ lpProcessAttributes, LPSECURITY_ATTRIBUTES_ lpThreadAttributes, int bInheritHandles, DWORD_ dwCreationFlags, LPVOID_ lpEnvironment, LPCWSTR_ lpCurrentDirectory, STARTUPINFOW_* lpStartupInfo, PROCESS_INFORMATION_* lpProcessInformation)
|
||||
{
|
||||
return CreateProcessW (lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
|
||||
}
|
||||
|
||||
#elif !defined(CreateProcess)
|
||||
inline static int CreateProcess (LPCSTR_ lpApplicationName, LPSTR_ lpCommandLine, LPSECURITY_ATTRIBUTES_ lpProcessAttributes, LPSECURITY_ATTRIBUTES_ lpThreadAttributes, int bInheritHandles, DWORD_ dwCreationFlags, LPVOID_ lpEnvironment, LPCSTR_ lpCurrentDirectory, STARTUPINFOA_* lpStartupInfo, PROCESS_INFORMATION_* lpProcessInformation)
|
||||
{
|
||||
return CreateProcessA (lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
|
||||
}
|
||||
#endif //UNICODE
|
||||
#endif //BOOST_USE_WINDOWS_H
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_HANDLE_API_HPP_ */
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* process_info.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_PROCESS_INFO_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_PROCESS_INFO_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::PROCESS_INFORMATION PROCESS_INFORMATION_;
|
||||
typedef ::STARTUPINFOA STARTUPINFOA_;
|
||||
typedef ::STARTUPINFOW STARTUPINFOW_;
|
||||
typedef ::STARTUPINFOEX STARTUPINFOEX;
|
||||
#else
|
||||
|
||||
struct PROCESS_INFORMATION_
|
||||
{
|
||||
HANDLE_ hProcess;
|
||||
HANDLE_ hThread;
|
||||
DWORD_ dwProcessId;
|
||||
DWORD_ dwThreadId;
|
||||
};
|
||||
|
||||
|
||||
struct STARTUPINFOA_ {
|
||||
DWORD_ cb;
|
||||
LPSTR_ lpReserved;
|
||||
LPSTR_ lpDesktop;
|
||||
LPSTR_ lpTitle;
|
||||
DWORD_ dwX;
|
||||
DWORD_ dwY;
|
||||
DWORD_ dwXSize;
|
||||
DWORD_ dwYSize;
|
||||
DWORD_ dwXCountChars;
|
||||
DWORD_ dwYCountChars;
|
||||
DWORD_ dwFillAttribute;
|
||||
DWORD_ dwFlags;
|
||||
WORD_ wShowWindow;
|
||||
WORD_ cbReserved2;
|
||||
BYTE_ *lpReserved2;
|
||||
HANDLE_ hStdInput;
|
||||
HANDLE_ hStdOutput;
|
||||
HANDLE_ hStdError;
|
||||
};
|
||||
|
||||
struct STARTUPINFOW_ {
|
||||
DWORD cb;
|
||||
LPWSTR_ lpReserved;
|
||||
LPWSTR_ lpDesktop;
|
||||
LPWSTR_ lpTitle;
|
||||
DWORD_ dwX;
|
||||
DWORD_ dwY;
|
||||
DWORD_ dwXSize;
|
||||
DWORD_ dwYSize;
|
||||
DWORD_ dwXCountChars;
|
||||
DWORD_ dwYCountChars;
|
||||
DWORD_ dwFillAttribute;
|
||||
DWORD_ dwFlags;
|
||||
WORD_ wShowWindow;
|
||||
WORD_ cbReserved2;
|
||||
BYTE_ *lpReserved2;
|
||||
HANDLE_ hStdInput;
|
||||
HANDLE_ hStdOutput;
|
||||
HANDLE_ hStdError;
|
||||
} ;
|
||||
|
||||
|
||||
#if defined(UNICODE)
|
||||
typedef STARTUPINFOW_ STARTUPINFO_;
|
||||
#else
|
||||
typedef STARTUPINFOA_ STARTUPINFO_;
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::STARTUPINFOEX STARTUPINFOEX_;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct PROC_THREAD_ATTRIBUTE_LIST_ *PPROC_THREAD_ATTRIBUTE_LIST_;
|
||||
|
||||
|
||||
struct STARTUPINFOEX_ {
|
||||
STARTUPINFO_ StartupInfo;
|
||||
PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}}}
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_PROCESS_INFO_HPP_ */
|
||||
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
* shell_api.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SHELL_API_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_SHELL_API_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ shgfi_icon = SHGFI_ICON ;
|
||||
const DWORD_ shgfi_displayname = SHGFI_DISPLAYNAME ;
|
||||
const DWORD_ shgfi_typename = SHGFI_TYPENAME ;
|
||||
const DWORD_ shgfi_attributes = SHGFI_ATTRIBUTES ;
|
||||
const DWORD_ shgfi_iconlocation = SHGFI_ICONLOCATION ;
|
||||
const DWORD_ shgfi_exetype = SHGFI_EXETYPE ;
|
||||
const DWORD_ shgfi_sysiconindex = SHGFI_SYSICONINDEX ;
|
||||
const DWORD_ shgfi_linkoverlay = SHGFI_LINKOVERLAY ;
|
||||
const DWORD_ shgfi_selected = SHGFI_SELECTED ;
|
||||
const DWORD_ shgfi_attr_specified = SHGFI_ATTR_SPECIFIED ;
|
||||
const DWORD_ shgfi_largeicon = SHGFI_LARGEICON ;
|
||||
const DWORD_ shgfi_smallicon = SHGFI_SMALLICON ;
|
||||
const DWORD_ shgfi_openicon = SHGFI_OPENICON ;
|
||||
const DWORD_ shgfi_shelliconsize = SHGFI_SHELLICONSIZE ;
|
||||
const DWORD_ shgfi_pidl = SHGFI_PIDL ;
|
||||
const DWORD_ shgfi_usefileattributes = SHGFI_USEFILEATTRIBUTES;
|
||||
const DWORD_ shgfi_addoverlays = SHGFI_ADDOVERLAYS ;
|
||||
const DWORD_ shgfi_overlayindex = SHGFI_OVERLAYINDEX ;
|
||||
const DWORD_ max_path = MAX_PATH;
|
||||
|
||||
|
||||
using ::SHGetFileInfoA;
|
||||
using ::SHGetFileInfoW;
|
||||
|
||||
typedef ::SHFILEINFOA SHFILEINFOA_;
|
||||
typedef ::SHFILEINFOW SHFILEINFOW_;
|
||||
typedef ::ICON ICON_;
|
||||
typedef ::HICON HICON_;
|
||||
#else
|
||||
|
||||
struct ICON_ {};
|
||||
typedef ICON_ *HICON_;
|
||||
|
||||
const DWORD_ max_path = 260;
|
||||
|
||||
struct SHFILEINFOA_ {
|
||||
HICON_ hIcon;
|
||||
int iIcon;
|
||||
DWORD_ dwAttributes;
|
||||
CHAR_ szDisplayName[260];
|
||||
CHAR_ szTypeName[80];
|
||||
} ;
|
||||
|
||||
struct SHFILEINFOW_ {
|
||||
HICON_ hIcon;
|
||||
int iIcon;
|
||||
DWORD_ dwAttributes;
|
||||
WCHAR_ szDisplayName[260];
|
||||
WCHAR_ szTypeName[80];
|
||||
};
|
||||
|
||||
|
||||
const DWORD_ shgfi_icon = 0x000000100;
|
||||
const DWORD_ shgfi_displayname = 0x000000200;
|
||||
const DWORD_ shgfi_typename = 0x000000400;
|
||||
const DWORD_ shgfi_attributes = 0x000000800;
|
||||
const DWORD_ shgfi_iconlocation = 0x000001000;
|
||||
const DWORD_ shgfi_exetype = 0x000002000;
|
||||
const DWORD_ shgfi_sysiconindex = 0x000004000;
|
||||
const DWORD_ shgfi_linkoverlay = 0x000008000;
|
||||
const DWORD_ shgfi_selected = 0x000010000;
|
||||
const DWORD_ shgfi_attr_specified = 0x000020000;
|
||||
const DWORD_ shgfi_largeicon = 0x000000000;
|
||||
const DWORD_ shgfi_smallicon = 0x000000001;
|
||||
const DWORD_ shgfi_openicon = 0x000000002;
|
||||
const DWORD_ shgfi_shelliconsize = 0x000000004;
|
||||
const DWORD_ shgfi_pidl = 0x000000008;
|
||||
const DWORD_ shgfi_usefileattributes = 0x000000010;
|
||||
const DWORD_ shgfi_addoverlays = 0x000000020;
|
||||
const DWORD_ shgfi_overlayindex = 0x000000040;
|
||||
|
||||
__declspec(dllimport) DWORD_* WINAPI SHGetFileInfoA (LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_ *psfinsigned, unsigned int cbFileInfons, unsigned int uFlags);
|
||||
__declspec(dllimport) DWORD_* WINAPI SHGetFileInfoW (LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_ *psfinsigned, unsigned int cbFileInfons, unsigned int uFlags);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
typedef SHFILEINFOW_ SHFILEINFO_;
|
||||
inline DWORD_* SHGetFileInfo (LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_ *psfinsigned, unsigned int cbFileInfons, unsigned int uFlags)
|
||||
{
|
||||
return SHGetFileInfoW(pszPath, dwFileAttributes, psfinsigned, cbFileInfons, uFlags);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
typedef SHFILEINFOA_ SHFILEINFO_;
|
||||
inline DWORD_* SHGetFileInfo (LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_ *psfinsigned, unsigned int cbFileInfons, unsigned int uFlags)
|
||||
{
|
||||
return SHGetFileInfoA (pszPath, dwFileAttributes, psfinsigned, cbFileInfons, uFlags);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_SHELL_API_HPP_ */
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* show_windows.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens Morgenstern
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SHOW_WINDOWS_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_SHOW_WINDOWS_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWOD_ sw_hide = SW_HIDE ;
|
||||
const DWOD_ sw_shownormal = SW_SHOWNORMAL ;
|
||||
const DWOD_ sw_normal = SW_NORMAL ;
|
||||
const DWOD_ sw_showminimized = SW_SHOWMINIMIZED ;
|
||||
const DWOD_ sw_showmaximized = SW_SHOWMAXIMIZED ;
|
||||
const DWOD_ sw_maximize = SW_MAXIMIZE ;
|
||||
const DWOD_ sw_shownoactivate = SW_SHOWNOACTIVATE ;
|
||||
const DWOD_ sw_show = SW_SHOW ;
|
||||
const DWOD_ sw_minimize = SW_MINIMIZE ;
|
||||
const DWOD_ sw_showminnoactive = SW_SHOWMINNOACTIVE ;
|
||||
const DWOD_ sw_showna = SW_SHOWNA ;
|
||||
const DWOD_ sw_restore = SW_RESTORE ;
|
||||
const DWOD_ sw_showdefault = SW_SHOWDEFAULT ;
|
||||
const DWOD_ sw_forceminimize = SW_FORCEMINIMIZE ;
|
||||
const DWOD_ sw_max = SW_MAX ;
|
||||
const DWOD_ hide_window = HIDE_WINDOW ;
|
||||
const DWOD_ show_openwindow = SHOW_OPENWINDOW ;
|
||||
const DWOD_ show_iconwindow = SHOW_ICONWINDOW ;
|
||||
const DWOD_ show_fullscreen = SHOW_FULLSCREEN ;
|
||||
const DWOD_ show_opennoactivate = SHOW_OPENNOACTIVATE ;
|
||||
const DWOD_ sw_parentclosing = SW_PARENTCLOSING ;
|
||||
const DWOD_ sw_otherzoom = SW_OTHERZOOM ;
|
||||
const DWOD_ sw_parentopening = SW_PARENTOPENING ;
|
||||
const DWOD_ sw_otherunzoom = SW_OTHERUNZOOM ;
|
||||
|
||||
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ sw_hide = 0 ;
|
||||
const DWORD_ sw_shownormal = 1 ;
|
||||
const DWORD_ sw_normal = 1 ;
|
||||
const DWORD_ sw_showminimized = 2 ;
|
||||
const DWORD_ sw_showmaximized = 3 ;
|
||||
const DWORD_ sw_maximize = 3 ;
|
||||
const DWORD_ sw_shownoactivate = 4 ;
|
||||
const DWORD_ sw_show = 5 ;
|
||||
const DWORD_ sw_minimize = 6 ;
|
||||
const DWORD_ sw_showminnoactive = 7 ;
|
||||
const DWORD_ sw_showna = 8 ;
|
||||
const DWORD_ sw_restore = 9 ;
|
||||
const DWORD_ sw_showdefault = 10;
|
||||
const DWORD_ sw_forceminimize = 11;
|
||||
const DWORD_ sw_max = 11;
|
||||
const DWORD_ hide_window = 0 ;
|
||||
const DWORD_ show_openwindow = 1 ;
|
||||
const DWORD_ show_iconwindow = 2 ;
|
||||
const DWORD_ show_fullscreen = 3 ;
|
||||
const DWORD_ show_opennoactivate = 4 ;
|
||||
const DWORD_ sw_parentclosing = 1 ;
|
||||
const DWORD_ sw_otherzoom = 2 ;
|
||||
const DWORD_ sw_parentopening = 3 ;
|
||||
const DWORD_ sw_otherunzoom = 4 ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_SHOW_WINDOWS_HPP_ */
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* startf.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens Morgenstern
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_STARTF_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_STARTF_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ startf_useshowwindow = STARTF_USESHOWWINDOW ;
|
||||
const DWORD_ startf_usesize = STARTF_USESIZE ;
|
||||
const DWORD_ startf_useposition = STARTF_USEPOSITION ;
|
||||
const DWORD_ startf_usecountchars = STARTF_USECOUNTCHARS ;
|
||||
const DWORD_ startf_usefillattribute = STARTF_USEFILLATTRIBUTE;
|
||||
const DWORD_ startf_runfullscreen = STARTF_RUNFULLSCREEN ;
|
||||
const DWORD_ startf_forceonfeedback = STARTF_FORCEONFEEDBACK ;
|
||||
const DWORD_ startf_forceofffeedback = STARTF_FORCEOFFFEEDBACK;
|
||||
const DWORD_ startf_usestdhandles = STARTF_USESTDHANDLES ;
|
||||
const DWORD_ startf_usehotkey = STARTF_USEHOTKEY ;
|
||||
const DWORD_ startf_titleislinkname = STARTF_TITLEISLINKNAME ;
|
||||
const DWORD_ startf_titleisappid = STARTF_TITLEISAPPID ;
|
||||
const DWORD_ startf_preventpinning = STARTF_PREVENTPINNING ;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ startf_useshowwindow = 0x00000001;
|
||||
const DWORD_ startf_usesize = 0x00000002;
|
||||
const DWORD_ startf_useposition = 0x00000004;
|
||||
const DWORD_ startf_usecountchars = 0x00000008;
|
||||
const DWORD_ startf_usefillattribute = 0x00000010;
|
||||
const DWORD_ startf_runfullscreen = 0x00000020;
|
||||
const DWORD_ startf_forceonfeedback = 0x00000040;
|
||||
const DWORD_ startf_forceofffeedback = 0x00000080;
|
||||
const DWORD_ startf_usestdhandles = 0x00000100;
|
||||
const DWORD_ startf_usehotkey = 0x00000200;
|
||||
const DWORD_ startf_titleislinkname = 0x00000800;
|
||||
const DWORD_ startf_titleisappid = 0x00001000;
|
||||
const DWORD_ startf_preventpinning = 0x00002000;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//STARTF_USESTDHANDLES
|
||||
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_STARTF_HPP_ */
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* string.hpp
|
||||
*
|
||||
* Created on: 11.10.2015
|
||||
* Author: Klemens
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TCHAR_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_TCHAR_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef ::TCHAR TCHAR_;
|
||||
|
||||
#else
|
||||
|
||||
#if defined(UNICODE)
|
||||
typedef wchar_t TCHAR_;
|
||||
#else
|
||||
typedef char TCHAR_;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* BOOST_DETAIL_WINAPI_TCHAR_HPP_ */
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
#include <boost/detail/winapi/process_info.hpp>>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef BOOST_PROCESS_WINDOWS_CREATE_PIPE_HPP
|
||||
#define BOOST_PROCESS_WINDOWS_CREATE_PIPE_HPP
|
||||
|
||||
#include <boost/detail/winapi/named_pipe_api.hpp>
|
||||
#include <boost/detail/winapi/named_pipes.hpp>
|
||||
#include <boost/process/config.hpp>
|
||||
#include <boost/process/windows/pipe.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
#include <boost/process/windows/child.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
#include <boost/detail/winapi/process_api.hpp>
|
||||
#include <boost/detail/winapi/tchar.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
#include <boost/detail/winapi/environment.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows {
|
||||
@@ -36,11 +35,11 @@ struct executor
|
||||
#endif
|
||||
{
|
||||
#if (_WIN32_WINNT >= 0x0600)
|
||||
std::memset(&startup_info_ex, 0, sizeof(::boost::detail::winapi::STARTUPINFOEX_));
|
||||
startup_info.cb = sizeof(::boost::detail::winapi::STARTUPINFOEX_);
|
||||
std::memset(&startup_info_ex, 0, sizeof(::boost::detail::winapi::STARTUPINFOEXW_));
|
||||
startup_info.cb = sizeof(::boost::detail::winapi::STARTUPINFOEXW_);
|
||||
#else
|
||||
std::memset(&startup_info, 0, sizeof(::boost::detail::winapi::STARTUPINFO_));
|
||||
startup_info.cb = sizeof(::boost::detail::winapi::STARTUPINFO_);
|
||||
std::memset(&startup_info, 0, sizeof(::boost::detail::winapi::STARTUPINFOW_));
|
||||
startup_info.cb = sizeof(::boost::detail::winapi::STARTUPINFOW_);
|
||||
#endif
|
||||
startup_info.hStdInput = ::boost::detail::winapi::invalid_handle_value;
|
||||
startup_info.hStdOutput = ::boost::detail::winapi::invalid_handle_value;
|
||||
@@ -91,7 +90,7 @@ struct executor
|
||||
{
|
||||
boost::fusion::for_each(seq, call_on_CreateProcess_setup(*this));
|
||||
|
||||
if (!::boost::detail::winapi::CreateProcess(
|
||||
if (!::boost::detail::winapi::create_process(
|
||||
exe,
|
||||
cmd_line,
|
||||
proc_attrs,
|
||||
@@ -113,19 +112,19 @@ struct executor
|
||||
return child(proc_info);
|
||||
}
|
||||
|
||||
const ::boost::detail::winapi::TCHAR_* exe;
|
||||
::boost::detail::winapi::TCHAR_* cmd_line;
|
||||
const ::boost::detail::winapi::WCHAR_* exe;
|
||||
::boost::detail::winapi::WCHAR_* cmd_line;
|
||||
::boost::detail::winapi::LPSECURITY_ATTRIBUTES_ proc_attrs;
|
||||
::boost::detail::winapi::LPSECURITY_ATTRIBUTES_ thread_attrs;
|
||||
::boost::detail::winapi::BOOL_ inherit_handles;
|
||||
::boost::detail::winapi::DWORD_ creation_flags;
|
||||
::boost::detail::winapi::LPVOID_ env;
|
||||
const ::boost::detail::winapi::TCHAR_* work_dir;
|
||||
const ::boost::detail::winapi::WCHAR_* work_dir;
|
||||
#if (_WIN32_WINNT >= 0x0600)
|
||||
::boost::detail::winapi::STARTUPINFOEX_ startup_info_ex;
|
||||
::boost::detail::winapi::STARTUPINFO_ &startup_info;
|
||||
::boost::detail::winapi::STARTUPINFOW_ &startup_info;
|
||||
#else
|
||||
::boost::detail::winapi::STARTUPINFO_ startup_info;
|
||||
::boost::detail::winapi::STARTUPINFOW_ startup_info;
|
||||
#endif
|
||||
::boost::detail::winapi::PROCESS_INFORMATION_ proc_info;
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/iostreams/device/file_descriptor.hpp>
|
||||
#include <boost/detail/winapi/handle_info.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
@@ -28,10 +28,10 @@ public:
|
||||
{
|
||||
::boost::detail::winapi::SetHandleInformation(
|
||||
sink_.handle(),
|
||||
::boost::detail::winapi::handle_flag_inherit,
|
||||
::boost::detail::winapi::handle_flag_inherit);
|
||||
::boost::detail::winapi::HANDLE_FLAG_INHERIT_,
|
||||
::boost::detail::winapi::HANDLE_FLAG_INHERIT_);
|
||||
e.startup_info.hStdError = sink_.handle();
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::startf_usestdhandles;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::STARTF_USESTDHANDLES_;
|
||||
e.inherit_handles = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/iostreams/device/file_descriptor.hpp>
|
||||
#include <boost/detail/winapi/handle_info.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
|
||||
@@ -26,10 +26,10 @@ public:
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
::boost::detail::winapi::SetHandleInformation(source_.handle(),
|
||||
::boost::detail::winapi::handle_flag_inherit,
|
||||
::boost::detail::winapi::handle_flag_inherit);
|
||||
::boost::detail::winapi::HANDLE_FLAG_INHERIT_,
|
||||
::boost::detail::winapi::HANDLE_FLAG_INHERIT_);
|
||||
e.startup_info.hStdInput = source_.handle();
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::startf_usestdhandles;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::STARTF_USESTDHANDLES_;
|
||||
e.inherit_handles = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/iostreams/device/file_descriptor.hpp>
|
||||
#include <boost/detail/winapi/handle_info.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
|
||||
@@ -27,10 +27,10 @@ public:
|
||||
{
|
||||
::boost::detail::winapi::SetHandleInformation(
|
||||
sink_.handle(),
|
||||
::boost::detail::winapi::handle_flag_inherit,
|
||||
::boost::detail::winapi::handle_flag_inherit);
|
||||
::boost::detail::winapi::HANDLE_FLAG_INHERIT_,
|
||||
::boost::detail::winapi::HANDLE_FLAG_INHERIT_);
|
||||
e.startup_info.hStdOutput = sink_.handle();
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::startf_usestdhandles;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::STARTF_USESTDHANDLES_;
|
||||
e.inherit_handles = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_STDERR_HPP
|
||||
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
template <class WindowsExecutor>
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
e.startup_info.hStdError = ::boost::detail::winapi::invalid_handle_value;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::startf_usestdhandles;
|
||||
e.startup_info.hStdError = ::boost::detail::winapi::INVALID_HANDLE_VALUE_;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::STARTF_USESTDHANDLES_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_STDIN_HPP
|
||||
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
template <class WindowsExecutor>
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
e.startup_info.hStdInput = boost::detail::winapi::invalid_handle_value;
|
||||
e.startup_info.dwFlags |= boost::detail::winapi::startf_usestdhandles;
|
||||
e.startup_info.hStdInput = boost::detail::winapi::INVALID_HANDLE_VALUE_;
|
||||
e.startup_info.dwFlags |= boost::detail::winapi::STARTF_USESTDHANDLES_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_STDOUT_HPP
|
||||
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
#include <boost/detail/winapi/handles.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
template <class WindowsExecutor>
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
e.startup_info.hStdOutput = boost::detail::winapi::invalid_handle_value;
|
||||
e.startup_info.dwFlags |= boost::detail::winapi::startf_usestdhandles;
|
||||
e.startup_info.hStdOutput = boost::detail::winapi::INVALID_HANDLE_VALUE_;
|
||||
e.startup_info.dwFlags |= boost::detail::winapi::STARTF_USESTDHANDLES_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_HIDE_CONSOLE_HPP
|
||||
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/show_windows.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
#include <boost/detail/winapi/ShowWindow.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
template <class WindowsExecutor>
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::startf_useshowwindow;
|
||||
e.startup_info.wShowWindow |= ::boost::detail::winapi::sw_hide;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::STARTF_USESHOWWINDOW_;
|
||||
e.startup_info.wShowWindow |= ::boost::detail::winapi::SW_HIDE_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ private:
|
||||
String s_;
|
||||
};
|
||||
|
||||
#if defined(_UNICODE) || defined(UNICODE)
|
||||
inline run_exe_<std::wstring> run_exe(const wchar_t *ws)
|
||||
{
|
||||
return run_exe_<std::wstring>(ws);
|
||||
@@ -47,7 +46,7 @@ inline run_exe_<std::wstring> run_exe(const boost::filesystem::path &p)
|
||||
{
|
||||
return run_exe_<std::wstring>(p.wstring());
|
||||
}
|
||||
#else
|
||||
#if !defined(BOOST_NO_ANSI_APIS)
|
||||
inline run_exe_<std::string> run_exe(const char *s)
|
||||
{
|
||||
return run_exe_<std::string>(s);
|
||||
@@ -62,7 +61,7 @@ inline run_exe_<std::string> run_exe(const boost::filesystem::path &p)
|
||||
{
|
||||
return run_exe_<std::string>(p.string());
|
||||
}
|
||||
#endif
|
||||
#endif // BOOST_NO_ANSI_APIS
|
||||
|
||||
}}}}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_SET_CMD_LINE_HPP
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_SET_CMD_LINE_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/range/algorithm/copy.hpp>
|
||||
#include <boost/shared_array.hpp>
|
||||
@@ -41,7 +42,6 @@ private:
|
||||
boost::shared_array<Char> cmd_line_;
|
||||
};
|
||||
|
||||
#if defined(_UNICODE) || defined(UNICODE)
|
||||
inline set_cmd_line_<std::wstring> set_cmd_line(const wchar_t *ws)
|
||||
{
|
||||
return set_cmd_line_<std::wstring>(ws);
|
||||
@@ -51,7 +51,7 @@ inline set_cmd_line_<std::wstring> set_cmd_line(const std::wstring &ws)
|
||||
{
|
||||
return set_cmd_line_<std::wstring>(ws);
|
||||
}
|
||||
#else
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
inline set_cmd_line_<std::string> set_cmd_line(const char *s)
|
||||
{
|
||||
return set_cmd_line_<std::string>(s);
|
||||
@@ -61,7 +61,7 @@ inline set_cmd_line_<std::string> set_cmd_line(const std::string &s)
|
||||
{
|
||||
return set_cmd_line_<std::string>(s);
|
||||
}
|
||||
#endif
|
||||
#endif //BOOST_NO_ANSI_APIS
|
||||
|
||||
}}}}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
|
||||
template <class Range, bool Unicode>
|
||||
template <class Range>
|
||||
class set_env_ : public initializer_base
|
||||
{
|
||||
private:
|
||||
@@ -47,6 +47,16 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
static BOOST_CONSTEXPR ::boost::detail::winapi::DWORD_ unicode_flag(wchar_t)
|
||||
{
|
||||
return ::boost::detail::winapi::CREATE_UNICODE_ENVIRONMENT_;
|
||||
}
|
||||
|
||||
static BOOST_CONSTEXPR ::boost::detail::winapi::DWORD_ unicode_flag(char)
|
||||
{
|
||||
return static_cast<::boost::detail::winapi::DWORD_>(0);
|
||||
}
|
||||
|
||||
public:
|
||||
set_env_(const Range &envs)
|
||||
: size_(boost::accumulate(envs, 0, add_size) + 1),
|
||||
@@ -56,12 +66,13 @@ public:
|
||||
env_[size_ - 1] = 0;
|
||||
}
|
||||
|
||||
|
||||
template <class WindowsExecutor>
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
e.env = env_.get();
|
||||
if (Unicode)
|
||||
e.creation_flags |= ::boost::detail::winapi::create_unicode_environment;
|
||||
|
||||
e.creation_flags |= unicode_flag(Char());
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -69,19 +80,11 @@ private:
|
||||
boost::shared_array<Char> env_;
|
||||
};
|
||||
|
||||
#if defined(_UNICODE) || defined(UNICODE)
|
||||
template <class Range>
|
||||
set_env_<Range, true> set_env(const Range &envs)
|
||||
set_env_<Range> set_env(const Range &envs)
|
||||
{
|
||||
return set_env_<Range, true>(envs);
|
||||
return set_env_<Range>(envs);
|
||||
}
|
||||
#else
|
||||
template <class Range>
|
||||
set_env_<Range, false> set_env(const Range &envs)
|
||||
{
|
||||
return set_env_<Range, false>(envs);
|
||||
}
|
||||
#endif
|
||||
|
||||
}}}}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_SHOW_WINDOW_HPP
|
||||
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/detail/winapi/startf.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace process { namespace windows { namespace initializers {
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
template <class WindowsExecutor>
|
||||
void on_CreateProcess_setup(WindowsExecutor &e) const
|
||||
{
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::startf_useshowwindow;
|
||||
e.startup_info.dwFlags |= ::boost::detail::winapi::STARTF_USESHOWWINDOW_;
|
||||
e.startup_info.wShowWindow |= flags_;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_START_IN_DIR_HPP
|
||||
#define BOOST_PROCESS_WINDOWS_INITIALIZERS_START_IN_DIR_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/process/windows/initializers/initializer_base.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <string>
|
||||
@@ -32,7 +33,6 @@ private:
|
||||
String s_;
|
||||
};
|
||||
|
||||
#if defined(_UNICODE) || defined(UNICODE)
|
||||
inline start_in_dir_<std::wstring> start_in_dir(const wchar_t *ws)
|
||||
{
|
||||
return start_in_dir_<std::wstring>(ws);
|
||||
@@ -47,7 +47,9 @@ inline start_in_dir_<std::wstring> start_in_dir(const boost::filesystem::path &p
|
||||
{
|
||||
return start_in_dir_<std::wstring>(p.wstring());
|
||||
}
|
||||
#else
|
||||
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
inline start_in_dir_<std::string> start_in_dir(const char *s)
|
||||
{
|
||||
return start_in_dir_<std::string>(s);
|
||||
@@ -62,7 +64,7 @@ inline start_in_dir_<std::string> start_in_dir(const boost::filesystem::path &p)
|
||||
{
|
||||
return start_in_dir_<std::string>(p.string());
|
||||
}
|
||||
#endif
|
||||
#endif //BOOST_NO_ANSI_APIS
|
||||
|
||||
}}}}
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <cstdlib>
|
||||
#include <boost/detail/winapi/shell_api.hpp>
|
||||
#include <boost/detail/winapi/shell.hpp>
|
||||
|
||||
|
||||
|
||||
namespace boost { namespace process { namespace windows {
|
||||
|
||||
#if defined(_UNICODE) || defined(UNICODE)
|
||||
inline std::wstring search_path(const std::wstring &filename,
|
||||
std::wstring path = L"")
|
||||
inline std::wstring search_path(
|
||||
const std::wstring &filename,
|
||||
std::wstring path = L"")
|
||||
{
|
||||
if (path.empty())
|
||||
{
|
||||
@@ -54,7 +54,7 @@ inline std::wstring search_path(const std::wstring &filename,
|
||||
boost::system::error_code ec;
|
||||
bool file = boost::filesystem::is_regular_file(p2, ec);
|
||||
if (!ec && file &&
|
||||
::boost::detail::winapi::SHGetFileInfoW(p2.c_str(), 0, 0, 0, ::boost::detail::winapi::shgfi_exetype))
|
||||
::boost::detail::winapi::sh_get_file_info(p2.c_str(), 0, 0, 0, ::boost::detail::winapi::SHGFI_EXETYPE_))
|
||||
{
|
||||
return p2.wstring();
|
||||
}
|
||||
@@ -62,9 +62,11 @@ inline std::wstring search_path(const std::wstring &filename,
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
#else
|
||||
inline std::string search_path(const std::string &filename,
|
||||
std::string path = "")
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
inline std::string search_path(
|
||||
const std::string &filename,
|
||||
std::string path = "")
|
||||
{
|
||||
if (path.empty())
|
||||
{
|
||||
@@ -91,7 +93,7 @@ inline std::string search_path(const std::string &filename,
|
||||
boost::system::error_code ec;
|
||||
bool file = boost::filesystem::is_regular_file(p2, ec);
|
||||
if (!ec && file &&
|
||||
::boost::detail::winapi::SHGetFileInfoA(p2.string().c_str(), 0, 0, 0, ::boost::detail::winapi::shgfi_exetype))
|
||||
::boost::detail::winapi::sh_get_file_info(p2.string().c_str(), 0, 0, 0, ::boost::detail::winapi::SHGFI_EXETYPE_))
|
||||
{
|
||||
return p2.string();
|
||||
}
|
||||
@@ -99,7 +101,7 @@ inline std::string search_path(const std::string &filename,
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
#endif //BOOST_NO_ANSI_APIS
|
||||
|
||||
}}}
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/GetSystemDirectory.hpp>
|
||||
#include <boost/detail/winapi/get_system_directory.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows {
|
||||
|
||||
inline boost::filesystem::path shell_path()
|
||||
{
|
||||
::boost::detail::winapi::TCHAR_ sysdir[260];
|
||||
unsigned int size = ::boost::detail::winapi::GetSystemDirectory(sysdir, sizeof(sysdir));
|
||||
::boost::detail::winapi::WCHAR_ sysdir[260];
|
||||
unsigned int size = ::boost::detail::winapi::get_system_directory(sysdir, sizeof(sysdir));
|
||||
if (!size)
|
||||
BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("GetSystemDirectory() failed");
|
||||
boost::filesystem::path p = sysdir;
|
||||
@@ -31,8 +31,8 @@ inline boost::filesystem::path shell_path()
|
||||
inline boost::filesystem::path shell_path(boost::system::error_code &ec)
|
||||
{
|
||||
|
||||
::boost::detail::winapi::TCHAR_ sysdir[260];
|
||||
unsigned int size = ::boost::detail::winapi::GetSystemDirectory(sysdir, sizeof(sysdir));
|
||||
::boost::detail::winapi::WCHAR_ sysdir[260];
|
||||
unsigned int size = ::boost::detail::winapi::get_system_directory(sysdir, sizeof(sysdir));
|
||||
boost::filesystem::path p;
|
||||
if (!size)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/process/config.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <cstdlib>
|
||||
#include <boost/detail/winapi/process_api.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/process/config.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/detail/winapi/synchronization.hpp>
|
||||
#include <boost/detail/winapi/process_api.hpp>
|
||||
#include <boost/detail/winapi/process.hpp>
|
||||
|
||||
namespace boost { namespace process { namespace windows {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user