From aea733727443b2eb77aa563f03352ce926822a63 Mon Sep 17 00:00:00 2001 From: klemens-morgenstern Date: Thu, 28 Jan 2016 21:03:33 +0100 Subject: [PATCH] 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) --- boost/detail/winapi/GetSystemDirectory.hpp | 58 -------- boost/detail/winapi/environment.hpp | 98 ------------- boost/detail/winapi/handle_info.hpp | 52 ------- boost/detail/winapi/named_pipe_api.hpp | 99 ------------- boost/detail/winapi/process_api.hpp | 65 --------- boost/detail/winapi/process_info.hpp | 107 -------------- boost/detail/winapi/shell_api.hpp | 133 ------------------ boost/detail/winapi/show_windows.hpp | 90 ------------ boost/detail/winapi/startf.hpp | 68 --------- boost/detail/winapi/tchar.hpp | 44 ------ boost/process/windows/child.hpp | 2 +- boost/process/windows/create_pipe.hpp | 2 +- boost/process/windows/executor.hpp | 23 ++- .../windows/initializers/bind_stderr.hpp | 8 +- .../windows/initializers/bind_stdin.hpp | 8 +- .../windows/initializers/bind_stdout.hpp | 8 +- .../windows/initializers/close_stderr.hpp | 6 +- .../windows/initializers/close_stdin.hpp | 6 +- .../windows/initializers/close_stdout.hpp | 6 +- .../windows/initializers/hide_console.hpp | 8 +- .../process/windows/initializers/run_exe.hpp | 5 +- .../windows/initializers/set_cmd_line.hpp | 6 +- .../process/windows/initializers/set_env.hpp | 29 ++-- .../windows/initializers/show_window.hpp | 4 +- .../windows/initializers/start_in_dir.hpp | 8 +- boost/process/windows/search_path.hpp | 22 +-- boost/process/windows/shell_path.hpp | 10 +- boost/process/windows/terminate.hpp | 2 +- boost/process/windows/wait_for_exit.hpp | 2 +- 29 files changed, 85 insertions(+), 894 deletions(-) delete mode 100644 boost/detail/winapi/GetSystemDirectory.hpp delete mode 100644 boost/detail/winapi/environment.hpp delete mode 100644 boost/detail/winapi/handle_info.hpp delete mode 100644 boost/detail/winapi/named_pipe_api.hpp delete mode 100644 boost/detail/winapi/process_api.hpp delete mode 100644 boost/detail/winapi/process_info.hpp delete mode 100644 boost/detail/winapi/shell_api.hpp delete mode 100644 boost/detail/winapi/show_windows.hpp delete mode 100644 boost/detail/winapi/startf.hpp delete mode 100644 boost/detail/winapi/tchar.hpp diff --git a/boost/detail/winapi/GetSystemDirectory.hpp b/boost/detail/winapi/GetSystemDirectory.hpp deleted file mode 100644 index a0335e77..00000000 --- a/boost/detail/winapi/GetSystemDirectory.hpp +++ /dev/null @@ -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 -#include - -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_ */ diff --git a/boost/detail/winapi/environment.hpp b/boost/detail/winapi/environment.hpp deleted file mode 100644 index 710d8b5a..00000000 --- a/boost/detail/winapi/environment.hpp +++ /dev/null @@ -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 - - -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_ */ diff --git a/boost/detail/winapi/handle_info.hpp b/boost/detail/winapi/handle_info.hpp deleted file mode 100644 index c30e0040..00000000 --- a/boost/detail/winapi/handle_info.hpp +++ /dev/null @@ -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 -#include -#include - - -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_ */ diff --git a/boost/detail/winapi/named_pipe_api.hpp b/boost/detail/winapi/named_pipe_api.hpp deleted file mode 100644 index 81138a23..00000000 --- a/boost/detail/winapi/named_pipe_api.hpp +++ /dev/null @@ -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 -#include -#include - - -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_ */ diff --git a/boost/detail/winapi/process_api.hpp b/boost/detail/winapi/process_api.hpp deleted file mode 100644 index 0bb3acd1..00000000 --- a/boost/detail/winapi/process_api.hpp +++ /dev/null @@ -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 -#include -#include -#include - -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_ */ diff --git a/boost/detail/winapi/process_info.hpp b/boost/detail/winapi/process_info.hpp deleted file mode 100644 index e852a39c..00000000 --- a/boost/detail/winapi/process_info.hpp +++ /dev/null @@ -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 -#include -#include - - -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_ */ diff --git a/boost/detail/winapi/shell_api.hpp b/boost/detail/winapi/shell_api.hpp deleted file mode 100644 index 51897816..00000000 --- a/boost/detail/winapi/shell_api.hpp +++ /dev/null @@ -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 -#include - - -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_ */ diff --git a/boost/detail/winapi/show_windows.hpp b/boost/detail/winapi/show_windows.hpp deleted file mode 100644 index c315d2b4..00000000 --- a/boost/detail/winapi/show_windows.hpp +++ /dev/null @@ -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 -#include - - -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_ */ diff --git a/boost/detail/winapi/startf.hpp b/boost/detail/winapi/startf.hpp deleted file mode 100644 index b7a3612d..00000000 --- a/boost/detail/winapi/startf.hpp +++ /dev/null @@ -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 -#include - - -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_ */ diff --git a/boost/detail/winapi/tchar.hpp b/boost/detail/winapi/tchar.hpp deleted file mode 100644 index 216c92bb..00000000 --- a/boost/detail/winapi/tchar.hpp +++ /dev/null @@ -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 - -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_ */ diff --git a/boost/process/windows/child.hpp b/boost/process/windows/child.hpp index b6499a9d..ad98b346 100644 --- a/boost/process/windows/child.hpp +++ b/boost/process/windows/child.hpp @@ -12,7 +12,7 @@ #include #include -#include > +#include namespace boost { namespace process { namespace windows { diff --git a/boost/process/windows/create_pipe.hpp b/boost/process/windows/create_pipe.hpp index 08c26cb4..6879211d 100644 --- a/boost/process/windows/create_pipe.hpp +++ b/boost/process/windows/create_pipe.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_PROCESS_WINDOWS_CREATE_PIPE_HPP #define BOOST_PROCESS_WINDOWS_CREATE_PIPE_HPP -#include +#include #include #include #include diff --git a/boost/process/windows/executor.hpp b/boost/process/windows/executor.hpp index 4cf9d797..61ebd3eb 100644 --- a/boost/process/windows/executor.hpp +++ b/boost/process/windows/executor.hpp @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include 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; }; diff --git a/boost/process/windows/initializers/bind_stderr.hpp b/boost/process/windows/initializers/bind_stderr.hpp index 52f6910b..0fa13555 100644 --- a/boost/process/windows/initializers/bind_stderr.hpp +++ b/boost/process/windows/initializers/bind_stderr.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include 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; } diff --git a/boost/process/windows/initializers/bind_stdin.hpp b/boost/process/windows/initializers/bind_stdin.hpp index 503e9f09..6f683120 100644 --- a/boost/process/windows/initializers/bind_stdin.hpp +++ b/boost/process/windows/initializers/bind_stdin.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include 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; } diff --git a/boost/process/windows/initializers/bind_stdout.hpp b/boost/process/windows/initializers/bind_stdout.hpp index 377f31a2..f3625a66 100644 --- a/boost/process/windows/initializers/bind_stdout.hpp +++ b/boost/process/windows/initializers/bind_stdout.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include 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; } diff --git a/boost/process/windows/initializers/close_stderr.hpp b/boost/process/windows/initializers/close_stderr.hpp index 4b49228c..c2f2371b 100644 --- a/boost/process/windows/initializers/close_stderr.hpp +++ b/boost/process/windows/initializers/close_stderr.hpp @@ -11,7 +11,7 @@ #define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_STDERR_HPP #include -#include +#include #include namespace boost { namespace process { namespace windows { namespace initializers { @@ -22,8 +22,8 @@ public: template 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_; } }; diff --git a/boost/process/windows/initializers/close_stdin.hpp b/boost/process/windows/initializers/close_stdin.hpp index 0b8479b2..f1445abe 100644 --- a/boost/process/windows/initializers/close_stdin.hpp +++ b/boost/process/windows/initializers/close_stdin.hpp @@ -11,7 +11,7 @@ #define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_STDIN_HPP #include -#include +#include #include namespace boost { namespace process { namespace windows { namespace initializers { @@ -22,8 +22,8 @@ public: template 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_; } }; diff --git a/boost/process/windows/initializers/close_stdout.hpp b/boost/process/windows/initializers/close_stdout.hpp index 78474139..c55fe920 100644 --- a/boost/process/windows/initializers/close_stdout.hpp +++ b/boost/process/windows/initializers/close_stdout.hpp @@ -11,7 +11,7 @@ #define BOOST_PROCESS_WINDOWS_INITIALIZERS_CLOSE_STDOUT_HPP #include -#include +#include #include namespace boost { namespace process { namespace windows { namespace initializers { @@ -22,8 +22,8 @@ public: template 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_; } }; diff --git a/boost/process/windows/initializers/hide_console.hpp b/boost/process/windows/initializers/hide_console.hpp index 0eb60f19..3ce0080b 100644 --- a/boost/process/windows/initializers/hide_console.hpp +++ b/boost/process/windows/initializers/hide_console.hpp @@ -11,8 +11,8 @@ #define BOOST_PROCESS_WINDOWS_INITIALIZERS_HIDE_CONSOLE_HPP #include -#include -#include +#include +#include namespace boost { namespace process { namespace windows { namespace initializers { @@ -22,8 +22,8 @@ public: template 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_; } }; diff --git a/boost/process/windows/initializers/run_exe.hpp b/boost/process/windows/initializers/run_exe.hpp index bfa2b790..d7c6245a 100644 --- a/boost/process/windows/initializers/run_exe.hpp +++ b/boost/process/windows/initializers/run_exe.hpp @@ -32,7 +32,6 @@ private: String s_; }; -#if defined(_UNICODE) || defined(UNICODE) inline run_exe_ run_exe(const wchar_t *ws) { return run_exe_(ws); @@ -47,7 +46,7 @@ inline run_exe_ run_exe(const boost::filesystem::path &p) { return run_exe_(p.wstring()); } -#else +#if !defined(BOOST_NO_ANSI_APIS) inline run_exe_ run_exe(const char *s) { return run_exe_(s); @@ -62,7 +61,7 @@ inline run_exe_ run_exe(const boost::filesystem::path &p) { return run_exe_(p.string()); } -#endif +#endif // BOOST_NO_ANSI_APIS }}}} diff --git a/boost/process/windows/initializers/set_cmd_line.hpp b/boost/process/windows/initializers/set_cmd_line.hpp index a3d9f6f7..b85f8c57 100644 --- a/boost/process/windows/initializers/set_cmd_line.hpp +++ b/boost/process/windows/initializers/set_cmd_line.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_SET_CMD_LINE_HPP #define BOOST_PROCESS_WINDOWS_INITIALIZERS_SET_CMD_LINE_HPP +#include #include #include #include @@ -41,7 +42,6 @@ private: boost::shared_array cmd_line_; }; -#if defined(_UNICODE) || defined(UNICODE) inline set_cmd_line_ set_cmd_line(const wchar_t *ws) { return set_cmd_line_(ws); @@ -51,7 +51,7 @@ inline set_cmd_line_ set_cmd_line(const std::wstring &ws) { return set_cmd_line_(ws); } -#else +#if !defined( BOOST_NO_ANSI_APIS ) inline set_cmd_line_ set_cmd_line(const char *s) { return set_cmd_line_(s); @@ -61,7 +61,7 @@ inline set_cmd_line_ set_cmd_line(const std::string &s) { return set_cmd_line_(s); } -#endif +#endif //BOOST_NO_ANSI_APIS }}}} diff --git a/boost/process/windows/initializers/set_env.hpp b/boost/process/windows/initializers/set_env.hpp index f3a5e461..b27e9c50 100644 --- a/boost/process/windows/initializers/set_env.hpp +++ b/boost/process/windows/initializers/set_env.hpp @@ -21,7 +21,7 @@ namespace boost { namespace process { namespace windows { namespace initializers { -template +template 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 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 env_; }; -#if defined(_UNICODE) || defined(UNICODE) template -set_env_ set_env(const Range &envs) +set_env_ set_env(const Range &envs) { - return set_env_(envs); + return set_env_(envs); } -#else -template -set_env_ set_env(const Range &envs) -{ - return set_env_(envs); -} -#endif }}}} diff --git a/boost/process/windows/initializers/show_window.hpp b/boost/process/windows/initializers/show_window.hpp index ff802f9a..3e89d6d4 100644 --- a/boost/process/windows/initializers/show_window.hpp +++ b/boost/process/windows/initializers/show_window.hpp @@ -11,7 +11,7 @@ #define BOOST_PROCESS_WINDOWS_INITIALIZERS_SHOW_WINDOW_HPP #include -#include +#include namespace boost { namespace process { namespace windows { namespace initializers { @@ -24,7 +24,7 @@ public: template 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_; } diff --git a/boost/process/windows/initializers/start_in_dir.hpp b/boost/process/windows/initializers/start_in_dir.hpp index 8dc952ab..2e3cc601 100644 --- a/boost/process/windows/initializers/start_in_dir.hpp +++ b/boost/process/windows/initializers/start_in_dir.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_PROCESS_WINDOWS_INITIALIZERS_START_IN_DIR_HPP #define BOOST_PROCESS_WINDOWS_INITIALIZERS_START_IN_DIR_HPP +#include #include #include #include @@ -32,7 +33,6 @@ private: String s_; }; -#if defined(_UNICODE) || defined(UNICODE) inline start_in_dir_ start_in_dir(const wchar_t *ws) { return start_in_dir_(ws); @@ -47,7 +47,9 @@ inline start_in_dir_ start_in_dir(const boost::filesystem::path &p { return start_in_dir_(p.wstring()); } -#else + + +#if !defined( BOOST_NO_ANSI_APIS ) inline start_in_dir_ start_in_dir(const char *s) { return start_in_dir_(s); @@ -62,7 +64,7 @@ inline start_in_dir_ start_in_dir(const boost::filesystem::path &p) { return start_in_dir_(p.string()); } -#endif +#endif //BOOST_NO_ANSI_APIS }}}} diff --git a/boost/process/windows/search_path.hpp b/boost/process/windows/search_path.hpp index fe518d25..3b403664 100644 --- a/boost/process/windows/search_path.hpp +++ b/boost/process/windows/search_path.hpp @@ -18,15 +18,15 @@ #include #include #include -#include +#include 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 }}} diff --git a/boost/process/windows/shell_path.hpp b/boost/process/windows/shell_path.hpp index d98da4aa..b8f8d4aa 100644 --- a/boost/process/windows/shell_path.hpp +++ b/boost/process/windows/shell_path.hpp @@ -14,14 +14,14 @@ #include #include #include -#include +#include 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) { diff --git a/boost/process/windows/terminate.hpp b/boost/process/windows/terminate.hpp index cc4a4621..433a5cb7 100644 --- a/boost/process/windows/terminate.hpp +++ b/boost/process/windows/terminate.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace boost { namespace process { namespace windows { diff --git a/boost/process/windows/wait_for_exit.hpp b/boost/process/windows/wait_for_exit.hpp index 33159273..e93e5506 100644 --- a/boost/process/windows/wait_for_exit.hpp +++ b/boost/process/windows/wait_for_exit.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace boost { namespace process { namespace windows {