stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// GetCurrentProcess.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||
|
||||
#include <boost/detail/winapi/get_current_process.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
|
||||
#pragma message "This header is deprecated, use boost/detail/winapi/get_current_process.hpp instead."
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma message("This header is deprecated, use boost/detail/winapi/get_current_process.hpp instead.")
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||
@@ -0,0 +1,25 @@
|
||||
// GetCurrentThread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||
|
||||
#include <boost/detail/winapi/get_current_thread.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
|
||||
#pragma message "This header is deprecated, use boost/detail/winapi/get_current_thread.hpp instead."
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma message("This header is deprecated, use boost/detail/winapi/get_current_thread.hpp instead.")
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||
@@ -0,0 +1,25 @@
|
||||
// GetLastError.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||
|
||||
#include <boost/detail/winapi/get_last_error.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
|
||||
#pragma message "This header is deprecated, use boost/detail/winapi/get_last_error.hpp instead."
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma message("This header is deprecated, use boost/detail/winapi/get_last_error.hpp instead.")
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||
@@ -0,0 +1,24 @@
|
||||
// GetProcessTimes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||
|
||||
#include <boost/detail/winapi/get_process_times.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
|
||||
#pragma message "This header is deprecated, use boost/detail/winapi/get_process_times.hpp instead."
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma message("This header is deprecated, use boost/detail/winapi/get_process_times.hpp instead.")
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||
@@ -0,0 +1,25 @@
|
||||
// GetThreadTimes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||
|
||||
#include <boost/detail/winapi/get_thread_times.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
|
||||
#pragma message "This header is deprecated, use boost/detail/winapi/get_thread_times.hpp instead."
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma message("This header is deprecated, use boost/detail/winapi/get_thread_times.hpp instead.")
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||
@@ -0,0 +1,84 @@
|
||||
// access_rights.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_ACCESS_RIGHTS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_ACCESS_RIGHTS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ DELETE_ = DELETE;
|
||||
const DWORD_ READ_CONTROL_ = READ_CONTROL;
|
||||
const DWORD_ WRITE_DAC_ = WRITE_DAC;
|
||||
const DWORD_ WRITE_OWNER_ = WRITE_OWNER;
|
||||
const DWORD_ SYNCHRONIZE_ = SYNCHRONIZE;
|
||||
|
||||
const DWORD_ STANDARD_RIGHTS_ALL_ = STANDARD_RIGHTS_ALL;
|
||||
const DWORD_ STANDARD_RIGHTS_EXECUTE_ = STANDARD_RIGHTS_EXECUTE;
|
||||
const DWORD_ STANDARD_RIGHTS_READ_ = STANDARD_RIGHTS_READ;
|
||||
const DWORD_ STANDARD_RIGHTS_REQUIRED_ = STANDARD_RIGHTS_REQUIRED;
|
||||
const DWORD_ STANDARD_RIGHTS_WRITE_ = STANDARD_RIGHTS_WRITE;
|
||||
|
||||
const DWORD_ SPECIFIC_RIGHTS_ALL_ = SPECIFIC_RIGHTS_ALL;
|
||||
|
||||
const DWORD_ ACCESS_SYSTEM_SECURITY_ = ACCESS_SYSTEM_SECURITY;
|
||||
|
||||
const DWORD_ MAXIMUM_ALLOWED_ = MAXIMUM_ALLOWED;
|
||||
|
||||
const DWORD_ GENERIC_ALL_ = GENERIC_ALL;
|
||||
const DWORD_ GENERIC_EXECUTE_ = GENERIC_EXECUTE;
|
||||
const DWORD_ GENERIC_WRITE_ = GENERIC_WRITE;
|
||||
const DWORD_ GENERIC_READ_ = GENERIC_READ;
|
||||
|
||||
typedef ::ACCESS_MASK ACCESS_MASK_;
|
||||
typedef ::PACCESS_MASK PACCESS_MASK_;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ DELETE_ = 0x00010000;
|
||||
const DWORD_ READ_CONTROL_ = 0x00020000;
|
||||
const DWORD_ WRITE_DAC_ = 0x00040000;
|
||||
const DWORD_ WRITE_OWNER_ = 0x00080000;
|
||||
const DWORD_ SYNCHRONIZE_ = 0x00100000;
|
||||
|
||||
const DWORD_ STANDARD_RIGHTS_ALL_ = 0x001F0000;
|
||||
const DWORD_ STANDARD_RIGHTS_EXECUTE_ = READ_CONTROL_;
|
||||
const DWORD_ STANDARD_RIGHTS_READ_ = READ_CONTROL_;
|
||||
const DWORD_ STANDARD_RIGHTS_REQUIRED_ = 0x000F0000;
|
||||
const DWORD_ STANDARD_RIGHTS_WRITE_ = READ_CONTROL_;
|
||||
|
||||
const DWORD_ SPECIFIC_RIGHTS_ALL_ = 0x0000FFFF;
|
||||
|
||||
const DWORD_ ACCESS_SYSTEM_SECURITY_ = 0x01000000;
|
||||
|
||||
const DWORD_ MAXIMUM_ALLOWED_ = 0x02000000;
|
||||
|
||||
const DWORD_ GENERIC_ALL_ = 0x10000000;
|
||||
const DWORD_ GENERIC_EXECUTE_ = 0x20000000;
|
||||
const DWORD_ GENERIC_WRITE_ = 0x40000000;
|
||||
const DWORD_ GENERIC_READ_ = 0x80000000;
|
||||
|
||||
typedef DWORD_ ACCESS_MASK_;
|
||||
typedef ACCESS_MASK_* PACCESS_MASK_;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_ACCESS_RIGHTS_HPP
|
||||
@@ -0,0 +1,47 @@
|
||||
// apc.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_APC_HPP
|
||||
#define BOOST_DETAIL_WINAPI_APC_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
typedef boost::detail::winapi::VOID_
|
||||
(NTAPI *PAPCFUNC)(boost::detail::winapi::ULONG_PTR_ Parameter);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
QueueUserAPC(
|
||||
PAPCFUNC pfnAPC,
|
||||
boost::detail::winapi::HANDLE_ hThread,
|
||||
boost::detail::winapi::ULONG_PTR_ dwData);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
typedef ::PAPCFUNC PAPCFUNC_;
|
||||
using ::QueueUserAPC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_APC_HPP
|
||||
@@ -0,0 +1,233 @@
|
||||
// basic_types.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||
|
||||
#include <cstdarg>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
# include <windows.h>
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
||||
# include <winerror.h>
|
||||
# ifdef UNDER_CE
|
||||
# ifndef WINAPI
|
||||
# ifndef _WIN32_WCE_EMULATION
|
||||
# define WINAPI __cdecl // Note this doesn't match the desktop definition
|
||||
# else
|
||||
# define WINAPI __stdcall
|
||||
# endif
|
||||
# endif
|
||||
// Windows CE defines a few functions as inline functions in kfuncs.h
|
||||
typedef int BOOL;
|
||||
typedef unsigned long DWORD;
|
||||
typedef void* HANDLE;
|
||||
# include <kfuncs.h>
|
||||
# else
|
||||
# ifndef WINAPI
|
||||
# define WINAPI __stdcall
|
||||
# endif
|
||||
# endif
|
||||
# ifndef NTAPI
|
||||
# define NTAPI __stdcall
|
||||
# endif
|
||||
#else
|
||||
# error "Win32 functions not available"
|
||||
#endif
|
||||
|
||||
#ifndef NO_STRICT
|
||||
#ifndef STRICT
|
||||
#define STRICT 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(STRICT)
|
||||
#define BOOST_DETAIL_WINAPI_DECLARE_HANDLE(x) struct x##__; typedef struct x##__ *x
|
||||
#else
|
||||
#define BOOST_DETAIL_WINAPI_DECLARE_HANDLE(x) typedef void* x
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
union _LARGE_INTEGER;
|
||||
struct _SECURITY_ATTRIBUTES;
|
||||
BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HINSTANCE);
|
||||
typedef HINSTANCE HMODULE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define BOOST_DETAIL_WINAPI_MAY_ALIAS __attribute__ ((__may_alias__))
|
||||
#else
|
||||
#define BOOST_DETAIL_WINAPI_MAY_ALIAS
|
||||
#endif
|
||||
|
||||
// MinGW64 gcc 4.8.2 fails to compile function declarations with boost::detail::winapi::VOID_ arguments even though
|
||||
// the typedef expands to void. In Windows SDK, VOID is a macro which unfolds to void. We use our own macro in such cases.
|
||||
#define BOOST_DETAIL_WINAPI_VOID void
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef ::BOOL BOOL_;
|
||||
typedef ::PBOOL PBOOL_;
|
||||
typedef ::LPBOOL LPBOOL_;
|
||||
typedef ::BOOLEAN BOOLEAN_;
|
||||
typedef ::PBOOLEAN PBOOLEAN_;
|
||||
typedef ::BYTE BYTE_;
|
||||
typedef ::PBYTE PBYTE_;
|
||||
typedef ::LPBYTE LPBYTE_;
|
||||
typedef ::WORD WORD_;
|
||||
typedef ::PWORD PWORD_;
|
||||
typedef ::LPWORD LPWORD_;
|
||||
typedef ::DWORD DWORD_;
|
||||
typedef ::PDWORD PDWORD_;
|
||||
typedef ::LPDWORD LPDWORD_;
|
||||
typedef ::HANDLE HANDLE_;
|
||||
typedef ::PHANDLE PHANDLE_;
|
||||
typedef ::SHORT SHORT_;
|
||||
typedef ::PSHORT PSHORT_;
|
||||
typedef ::USHORT USHORT_;
|
||||
typedef ::PUSHORT PUSHORT_;
|
||||
typedef ::INT INT_;
|
||||
typedef ::PINT PINT_;
|
||||
typedef ::LPINT LPINT_;
|
||||
typedef ::UINT UINT_;
|
||||
typedef ::PUINT PUINT_;
|
||||
typedef ::LONG LONG_;
|
||||
typedef ::PLONG PLONG_;
|
||||
typedef ::LPLONG LPLONG_;
|
||||
typedef ::ULONG ULONG_;
|
||||
typedef ::PULONG PULONG_;
|
||||
typedef ::LONGLONG LONGLONG_;
|
||||
typedef ::ULONGLONG ULONGLONG_;
|
||||
typedef ::INT_PTR INT_PTR_;
|
||||
typedef ::UINT_PTR UINT_PTR_;
|
||||
typedef ::LONG_PTR LONG_PTR_;
|
||||
typedef ::ULONG_PTR ULONG_PTR_;
|
||||
typedef ::DWORD_PTR DWORD_PTR_;
|
||||
typedef ::PDWORD_PTR PDWORD_PTR_;
|
||||
typedef ::SIZE_T SIZE_T_;
|
||||
typedef ::PSIZE_T PSIZE_T_;
|
||||
typedef ::SSIZE_T SSIZE_T_;
|
||||
typedef ::PSSIZE_T PSSIZE_T_;
|
||||
typedef VOID VOID_; // VOID is a macro
|
||||
typedef ::PVOID PVOID_;
|
||||
typedef ::LPVOID LPVOID_;
|
||||
typedef ::LPCVOID LPCVOID_;
|
||||
typedef ::CHAR CHAR_;
|
||||
typedef ::LPSTR LPSTR_;
|
||||
typedef ::LPCSTR LPCSTR_;
|
||||
typedef ::WCHAR WCHAR_;
|
||||
typedef ::LPWSTR LPWSTR_;
|
||||
typedef ::LPCWSTR LPCWSTR_;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef int BOOL_;
|
||||
typedef BOOL_* PBOOL_;
|
||||
typedef BOOL_* LPBOOL_;
|
||||
typedef unsigned char BYTE_;
|
||||
typedef BYTE_* PBYTE_;
|
||||
typedef BYTE_* LPBYTE_;
|
||||
typedef BYTE_ BOOLEAN_;
|
||||
typedef BOOLEAN_* PBOOLEAN_;
|
||||
typedef unsigned short WORD_;
|
||||
typedef WORD_* PWORD_;
|
||||
typedef WORD_* LPWORD_;
|
||||
typedef unsigned long DWORD_;
|
||||
typedef DWORD_* PDWORD_;
|
||||
typedef DWORD_* LPDWORD_;
|
||||
typedef void* HANDLE_;
|
||||
typedef void** PHANDLE_;
|
||||
|
||||
typedef short SHORT_;
|
||||
typedef SHORT_* PSHORT_;
|
||||
typedef unsigned short USHORT_;
|
||||
typedef USHORT_* PUSHORT_;
|
||||
typedef int INT_;
|
||||
typedef INT_* PINT_;
|
||||
typedef INT_* LPINT_;
|
||||
typedef unsigned int UINT_;
|
||||
typedef UINT_* PUINT_;
|
||||
typedef long LONG_;
|
||||
typedef LONG_* PLONG_;
|
||||
typedef LONG_* LPLONG_;
|
||||
typedef unsigned long ULONG_;
|
||||
typedef ULONG_* PULONG_;
|
||||
|
||||
typedef boost::int64_t LONGLONG_;
|
||||
typedef boost::uint64_t ULONGLONG_;
|
||||
|
||||
# ifdef _WIN64
|
||||
# if defined(__CYGWIN__)
|
||||
typedef long INT_PTR_;
|
||||
typedef unsigned long UINT_PTR_;
|
||||
typedef long LONG_PTR_;
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
# else
|
||||
typedef __int64 INT_PTR_;
|
||||
typedef unsigned __int64 UINT_PTR_;
|
||||
typedef __int64 LONG_PTR_;
|
||||
typedef unsigned __int64 ULONG_PTR_;
|
||||
# endif
|
||||
# else
|
||||
typedef int INT_PTR_;
|
||||
typedef unsigned int UINT_PTR_;
|
||||
typedef long LONG_PTR_;
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
# endif
|
||||
|
||||
typedef ULONG_PTR_ DWORD_PTR_, *PDWORD_PTR_;
|
||||
typedef ULONG_PTR_ SIZE_T_, *PSIZE_T_;
|
||||
typedef LONG_PTR_ SSIZE_T_, *PSSIZE_T_;
|
||||
|
||||
typedef void VOID_;
|
||||
typedef void *PVOID_;
|
||||
typedef void *LPVOID_;
|
||||
typedef const void *LPCVOID_;
|
||||
|
||||
typedef char CHAR_;
|
||||
typedef CHAR_ *LPSTR_;
|
||||
typedef const CHAR_ *LPCSTR_;
|
||||
|
||||
typedef wchar_t WCHAR_;
|
||||
typedef WCHAR_ *LPWSTR_;
|
||||
typedef const WCHAR_ *LPCWSTR_;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef ::HMODULE HMODULE_;
|
||||
|
||||
typedef union BOOST_DETAIL_WINAPI_MAY_ALIAS _LARGE_INTEGER {
|
||||
struct {
|
||||
DWORD_ LowPart;
|
||||
LONG_ HighPart;
|
||||
} u;
|
||||
LONGLONG_ QuadPart;
|
||||
} LARGE_INTEGER_, *PLARGE_INTEGER_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SECURITY_ATTRIBUTES {
|
||||
DWORD_ nLength;
|
||||
LPVOID_ lpSecurityDescriptor;
|
||||
BOOL_ bInheritHandle;
|
||||
} SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
// character_code_conversion.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_CHARACTER_CODE_CONVERSION_HPP
|
||||
#define BOOST_DETAIL_WINAPI_CHARACTER_CODE_CONVERSION_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
BOOST_SYMBOL_IMPORT int WINAPI
|
||||
MultiByteToWideChar(
|
||||
boost::detail::winapi::UINT_ CodePage,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPCSTR_ lpMultiByteStr,
|
||||
int cbMultiByte,
|
||||
boost::detail::winapi::LPWSTR_ lpWideCharStr,
|
||||
int cchWideChar);
|
||||
|
||||
BOOST_SYMBOL_IMPORT int WINAPI
|
||||
WideCharToMultiByte(
|
||||
boost::detail::winapi::UINT_ CodePage,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPCWSTR_ lpWideCharStr,
|
||||
int cchWideChar,
|
||||
boost::detail::winapi::LPSTR_ lpMultiByteStr,
|
||||
int cbMultiByte,
|
||||
boost::detail::winapi::LPCSTR_ lpDefaultChar,
|
||||
boost::detail::winapi::LPBOOL_ lpUsedDefaultChar);
|
||||
|
||||
} // extern "C"
|
||||
#endif // #if !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const UINT_ CP_ACP_ = CP_ACP;
|
||||
const UINT_ CP_OEMCP_ = CP_OEMCP;
|
||||
const UINT_ CP_MACCP_ = CP_MACCP;
|
||||
const UINT_ CP_THREAD_ACP_ = CP_THREAD_ACP;
|
||||
const UINT_ CP_SYMBOL_ = CP_SYMBOL;
|
||||
const UINT_ CP_UTF7_ = CP_UTF7;
|
||||
const UINT_ CP_UTF8_ = CP_UTF8;
|
||||
|
||||
const DWORD_ MB_PRECOMPOSED_ = MB_PRECOMPOSED;
|
||||
const DWORD_ MB_COMPOSITE_ = MB_COMPOSITE;
|
||||
const DWORD_ MB_USEGLYPHCHARS_ = MB_USEGLYPHCHARS;
|
||||
const DWORD_ MB_ERR_INVALID_CHARS_ = MB_ERR_INVALID_CHARS;
|
||||
|
||||
const DWORD_ WC_COMPOSITECHECK_ = WC_COMPOSITECHECK;
|
||||
const DWORD_ WC_DISCARDNS_ = WC_DISCARDNS;
|
||||
const DWORD_ WC_SEPCHARS_ = WC_SEPCHARS;
|
||||
const DWORD_ WC_DEFAULTCHAR_ = WC_DEFAULTCHAR;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
|
||||
const DWORD_ WC_NO_BEST_FIT_CHARS_ = WC_NO_BEST_FIT_CHARS;
|
||||
#endif
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const UINT_ CP_ACP_ = 0u;
|
||||
const UINT_ CP_OEMCP_ = 1u;
|
||||
const UINT_ CP_MACCP_ = 2u;
|
||||
const UINT_ CP_THREAD_ACP_ = 3u;
|
||||
const UINT_ CP_SYMBOL_ = 42u;
|
||||
const UINT_ CP_UTF7_ = 65000u;
|
||||
const UINT_ CP_UTF8_ = 65001u;
|
||||
|
||||
const DWORD_ MB_PRECOMPOSED_ = 0x00000001;
|
||||
const DWORD_ MB_COMPOSITE_ = 0x00000002;
|
||||
const DWORD_ MB_USEGLYPHCHARS_ = 0x00000004;
|
||||
const DWORD_ MB_ERR_INVALID_CHARS_ = 0x00000008;
|
||||
|
||||
const DWORD_ WC_COMPOSITECHECK_ = 0x00000200;
|
||||
const DWORD_ WC_DISCARDNS_ = 0x00000010;
|
||||
const DWORD_ WC_SEPCHARS_ = 0x00000020;
|
||||
const DWORD_ WC_DEFAULTCHAR_ = 0x00000040;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
|
||||
const DWORD_ WC_NO_BEST_FIT_CHARS_ = 0x00000400;
|
||||
#endif
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
// This constant is not present in MinGW
|
||||
const DWORD_ WC_ERR_INVALID_CHARS_ = 0x00000080;
|
||||
#endif
|
||||
|
||||
using ::MultiByteToWideChar;
|
||||
using ::WideCharToMultiByte;
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_CHARACTER_CODE_CONVERSION_HPP
|
||||
@@ -0,0 +1,123 @@
|
||||
// condition_variable.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_HPP
|
||||
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _RTL_CONDITION_VARIABLE;
|
||||
struct _RTL_CRITICAL_SECTION;
|
||||
struct _RTL_SRWLOCK;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
InitializeConditionVariable(::_RTL_CONDITION_VARIABLE* ConditionVariable);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
WakeConditionVariable(::_RTL_CONDITION_VARIABLE* ConditionVariable);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
WakeAllConditionVariable(::_RTL_CONDITION_VARIABLE* ConditionVariable);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SleepConditionVariableCS(
|
||||
::_RTL_CONDITION_VARIABLE* ConditionVariable,
|
||||
::_RTL_CRITICAL_SECTION* CriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwMilliseconds);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SleepConditionVariableSRW(
|
||||
::_RTL_CONDITION_VARIABLE* ConditionVariable,
|
||||
::_RTL_SRWLOCK* SRWLock,
|
||||
boost::detail::winapi::DWORD_ dwMilliseconds,
|
||||
boost::detail::winapi::ULONG_ Flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_CONDITION_VARIABLE {
|
||||
PVOID_ Ptr;
|
||||
} CONDITION_VARIABLE_, *PCONDITION_VARIABLE_;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT CONDITION_VARIABLE_INIT
|
||||
#else
|
||||
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE {0}
|
||||
#endif
|
||||
|
||||
struct _RTL_CRITICAL_SECTION;
|
||||
struct _RTL_SRWLOCK;
|
||||
|
||||
BOOST_FORCEINLINE VOID_ InitializeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable)
|
||||
{
|
||||
::InitializeConditionVariable(reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ WakeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable)
|
||||
{
|
||||
::WakeConditionVariable(reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ WakeAllConditionVariable(PCONDITION_VARIABLE_ ConditionVariable)
|
||||
{
|
||||
::WakeAllConditionVariable(reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ SleepConditionVariableCS(
|
||||
PCONDITION_VARIABLE_ ConditionVariable,
|
||||
_RTL_CRITICAL_SECTION* CriticalSection,
|
||||
DWORD_ dwMilliseconds)
|
||||
{
|
||||
return ::SleepConditionVariableCS(
|
||||
reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable),
|
||||
reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(CriticalSection),
|
||||
dwMilliseconds);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ SleepConditionVariableSRW(
|
||||
PCONDITION_VARIABLE_ ConditionVariable,
|
||||
_RTL_SRWLOCK* SRWLock,
|
||||
DWORD_ dwMilliseconds,
|
||||
ULONG_ Flags)
|
||||
{
|
||||
return ::SleepConditionVariableSRW(
|
||||
reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable),
|
||||
reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock),
|
||||
dwMilliseconds,
|
||||
Flags);
|
||||
}
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
const ULONG_ CONDITION_VARIABLE_LOCKMODE_SHARED_ = CONDITION_VARIABLE_LOCKMODE_SHARED;
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
const ULONG_ CONDITION_VARIABLE_LOCKMODE_SHARED_ = 0x00000001;
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const ULONG_ condition_variable_lockmode_shared = CONDITION_VARIABLE_LOCKMODE_SHARED_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_HPP
|
||||
@@ -0,0 +1,79 @@
|
||||
// config.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
#define BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
|
||||
#if defined __MINGW32__
|
||||
#include <_mingw.h>
|
||||
#endif
|
||||
|
||||
// BOOST_WINAPI_IS_MINGW indicates that the target Windows SDK is provided by MinGW (http://mingw.org/).
|
||||
// BOOST_WINAPI_IS_MINGW_W64 indicates that the target Windows SDK is provided by MinGW-w64 (http://mingw-w64.org).
|
||||
#if defined __MINGW32__
|
||||
#if defined __MINGW64_VERSION_MAJOR
|
||||
#define BOOST_WINAPI_IS_MINGW_W64
|
||||
#else
|
||||
#define BOOST_WINAPI_IS_MINGW
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// These constants reflect _WIN32_WINNT_* macros from sdkddkver.h
|
||||
// See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt
|
||||
#define BOOST_WINAPI_VERSION_NT4 0x0400
|
||||
#define BOOST_WINAPI_VERSION_WIN2K 0x0500
|
||||
#define BOOST_WINAPI_VERSION_WINXP 0x0501
|
||||
#define BOOST_WINAPI_VERSION_WS03 0x0502
|
||||
#define BOOST_WINAPI_VERSION_WIN6 0x0600
|
||||
#define BOOST_WINAPI_VERSION_VISTA 0x0600
|
||||
#define BOOST_WINAPI_VERSION_WS08 0x0600
|
||||
#define BOOST_WINAPI_VERSION_LONGHORN 0x0600
|
||||
#define BOOST_WINAPI_VERSION_WIN7 0x0601
|
||||
#define BOOST_WINAPI_VERSION_WIN8 0x0602
|
||||
#define BOOST_WINAPI_VERSION_WINBLUE 0x0603
|
||||
#define BOOST_WINAPI_VERSION_WINTHRESHOLD 0x0A00
|
||||
#define BOOST_WINAPI_VERSION_WIN10 0x0A00
|
||||
|
||||
#if !defined(BOOST_USE_WINAPI_VERSION)
|
||||
#if defined(_WIN32_WINNT)
|
||||
#define BOOST_USE_WINAPI_VERSION _WIN32_WINNT
|
||||
#elif defined(WINVER)
|
||||
#define BOOST_USE_WINAPI_VERSION WINVER
|
||||
#else
|
||||
// By default use Windows Vista API on compilers that support it and XP on the others
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1500) || defined(BOOST_WINAPI_IS_MINGW)
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP
|
||||
#else
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN6
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION2(x) x##0000
|
||||
#define BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION(x) BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION2(x)
|
||||
|
||||
#if defined(BOOST_USE_WINDOWS_H) || defined(BOOST_WINAPI_DEFINE_VERSION_MACROS)
|
||||
// We have to define the version macros so that windows.h provides the necessary symbols
|
||||
#if !defined(_WIN32_WINNT)
|
||||
#define _WIN32_WINNT BOOST_USE_WINAPI_VERSION
|
||||
#endif
|
||||
#if !defined(WINVER)
|
||||
#define WINVER BOOST_USE_WINAPI_VERSION
|
||||
#endif
|
||||
#if !defined(NTDDI_VERSION)
|
||||
#define NTDDI_VERSION BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION(BOOST_USE_WINAPI_VERSION)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
@@ -0,0 +1,184 @@
|
||||
// critical_section.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_CRITICAL_SECTION_HPP
|
||||
#define BOOST_DETAIL_WINAPI_CRITICAL_SECTION_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/detail/cast_ptr.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
extern "C" {
|
||||
#if !defined( BOOST_WINAPI_IS_MINGW )
|
||||
struct _RTL_CRITICAL_SECTION;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
InitializeCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
EnterCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
LeaveCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= 0x0403
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitializeCriticalSectionAndSpinCount(
|
||||
::_RTL_CRITICAL_SECTION* lpCriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwSpinCount);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitializeCriticalSectionEx(
|
||||
::_RTL_CRITICAL_SECTION* lpCriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwSpinCount,
|
||||
boost::detail::winapi::DWORD_ Flags);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
SetCriticalSectionSpinCount(
|
||||
::_RTL_CRITICAL_SECTION* lpCriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwSpinCount);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
TryEnterCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
DeleteCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
#else // defined( BOOST_WINAPI_IS_MINGW )
|
||||
|
||||
// MinGW uses a different name for the structure
|
||||
struct _CRITICAL_SECTION;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
InitializeCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
EnterCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
LeaveCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= 0x0403
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitializeCriticalSectionAndSpinCount(
|
||||
::_CRITICAL_SECTION* lpCriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwSpinCount);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitializeCriticalSectionEx(
|
||||
::_CRITICAL_SECTION* lpCriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwSpinCount,
|
||||
boost::detail::winapi::DWORD_ Flags);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
SetCriticalSectionSpinCount(
|
||||
::_CRITICAL_SECTION* lpCriticalSection,
|
||||
boost::detail::winapi::DWORD_ dwSpinCount);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
TryEnterCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
DeleteCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
|
||||
|
||||
#endif // defined( BOOST_WINAPI_IS_MINGW )
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
struct _RTL_CRITICAL_SECTION_DEBUG;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_CRITICAL_SECTION {
|
||||
_RTL_CRITICAL_SECTION_DEBUG* DebugInfo;
|
||||
LONG_ LockCount;
|
||||
LONG_ RecursionCount;
|
||||
HANDLE_ OwningThread;
|
||||
HANDLE_ LockSemaphore;
|
||||
ULONG_PTR_ SpinCount;
|
||||
} CRITICAL_SECTION_, *PCRITICAL_SECTION_;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
BOOST_FORCEINLINE VOID_ InitializeCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
|
||||
{
|
||||
::InitializeCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ EnterCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
|
||||
{
|
||||
::EnterCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ LeaveCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
|
||||
{
|
||||
::LeaveCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= 0x0403
|
||||
BOOST_FORCEINLINE BOOL_ InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION_* lpCriticalSection, DWORD_ dwSpinCount)
|
||||
{
|
||||
return ::InitializeCriticalSectionAndSpinCount(winapi::detail::cast_ptr(lpCriticalSection), dwSpinCount);
|
||||
}
|
||||
|
||||
// CRITICAL_SECTION_NO_DEBUG_INFO is defined for WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
const DWORD_ CRITICAL_SECTION_NO_DEBUG_INFO_ = 0x01000000;
|
||||
const DWORD_ CRITICAL_SECTION_FLAG_NO_DEBUG_INFO_ = CRITICAL_SECTION_NO_DEBUG_INFO_;
|
||||
const DWORD_ CRITICAL_SECTION_FLAG_DYNAMIC_SPIN_ = 0x02000000; // undocumented
|
||||
const DWORD_ CRITICAL_SECTION_FLAG_STATIC_INIT_ = 0x04000000; // undocumented
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE BOOL_ InitializeCriticalSectionEx(CRITICAL_SECTION_* lpCriticalSection, DWORD_ dwSpinCount, DWORD_ Flags)
|
||||
{
|
||||
return ::InitializeCriticalSectionEx(winapi::detail::cast_ptr(lpCriticalSection), dwSpinCount, Flags);
|
||||
}
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ SetCriticalSectionSpinCount(CRITICAL_SECTION_* lpCriticalSection, DWORD_ dwSpinCount)
|
||||
{
|
||||
return ::SetCriticalSectionSpinCount(winapi::detail::cast_ptr(lpCriticalSection), dwSpinCount);
|
||||
}
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= 0x0403
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
BOOST_FORCEINLINE BOOL_ TryEnterCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
|
||||
{
|
||||
return ::TryEnterCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
|
||||
}
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
|
||||
BOOST_FORCEINLINE VOID_ DeleteCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
|
||||
{
|
||||
::DeleteCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_CRITICAL_SECTION_HPP
|
||||
@@ -0,0 +1,230 @@
|
||||
// crypt.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2014 Antony Polukhin
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_CRYPT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_CRYPT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/detail/cast_ptr.hpp>
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
// This header is not always included as part of windows.h
|
||||
#include <wincrypt.h>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
namespace boost { namespace detail { namespace winapi {
|
||||
typedef ULONG_PTR_ HCRYPTPROV_;
|
||||
}}}
|
||||
|
||||
// Some versions of MinGW (including the latest ones) contain buggy declarations of CryptEnumProvidersA and CryptEnumProvidersW.
|
||||
// We cannot detect those broken versions, and we can't include the system header because it's incomplete.
|
||||
// So below we duplicate the broken declarations here and work around the problem with cast_ptr. These declarations
|
||||
// will have to be removed when MinGW is fixed.
|
||||
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
#if !defined( BOOST_WINAPI_IS_MINGW ) || !defined( UNICODE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptEnumProvidersA(
|
||||
boost::detail::winapi::DWORD_ dwIndex,
|
||||
boost::detail::winapi::DWORD_ *pdwReserved,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ *pdwProvType,
|
||||
boost::detail::winapi::LPSTR_ szProvName,
|
||||
boost::detail::winapi::DWORD_ *pcbProvName);
|
||||
#else
|
||||
// Broken declaration in MinGW
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptEnumProvidersA(
|
||||
boost::detail::winapi::DWORD_ dwIndex,
|
||||
boost::detail::winapi::DWORD_ *pdwReserved,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ *pdwProvType,
|
||||
boost::detail::winapi::LPWSTR_ szProvName,
|
||||
boost::detail::winapi::DWORD_ *pcbProvName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptAcquireContextA(
|
||||
boost::detail::winapi::HCRYPTPROV_ *phProv,
|
||||
boost::detail::winapi::LPCSTR_ pszContainer,
|
||||
boost::detail::winapi::LPCSTR_ pszProvider,
|
||||
boost::detail::winapi::DWORD_ dwProvType,
|
||||
boost::detail::winapi::DWORD_ dwFlags);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
#if !defined( BOOST_WINAPI_IS_MINGW ) || defined( UNICODE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptEnumProvidersW(
|
||||
boost::detail::winapi::DWORD_ dwIndex,
|
||||
boost::detail::winapi::DWORD_ *pdwReserved,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ *pdwProvType,
|
||||
boost::detail::winapi::LPWSTR_ szProvName,
|
||||
boost::detail::winapi::DWORD_ *pcbProvName);
|
||||
#else
|
||||
// Broken declaration in MinGW
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptEnumProvidersW(
|
||||
boost::detail::winapi::DWORD_ dwIndex,
|
||||
boost::detail::winapi::DWORD_ *pdwReserved,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ *pdwProvType,
|
||||
boost::detail::winapi::LPSTR_ szProvName,
|
||||
boost::detail::winapi::DWORD_ *pcbProvName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptAcquireContextW(
|
||||
boost::detail::winapi::HCRYPTPROV_ *phProv,
|
||||
boost::detail::winapi::LPCWSTR_ szContainer,
|
||||
boost::detail::winapi::LPCWSTR_ szProvider,
|
||||
boost::detail::winapi::DWORD_ dwProvType,
|
||||
boost::detail::winapi::DWORD_ dwFlags);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptGenRandom(
|
||||
boost::detail::winapi::HCRYPTPROV_ hProv,
|
||||
boost::detail::winapi::DWORD_ dwLen,
|
||||
boost::detail::winapi::BYTE_ *pbBuffer);
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER+0) >= 1500 &&\
|
||||
(\
|
||||
(defined(NTDDI_VERSION) && (NTDDI_VERSION+0) < BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION(BOOST_WINAPI_VERSION_WINXP)) ||\
|
||||
(!defined(NTDDI_VERSION) && BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP)\
|
||||
)
|
||||
// Standalone MS Windows SDK 6.0A and later provide a different declaration of CryptReleaseContext for Windows 2000 and older.
|
||||
// This is not the case for (a) MinGW and MinGW-w64 and (b) MSVC 7.1 and 8, which are shipped with their own Windows SDK.
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptReleaseContext(
|
||||
boost::detail::winapi::HCRYPTPROV_ hProv,
|
||||
boost::detail::winapi::ULONG_PTR_ dwFlags);
|
||||
#else
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CryptReleaseContext(
|
||||
boost::detail::winapi::HCRYPTPROV_ hProv,
|
||||
boost::detail::winapi::DWORD_ dwFlags);
|
||||
#endif
|
||||
}
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef ::HCRYPTPROV HCRYPTPROV_;
|
||||
|
||||
const DWORD_ PROV_RSA_FULL_ = PROV_RSA_FULL;
|
||||
|
||||
const DWORD_ CRYPT_VERIFYCONTEXT_ = CRYPT_VERIFYCONTEXT;
|
||||
const DWORD_ CRYPT_NEWKEYSET_ = CRYPT_NEWKEYSET;
|
||||
const DWORD_ CRYPT_DELETEKEYSET_ = CRYPT_DELETEKEYSET;
|
||||
const DWORD_ CRYPT_MACHINE_KEYSET_ = CRYPT_MACHINE_KEYSET;
|
||||
const DWORD_ CRYPT_SILENT_ = CRYPT_SILENT;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ PROV_RSA_FULL_ = 1;
|
||||
|
||||
const DWORD_ CRYPT_VERIFYCONTEXT_ = 0xF0000000;
|
||||
const DWORD_ CRYPT_NEWKEYSET_ = 8;
|
||||
const DWORD_ CRYPT_DELETEKEYSET_ = 16;
|
||||
const DWORD_ CRYPT_MACHINE_KEYSET_ = 32;
|
||||
const DWORD_ CRYPT_SILENT_ = 64;
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::CryptAcquireContextA;
|
||||
#endif
|
||||
using ::CryptAcquireContextW;
|
||||
using ::CryptGenRandom;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE BOOL_ CryptEnumProvidersA(
|
||||
DWORD_ dwIndex,
|
||||
DWORD_ *pdwReserved,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ *pdwProvType,
|
||||
LPSTR_ szProvName,
|
||||
DWORD_ *pcbProvName)
|
||||
{
|
||||
return ::CryptEnumProvidersA(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ crypt_enum_providers(
|
||||
DWORD_ dwIndex,
|
||||
DWORD_ *pdwReserved,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ *pdwProvType,
|
||||
LPSTR_ szProvName,
|
||||
DWORD_ *pcbProvName)
|
||||
{
|
||||
return ::CryptEnumProvidersA(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ crypt_acquire_context(
|
||||
HCRYPTPROV_ *phProv,
|
||||
LPCSTR_ pszContainer,
|
||||
LPCSTR_ pszProvider,
|
||||
DWORD_ dwProvType,
|
||||
DWORD_ dwFlags)
|
||||
{
|
||||
return ::CryptAcquireContextA(phProv, pszContainer, pszProvider, dwProvType, dwFlags);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ CryptEnumProvidersW(
|
||||
DWORD_ dwIndex,
|
||||
DWORD_ *pdwReserved,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ *pdwProvType,
|
||||
LPWSTR_ szProvName,
|
||||
DWORD_ *pcbProvName)
|
||||
{
|
||||
return ::CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ crypt_enum_providers(
|
||||
DWORD_ dwIndex,
|
||||
DWORD_ *pdwReserved,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ *pdwProvType,
|
||||
LPWSTR_ szProvName,
|
||||
DWORD_ *pcbProvName)
|
||||
{
|
||||
return ::CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ crypt_acquire_context(
|
||||
HCRYPTPROV_ *phProv,
|
||||
LPCWSTR_ szContainer,
|
||||
LPCWSTR_ szProvider,
|
||||
DWORD_ dwProvType,
|
||||
DWORD_ dwFlags)
|
||||
{
|
||||
return ::CryptAcquireContextW(phProv, szContainer, szProvider, dwProvType, dwFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ CryptReleaseContext(HCRYPTPROV_ hProv, DWORD_ dwFlags)
|
||||
{
|
||||
return ::CryptReleaseContext(hProv, dwFlags);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_CRYPT_HPP
|
||||
@@ -0,0 +1,171 @@
|
||||
// dbghelp.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2015 Klemens Morgenstern
|
||||
// Copyright 2016 Jorge Lodos
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_DBGHELP_HPP
|
||||
#define BOOST_DETAIL_WINAPI_DBGHELP_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
#if !defined( BOOST_WINAPI_IS_MINGW )
|
||||
#include <dbghelp.h>
|
||||
#else
|
||||
// In MinGW there is no dbghelp.h but an older imagehlp.h header defines some of the symbols from it.
|
||||
// Note that the user has to link with libimagehlp.a instead of libdbghelp.a for it to work.
|
||||
#include <imagehlp.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Some symbols declared below are not present in all versions of Windows SDK, MinGW and MinGW-w64.
|
||||
// dbghelp.h/imagehlp.h define the API_VERSION_NUMBER macro which we use to detect its version.
|
||||
// When the macro is not available we can only guess based on the compiler version or SDK type.
|
||||
#if defined(API_VERSION_NUMBER)
|
||||
#if API_VERSION_NUMBER >= 11
|
||||
// UnDecorateSymbolNameW available since Windows SDK 6.0A and MinGW-w64 (as of 2016-02-14)
|
||||
#define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
|
||||
#endif
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
// Until MSVC 9.0 Windows SDK was bundled in Visual Studio and didn't have UnDecorateSymbolNameW.
|
||||
// Supposedly, Windows SDK 6.0A was the first standalone one and it is used with MSVC 9.0.
|
||||
#define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
|
||||
#elif !defined(BOOST_WINAPI_IS_MINGW)
|
||||
// MinGW does not provide UnDecorateSymbolNameW (as of 2016-02-14)
|
||||
#define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
struct API_VERSION;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
UnDecorateSymbolName(
|
||||
boost::detail::winapi::LPCSTR_ DecoratedName,
|
||||
boost::detail::winapi::LPSTR_ UnDecoratedName,
|
||||
boost::detail::winapi::DWORD_ UndecoratedLength,
|
||||
boost::detail::winapi::DWORD_ Flags);
|
||||
|
||||
#if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
UnDecorateSymbolNameW(
|
||||
boost::detail::winapi::LPCWSTR_ DecoratedName,
|
||||
boost::detail::winapi::LPWSTR_ UnDecoratedName,
|
||||
boost::detail::winapi::DWORD_ UndecoratedLength,
|
||||
boost::detail::winapi::DWORD_ Flags);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT API_VERSION* WINAPI
|
||||
ImagehlpApiVersion(BOOST_DETAIL_WINAPI_VOID);
|
||||
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ UNDNAME_COMPLETE_ = UNDNAME_COMPLETE;
|
||||
const DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = UNDNAME_NO_LEADING_UNDERSCORES;
|
||||
const DWORD_ UNDNAME_NO_MS_KEYWORDS_ = UNDNAME_NO_MS_KEYWORDS;
|
||||
const DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = UNDNAME_NO_FUNCTION_RETURNS;
|
||||
const DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = UNDNAME_NO_ALLOCATION_MODEL;
|
||||
const DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = UNDNAME_NO_ALLOCATION_LANGUAGE;
|
||||
const DWORD_ UNDNAME_NO_MS_THISTYPE_ = UNDNAME_NO_MS_THISTYPE;
|
||||
const DWORD_ UNDNAME_NO_CV_THISTYPE_ = UNDNAME_NO_CV_THISTYPE;
|
||||
const DWORD_ UNDNAME_NO_THISTYPE_ = UNDNAME_NO_THISTYPE;
|
||||
const DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = UNDNAME_NO_ACCESS_SPECIFIERS;
|
||||
const DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = UNDNAME_NO_THROW_SIGNATURES;
|
||||
const DWORD_ UNDNAME_NO_MEMBER_TYPE_ = UNDNAME_NO_MEMBER_TYPE;
|
||||
const DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = UNDNAME_NO_RETURN_UDT_MODEL;
|
||||
const DWORD_ UNDNAME_32_BIT_DECODE_ = UNDNAME_32_BIT_DECODE;
|
||||
const DWORD_ UNDNAME_NAME_ONLY_ = UNDNAME_NAME_ONLY;
|
||||
const DWORD_ UNDNAME_NO_ARGUMENTS_ = UNDNAME_NO_ARGUMENTS;
|
||||
const DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = UNDNAME_NO_SPECIAL_SYMS;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ UNDNAME_COMPLETE_ = 0x00000000;
|
||||
const DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = 0x00000001;
|
||||
const DWORD_ UNDNAME_NO_MS_KEYWORDS_ = 0x00000002;
|
||||
const DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = 0x00000004;
|
||||
const DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = 0x00000008;
|
||||
const DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = 0x00000010;
|
||||
const DWORD_ UNDNAME_NO_MS_THISTYPE_ = 0x00000020;
|
||||
const DWORD_ UNDNAME_NO_CV_THISTYPE_ = 0x00000040;
|
||||
const DWORD_ UNDNAME_NO_THISTYPE_ = 0x00000060;
|
||||
const DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = 0x00000080;
|
||||
const DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = 0x00000100;
|
||||
const DWORD_ UNDNAME_NO_MEMBER_TYPE_ = 0x00000200;
|
||||
const DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = 0x00000400;
|
||||
const DWORD_ UNDNAME_32_BIT_DECODE_ = 0x00000800;
|
||||
const DWORD_ UNDNAME_NAME_ONLY_ = 0x00001000;
|
||||
const DWORD_ UNDNAME_NO_ARGUMENTS_ = 0x00002000;
|
||||
const DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = 0x00004000;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
using ::UnDecorateSymbolName;
|
||||
#if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
|
||||
using ::UnDecorateSymbolNameW;
|
||||
#endif
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS API_VERSION {
|
||||
USHORT_ MajorVersion;
|
||||
USHORT_ MinorVersion;
|
||||
USHORT_ Revision;
|
||||
USHORT_ Reserved;
|
||||
} API_VERSION_, *LPAPI_VERSION_;
|
||||
|
||||
BOOST_FORCEINLINE LPAPI_VERSION_ ImagehlpApiVersion()
|
||||
{
|
||||
return reinterpret_cast<LPAPI_VERSION_>(::ImagehlpApiVersion());
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
|
||||
LPCSTR_ DecoratedName,
|
||||
LPSTR_ UnDecoratedName,
|
||||
DWORD_ UndecoratedLength,
|
||||
DWORD_ Flags)
|
||||
{
|
||||
return ::UnDecorateSymbolName(
|
||||
DecoratedName,
|
||||
UnDecoratedName,
|
||||
UndecoratedLength,
|
||||
Flags);
|
||||
}
|
||||
|
||||
#if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
|
||||
LPCWSTR_ DecoratedName,
|
||||
LPWSTR_ UnDecoratedName,
|
||||
DWORD_ UndecoratedLength,
|
||||
DWORD_ Flags)
|
||||
{
|
||||
return ::UnDecorateSymbolNameW(
|
||||
DecoratedName,
|
||||
UnDecoratedName,
|
||||
UndecoratedLength,
|
||||
Flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_DBGHELP_HPP
|
||||
@@ -0,0 +1,40 @@
|
||||
// cast_ptr.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
|
||||
#define BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
namespace detail {
|
||||
|
||||
//! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
|
||||
class cast_ptr
|
||||
{
|
||||
private:
|
||||
const void* m_p;
|
||||
|
||||
public:
|
||||
explicit BOOST_FORCEINLINE cast_ptr(const void* p) BOOST_NOEXCEPT : m_p(p) {}
|
||||
template< typename T >
|
||||
BOOST_FORCEINLINE operator T* () const BOOST_NOEXCEPT { return (T*)m_p; }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
|
||||
@@ -0,0 +1,94 @@
|
||||
// directory_management.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/get_system_directory.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CreateDirectoryA(boost::detail::winapi::LPCSTR_, ::_SECURITY_ATTRIBUTES*);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetTempPathA(boost::detail::winapi::DWORD_ length, boost::detail::winapi::LPSTR_ buffer);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
RemoveDirectoryA(boost::detail::winapi::LPCSTR_);
|
||||
#endif
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CreateDirectoryW(boost::detail::winapi::LPCWSTR_, ::_SECURITY_ATTRIBUTES*);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetTempPathW(boost::detail::winapi::DWORD_ length, boost::detail::winapi::LPWSTR_ buffer);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
RemoveDirectoryW(boost::detail::winapi::LPCWSTR_);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::GetTempPathA;
|
||||
using ::RemoveDirectoryA;
|
||||
#endif
|
||||
using ::GetTempPathW;
|
||||
using ::RemoveDirectoryW;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE BOOL_ CreateDirectoryA(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
|
||||
{
|
||||
return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ CreateDirectoryW(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
|
||||
{
|
||||
return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE BOOL_ create_directory(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
|
||||
{
|
||||
return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
|
||||
}
|
||||
BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPSTR_ buffer)
|
||||
{
|
||||
return ::GetTempPathA(length, buffer);
|
||||
}
|
||||
BOOST_FORCEINLINE BOOL_ remove_directory(LPCSTR_ pPathName)
|
||||
{
|
||||
return ::RemoveDirectoryA(pPathName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ create_directory(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
|
||||
{
|
||||
return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
|
||||
}
|
||||
BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPWSTR_ buffer)
|
||||
{
|
||||
return ::GetTempPathW(length, buffer);
|
||||
}
|
||||
BOOST_FORCEINLINE BOOL_ remove_directory(LPCWSTR_ pPathName)
|
||||
{
|
||||
return ::RemoveDirectoryW(pPathName);
|
||||
}
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||
@@ -0,0 +1,221 @@
|
||||
// dll.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2014 Renato Tegon Forti, Antony Polukhin
|
||||
// Copyright 2015 Andrey Semashev
|
||||
// Copyright 2015 Antony Polukhin
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_DLL_HPP
|
||||
#define BOOST_DETAIL_WINAPI_DLL_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
namespace boost { namespace detail { namespace winapi {
|
||||
#ifdef _WIN64
|
||||
typedef INT_PTR_ (WINAPI *FARPROC_)();
|
||||
typedef INT_PTR_ (WINAPI *NEARPROC_)();
|
||||
typedef INT_PTR_ (WINAPI *PROC_)();
|
||||
#else
|
||||
typedef int (WINAPI *FARPROC_)();
|
||||
typedef int (WINAPI *NEARPROC_)();
|
||||
typedef int (WINAPI *PROC_)();
|
||||
#endif // _WIN64
|
||||
}}} // namespace boost::detail::winapi
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
|
||||
LoadLibraryA(boost::detail::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
|
||||
LoadLibraryExA(
|
||||
boost::detail::winapi::LPCSTR_ lpFileName,
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::DWORD_ dwFlags
|
||||
);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
|
||||
GetModuleHandleA(boost::detail::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetModuleFileNameA(
|
||||
boost::detail::winapi::HMODULE_ hModule,
|
||||
boost::detail::winapi::LPSTR_ lpFilename,
|
||||
boost::detail::winapi::DWORD_ nSize
|
||||
);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
|
||||
LoadLibraryW(boost::detail::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
|
||||
LoadLibraryExW(
|
||||
boost::detail::winapi::LPCWSTR_ lpFileName,
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::DWORD_ dwFlags
|
||||
);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
|
||||
GetModuleHandleW(boost::detail::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetModuleFileNameW(
|
||||
boost::detail::winapi::HMODULE_ hModule,
|
||||
boost::detail::winapi::LPWSTR_ lpFilename,
|
||||
boost::detail::winapi::DWORD_ nSize
|
||||
);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FreeLibrary(boost::detail::winapi::HMODULE_ hModule);
|
||||
|
||||
#if !defined( UNDER_CE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::FARPROC_ WINAPI
|
||||
GetProcAddress(boost::detail::winapi::HMODULE_ hModule, boost::detail::winapi::LPCSTR_ lpProcName);
|
||||
#else
|
||||
// On Windows CE there are two functions: GetProcAddressA (since Windows CE 3.0) and GetProcAddressW.
|
||||
// GetProcAddress is a macro that is _always_ defined to GetProcAddressW.
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::FARPROC_ WINAPI
|
||||
GetProcAddressA(boost::detail::winapi::HMODULE_ hModule, boost::detail::winapi::LPCSTR_ lpProcName);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::FARPROC_ WINAPI
|
||||
GetProcAddressW(boost::detail::winapi::HMODULE_ hModule, boost::detail::winapi::LPCWSTR_ lpProcName);
|
||||
#endif
|
||||
|
||||
struct _MEMORY_BASIC_INFORMATION;
|
||||
|
||||
#if !defined( BOOST_WINAPI_IS_MINGW )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::SIZE_T_ WINAPI
|
||||
VirtualQuery(
|
||||
boost::detail::winapi::LPCVOID_ lpAddress,
|
||||
::_MEMORY_BASIC_INFORMATION* lpBuffer,
|
||||
boost::detail::winapi::ULONG_PTR_ dwLength
|
||||
);
|
||||
#else // !defined( BOOST_WINAPI_IS_MINGW )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
VirtualQuery(
|
||||
boost::detail::winapi::LPCVOID_ lpAddress,
|
||||
::_MEMORY_BASIC_INFORMATION* lpBuffer,
|
||||
boost::detail::winapi::DWORD_ dwLength
|
||||
);
|
||||
#endif // !defined( BOOST_WINAPI_IS_MINGW )
|
||||
} // extern "C"
|
||||
#endif // #if !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS MEMORY_BASIC_INFORMATION_ {
|
||||
PVOID_ BaseAddress;
|
||||
PVOID_ AllocationBase;
|
||||
DWORD_ AllocationProtect;
|
||||
SIZE_T_ RegionSize;
|
||||
DWORD_ State;
|
||||
DWORD_ Protect;
|
||||
DWORD_ Type;
|
||||
} *PMEMORY_BASIC_INFORMATION_;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::FARPROC FARPROC_;
|
||||
typedef ::NEARPROC NEARPROC_;
|
||||
typedef ::PROC PROC_;
|
||||
|
||||
const DWORD_ DONT_RESOLVE_DLL_REFERENCES_ = DONT_RESOLVE_DLL_REFERENCES;
|
||||
const DWORD_ LOAD_WITH_ALTERED_SEARCH_PATH_ = LOAD_WITH_ALTERED_SEARCH_PATH;
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
const DWORD_ DONT_RESOLVE_DLL_REFERENCES_ = 0x00000001;
|
||||
const DWORD_ LOAD_WITH_ALTERED_SEARCH_PATH_ = 0x00000008;
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// This one is not defined by MinGW
|
||||
const DWORD_ LOAD_IGNORE_CODE_AUTHZ_LEVEL_ = 0x00000010;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::LoadLibraryA;
|
||||
using ::LoadLibraryExA;
|
||||
using ::GetModuleHandleA;
|
||||
using ::GetModuleFileNameA;
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::LoadLibraryW;
|
||||
using ::LoadLibraryExW;
|
||||
using ::GetModuleHandleW;
|
||||
using ::GetModuleFileNameW;
|
||||
using ::FreeLibrary;
|
||||
|
||||
#if !defined( UNDER_CE )
|
||||
// For backward compatibility, don't use directly. Use get_proc_address instead.
|
||||
using ::GetProcAddress;
|
||||
#else
|
||||
using ::GetProcAddressA;
|
||||
using ::GetProcAddressW;
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE FARPROC_ get_proc_address(HMODULE_ hModule, LPCSTR_ lpProcName)
|
||||
{
|
||||
#if !defined( UNDER_CE )
|
||||
return ::GetProcAddress(hModule, lpProcName);
|
||||
#else
|
||||
return ::GetProcAddressA(hModule, lpProcName);
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE SIZE_T_ VirtualQuery(LPCVOID_ lpAddress, MEMORY_BASIC_INFORMATION_* lpBuffer, ULONG_PTR_ dwLength)
|
||||
{
|
||||
return ::VirtualQuery(lpAddress, reinterpret_cast< ::_MEMORY_BASIC_INFORMATION* >(lpBuffer), dwLength);
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HMODULE_ load_library(LPCSTR_ lpFileName)
|
||||
{
|
||||
return ::LoadLibraryA(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HMODULE_ load_library_ex(LPCSTR_ lpFileName, HANDLE_ hFile, DWORD_ dwFlags)
|
||||
{
|
||||
return ::LoadLibraryExA(lpFileName, hFile, dwFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HMODULE_ get_module_handle(LPCSTR_ lpFileName)
|
||||
{
|
||||
return ::GetModuleHandleA(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_module_file_name(HMODULE_ hModule, LPSTR_ lpFilename, DWORD_ nSize)
|
||||
{
|
||||
return ::GetModuleFileNameA(hModule, lpFilename, nSize);
|
||||
}
|
||||
#endif // #if !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_FORCEINLINE HMODULE_ load_library(LPCWSTR_ lpFileName)
|
||||
{
|
||||
return ::LoadLibraryW(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HMODULE_ load_library_ex(LPCWSTR_ lpFileName, HANDLE_ hFile, DWORD_ dwFlags)
|
||||
{
|
||||
return ::LoadLibraryExW(lpFileName, hFile, dwFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HMODULE_ get_module_handle(LPCWSTR_ lpFileName)
|
||||
{
|
||||
return ::GetModuleHandleW(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_module_file_name(HMODULE_ hModule, LPWSTR_ lpFilename, DWORD_ nSize)
|
||||
{
|
||||
return ::GetModuleFileNameW(hModule, lpFilename, nSize);
|
||||
}
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_DLL_HPP
|
||||
@@ -0,0 +1,118 @@
|
||||
// environment.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPSTR_ WINAPI GetEnvironmentStringsA();
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI FreeEnvironmentStringsA(boost::detail::winapi::LPSTR_);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetEnvironmentVariableA(
|
||||
boost::detail::winapi::LPCSTR_ lpName,
|
||||
boost::detail::winapi::LPSTR_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nSize
|
||||
);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SetEnvironmentVariableA(
|
||||
boost::detail::winapi::LPCSTR_ lpName,
|
||||
boost::detail::winapi::LPCSTR_ lpValue
|
||||
);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPWSTR_ WINAPI GetEnvironmentStringsW();
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI FreeEnvironmentStringsW(boost::detail::winapi::LPWSTR_);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetEnvironmentVariableW(
|
||||
boost::detail::winapi::LPCWSTR_ lpName,
|
||||
boost::detail::winapi::LPWSTR_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nSize
|
||||
);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SetEnvironmentVariableW(
|
||||
boost::detail::winapi::LPCWSTR_ lpName,
|
||||
boost::detail::winapi::LPCWSTR_ lpValue
|
||||
);
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost { namespace detail { namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::GetEnvironmentStringsA;
|
||||
using ::FreeEnvironmentStringsA;
|
||||
using ::GetEnvironmentVariableA;
|
||||
using ::SetEnvironmentVariableA;
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
using ::GetEnvironmentStringsW;
|
||||
using ::FreeEnvironmentStringsW;
|
||||
using ::GetEnvironmentVariableW;
|
||||
using ::SetEnvironmentVariableW;
|
||||
|
||||
template< typename Char >
|
||||
Char* get_environment_strings();
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
template< >
|
||||
BOOST_FORCEINLINE char* get_environment_strings< char >()
|
||||
{
|
||||
return GetEnvironmentStringsA();
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ free_environment_strings(boost::detail::winapi::LPSTR_ p)
|
||||
{
|
||||
return FreeEnvironmentStringsA(p);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_environment_variable(LPCSTR_ name, LPSTR_ buffer, DWORD_ size)
|
||||
{
|
||||
return GetEnvironmentVariableA(name, buffer, size);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ set_environment_variable(LPCSTR_ name, LPCSTR_ value)
|
||||
{
|
||||
return SetEnvironmentVariableA(name, value);
|
||||
}
|
||||
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
template< >
|
||||
BOOST_FORCEINLINE wchar_t* get_environment_strings< wchar_t >()
|
||||
{
|
||||
return GetEnvironmentStringsW();
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ free_environment_strings(boost::detail::winapi::LPWSTR_ p)
|
||||
{
|
||||
return FreeEnvironmentStringsW(p);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_environment_variable(LPCWSTR_ name, LPWSTR_ buffer, DWORD_ size)
|
||||
{
|
||||
return GetEnvironmentVariableW(name, buffer, size);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ set_environment_variable(LPCWSTR_ name, LPCWSTR_ value)
|
||||
{
|
||||
return SetEnvironmentVariableW(name, value);
|
||||
}
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,143 @@
|
||||
// error_handling.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
// Copyright 2016 Jorge Lodos
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||
#define BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/get_last_error.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
FormatMessageA(
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPCVOID_ lpSource,
|
||||
boost::detail::winapi::DWORD_ dwMessageId,
|
||||
boost::detail::winapi::DWORD_ dwLanguageId,
|
||||
boost::detail::winapi::LPSTR_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nSize,
|
||||
va_list *Arguments);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
FormatMessageW(
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPCVOID_ lpSource,
|
||||
boost::detail::winapi::DWORD_ dwMessageId,
|
||||
boost::detail::winapi::DWORD_ dwLanguageId,
|
||||
boost::detail::winapi::LPWSTR_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nSize,
|
||||
va_list *Arguments);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::UINT_ WINAPI
|
||||
SetErrorMode(boost::detail::winapi::UINT_ uMode);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER;
|
||||
const DWORD_ FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS;
|
||||
const DWORD_ FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING;
|
||||
const DWORD_ FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE;
|
||||
const DWORD_ FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM;
|
||||
const DWORD_ FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY;
|
||||
const DWORD_ FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK;
|
||||
|
||||
const WORD_ LANG_NEUTRAL_= LANG_NEUTRAL;
|
||||
const WORD_ LANG_INVARIANT_= LANG_INVARIANT;
|
||||
|
||||
const WORD_ SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default
|
||||
|
||||
BOOST_FORCEINLINE WORD_ MAKELANGID_(WORD_ p, WORD_ s)
|
||||
{
|
||||
return MAKELANGID(p,s);
|
||||
}
|
||||
|
||||
const DWORD_ SEM_FAILCRITICALERRORS_ = SEM_FAILCRITICALERRORS;
|
||||
const DWORD_ SEM_NOGPFAULTERRORBOX_ = SEM_NOGPFAULTERRORBOX;
|
||||
const DWORD_ SEM_NOALIGNMENTFAULTEXCEPT_ = SEM_NOALIGNMENTFAULTEXCEPT;
|
||||
const DWORD_ SEM_NOOPENFILEERRORBOX_ = SEM_NOOPENFILEERRORBOX;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100;
|
||||
const DWORD_ FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200;
|
||||
const DWORD_ FORMAT_MESSAGE_FROM_STRING_= 0x00000400;
|
||||
const DWORD_ FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800;
|
||||
const DWORD_ FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000;
|
||||
const DWORD_ FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000;
|
||||
const DWORD_ FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF;
|
||||
|
||||
const WORD_ LANG_NEUTRAL_= 0x00;
|
||||
const WORD_ LANG_INVARIANT_= 0x7f;
|
||||
|
||||
const WORD_ SUBLANG_DEFAULT_= 0x01; // user default
|
||||
|
||||
BOOST_FORCEINLINE WORD_ MAKELANGID_(WORD_ p, WORD_ s)
|
||||
{
|
||||
return (WORD_)((((WORD_)(s)) << 10) | (WORD_)(p));
|
||||
}
|
||||
|
||||
const DWORD_ SEM_FAILCRITICALERRORS_ = 0x0001;
|
||||
const DWORD_ SEM_NOGPFAULTERRORBOX_ = 0x0002;
|
||||
const DWORD_ SEM_NOALIGNMENTFAULTEXCEPT_ = 0x0004;
|
||||
const DWORD_ SEM_NOOPENFILEERRORBOX_ = 0x8000;
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::FormatMessageA;
|
||||
#endif
|
||||
using ::FormatMessageW;
|
||||
using ::SetErrorMode;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE DWORD_ format_message(
|
||||
DWORD_ dwFlags,
|
||||
LPCVOID_ lpSource,
|
||||
DWORD_ dwMessageId,
|
||||
DWORD_ dwLanguageId,
|
||||
LPSTR_ lpBuffer,
|
||||
DWORD_ nSize,
|
||||
va_list *Arguments)
|
||||
{
|
||||
return ::FormatMessageA(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ format_message(
|
||||
DWORD_ dwFlags,
|
||||
LPCVOID_ lpSource,
|
||||
DWORD_ dwMessageId,
|
||||
DWORD_ dwLanguageId,
|
||||
LPWSTR_ lpBuffer,
|
||||
DWORD_ nSize,
|
||||
va_list *Arguments)
|
||||
{
|
||||
return ::FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||
@@ -0,0 +1,190 @@
|
||||
// event.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_EVENT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_EVENT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateEventA(
|
||||
::_SECURITY_ATTRIBUTES* lpEventAttributes,
|
||||
boost::detail::winapi::BOOL_ bManualReset,
|
||||
boost::detail::winapi::BOOL_ bInitialState,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateEventExA(
|
||||
::_SECURITY_ATTRIBUTES *lpEventAttributes,
|
||||
boost::detail::winapi::LPCSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenEventA(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateEventW(
|
||||
::_SECURITY_ATTRIBUTES* lpEventAttributes,
|
||||
boost::detail::winapi::BOOL_ bManualReset,
|
||||
boost::detail::winapi::BOOL_ bInitialState,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateEventExW(
|
||||
::_SECURITY_ATTRIBUTES *lpEventAttributes,
|
||||
boost::detail::winapi::LPCWSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenEventW(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
// Windows CE define SetEvent/ResetEvent as inline functions in kfuncs.h
|
||||
#if !defined( UNDER_CE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetEvent(boost::detail::winapi::HANDLE_ hEvent);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
ResetEvent(boost::detail::winapi::HANDLE_ hEvent);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenEventA;
|
||||
#endif
|
||||
using ::OpenEventW;
|
||||
using ::SetEvent;
|
||||
using ::ResetEvent;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ EVENT_ALL_ACCESS_ = EVENT_ALL_ACCESS;
|
||||
const DWORD_ EVENT_MODIFY_STATE_ = EVENT_MODIFY_STATE;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ CREATE_EVENT_INITIAL_SET_ = CREATE_EVENT_INITIAL_SET;
|
||||
const DWORD_ CREATE_EVENT_MANUAL_RESET_ = CREATE_EVENT_MANUAL_RESET;
|
||||
#endif
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ EVENT_ALL_ACCESS_ = 0x001F0003;
|
||||
const DWORD_ EVENT_MODIFY_STATE_ = 0x00000002;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ CREATE_EVENT_INITIAL_SET_ = 0x00000002;
|
||||
const DWORD_ CREATE_EVENT_MANUAL_RESET_ = 0x00000001;
|
||||
#endif
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// Undocumented and not present in Windows SDK. Enables NtQueryEvent.
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FEvent%2FNtQueryEvent.html
|
||||
const DWORD_ EVENT_QUERY_STATE_ = 0x00000001;
|
||||
|
||||
const DWORD_ event_all_access = EVENT_ALL_ACCESS_;
|
||||
const DWORD_ event_modify_state = EVENT_MODIFY_STATE_;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ create_event_initial_set = CREATE_EVENT_INITIAL_SET_;
|
||||
const DWORD_ create_event_manual_reset = CREATE_EVENT_MANUAL_RESET_;
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateEventA(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCSTR_ lpName)
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ flags = (bManualReset ? create_event_manual_reset : 0u) | (bInitialState ? create_event_initial_set : 0u);
|
||||
return ::CreateEventExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, flags, event_all_access);
|
||||
#else
|
||||
return ::CreateEventA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), bManualReset, bInitialState, lpName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE HANDLE_ CreateEventExA(SECURITY_ATTRIBUTES_* lpEventAttributes, LPCSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
|
||||
{
|
||||
return ::CreateEventExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, dwFlags, dwDesiredAccess);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateEventW(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCWSTR_ lpName)
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ flags = (bManualReset ? create_event_manual_reset : 0u) | (bInitialState ? create_event_initial_set : 0u);
|
||||
return ::CreateEventExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, flags, event_all_access);
|
||||
#else
|
||||
return ::CreateEventW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), bManualReset, bInitialState, lpName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE HANDLE_ CreateEventExW(SECURITY_ATTRIBUTES_* lpEventAttributes, LPCWSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
|
||||
{
|
||||
return ::CreateEventExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, dwFlags, dwDesiredAccess);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ create_event(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCSTR_ lpName)
|
||||
{
|
||||
return winapi::CreateEventA(lpEventAttributes, bManualReset, bInitialState, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_event(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenEventA(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_event(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCWSTR_ lpName)
|
||||
{
|
||||
return winapi::CreateEventW(lpEventAttributes, bManualReset, bInitialState, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_event(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::OpenEventW(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_event(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState)
|
||||
{
|
||||
return winapi::CreateEventW(lpEventAttributes, bManualReset, bInitialState, 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_EVENT_HPP
|
||||
@@ -0,0 +1,535 @@
|
||||
// file_management.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
// Copyright 2016 Jorge Lodos
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/limits.hpp>
|
||||
#include <boost/detail/winapi/time.hpp>
|
||||
#include <boost/detail/winapi/overlapped.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateFileA(
|
||||
boost::detail::winapi::LPCSTR_ lpFileName,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::DWORD_ dwShareMode,
|
||||
::_SECURITY_ATTRIBUTES* lpSecurityAttributes,
|
||||
boost::detail::winapi::DWORD_ dwCreationDisposition,
|
||||
boost::detail::winapi::DWORD_ dwFlagsAndAttributes,
|
||||
boost::detail::winapi::HANDLE_ hTemplateFile);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
DeleteFileA(boost::detail::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
struct _WIN32_FIND_DATAA;
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
FindFirstFileA(boost::detail::winapi::LPCSTR_ lpFileName, ::_WIN32_FIND_DATAA* lpFindFileData);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FindNextFileA(boost::detail::winapi::HANDLE_ hFindFile, ::_WIN32_FIND_DATAA* lpFindFileData);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
MoveFileExA(
|
||||
boost::detail::winapi::LPCSTR_ lpExistingFileName,
|
||||
boost::detail::winapi::LPCSTR_ lpNewFileName,
|
||||
boost::detail::winapi::DWORD_ dwFlags);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetFileAttributesA(boost::detail::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
AreFileApisANSI(BOOST_DETAIL_WINAPI_VOID);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateFileW(
|
||||
boost::detail::winapi::LPCWSTR_ lpFileName,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::DWORD_ dwShareMode,
|
||||
::_SECURITY_ATTRIBUTES* lpSecurityAttributes,
|
||||
boost::detail::winapi::DWORD_ dwCreationDisposition,
|
||||
boost::detail::winapi::DWORD_ dwFlagsAndAttributes,
|
||||
boost::detail::winapi::HANDLE_ hTemplateFile);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
DeleteFileW(boost::detail::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
struct _WIN32_FIND_DATAW;
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
FindFirstFileW(boost::detail::winapi::LPCWSTR_ lpFileName, ::_WIN32_FIND_DATAW* lpFindFileData);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FindNextFileW(boost::detail::winapi::HANDLE_ hFindFile, ::_WIN32_FIND_DATAW* lpFindFileData);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
MoveFileExW(
|
||||
boost::detail::winapi::LPCWSTR_ lpExistingFileName,
|
||||
boost::detail::winapi::LPCWSTR_ lpNewFileName,
|
||||
boost::detail::winapi::DWORD_ dwFlags);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetFileAttributesW(boost::detail::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FindClose(boost::detail::winapi::HANDLE_ hFindFile);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
GetFileSizeEx(boost::detail::winapi::HANDLE_ hFile, ::_LARGE_INTEGER* lpFileSize);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetFileValidData(boost::detail::winapi::HANDLE_ hFile, boost::detail::winapi::LONGLONG_ ValidDataLength);
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetEndOfFile(boost::detail::winapi::HANDLE_ hFile);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
LockFile(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToLockLow,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToLockHigh);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
UnlockFile(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockLow,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockHigh);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
LockFileEx(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwReserved,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToLockLow,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToLockHigh,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
UnlockFileEx(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::DWORD_ dwReserved,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockLow,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockHigh,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
ReadFile(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::LPVOID_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToRead,
|
||||
boost::detail::winapi::LPDWORD_ lpNumberOfBytesRead,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
WriteFile(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::LPCVOID_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nNumberOfBytesToWrite,
|
||||
boost::detail::winapi::LPDWORD_ lpNumberOfBytesWritten,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
SetFilePointer(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
boost::detail::winapi::LONG_ lpDistanceToMove,
|
||||
boost::detail::winapi::PLONG_ lpDistanceToMoveHigh,
|
||||
boost::detail::winapi::DWORD_ dwMoveMethod);
|
||||
|
||||
struct _BY_HANDLE_FILE_INFORMATION;
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
GetFileInformationByHandle(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
::_BY_HANDLE_FILE_INFORMATION* lpFileInformation);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ INVALID_FILE_SIZE_ = INVALID_FILE_SIZE;
|
||||
const DWORD_ INVALID_SET_FILE_POINTER_ = INVALID_SET_FILE_POINTER;
|
||||
const DWORD_ INVALID_FILE_ATTRIBUTES_ = INVALID_FILE_ATTRIBUTES;
|
||||
|
||||
const DWORD_ FILE_ATTRIBUTE_READONLY_ = FILE_ATTRIBUTE_READONLY;
|
||||
const DWORD_ FILE_ATTRIBUTE_HIDDEN_ = FILE_ATTRIBUTE_HIDDEN;
|
||||
const DWORD_ FILE_ATTRIBUTE_SYSTEM_ = FILE_ATTRIBUTE_SYSTEM;
|
||||
const DWORD_ FILE_ATTRIBUTE_DIRECTORY_ = FILE_ATTRIBUTE_DIRECTORY;
|
||||
const DWORD_ FILE_ATTRIBUTE_ARCHIVE_ = FILE_ATTRIBUTE_ARCHIVE;
|
||||
const DWORD_ FILE_ATTRIBUTE_DEVICE_ = FILE_ATTRIBUTE_DEVICE;
|
||||
const DWORD_ FILE_ATTRIBUTE_NORMAL_ = FILE_ATTRIBUTE_NORMAL;
|
||||
const DWORD_ FILE_ATTRIBUTE_TEMPORARY_ = FILE_ATTRIBUTE_TEMPORARY;
|
||||
const DWORD_ FILE_ATTRIBUTE_SPARSE_FILE_ = FILE_ATTRIBUTE_SPARSE_FILE;
|
||||
const DWORD_ FILE_ATTRIBUTE_REPARSE_POINT_ = FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
const DWORD_ FILE_ATTRIBUTE_COMPRESSED_ = FILE_ATTRIBUTE_COMPRESSED;
|
||||
const DWORD_ FILE_ATTRIBUTE_OFFLINE_ = FILE_ATTRIBUTE_OFFLINE;
|
||||
const DWORD_ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED_ = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
|
||||
const DWORD_ FILE_ATTRIBUTE_ENCRYPTED_ = FILE_ATTRIBUTE_ENCRYPTED;
|
||||
|
||||
const DWORD_ CREATE_NEW_ = CREATE_NEW;
|
||||
const DWORD_ CREATE_ALWAYS_ = CREATE_ALWAYS;
|
||||
const DWORD_ OPEN_EXISTING_ = OPEN_EXISTING;
|
||||
const DWORD_ OPEN_ALWAYS_ = OPEN_ALWAYS;
|
||||
const DWORD_ TRUNCATE_EXISTING_ = TRUNCATE_EXISTING;
|
||||
|
||||
const DWORD_ FILE_SHARE_READ_ = FILE_SHARE_READ;
|
||||
const DWORD_ FILE_SHARE_WRITE_ = FILE_SHARE_WRITE;
|
||||
const DWORD_ FILE_SHARE_DELETE_ = FILE_SHARE_DELETE;
|
||||
|
||||
const DWORD_ FILE_BEGIN_ = FILE_BEGIN;
|
||||
const DWORD_ FILE_CURRENT_ = FILE_CURRENT;
|
||||
const DWORD_ FILE_END_ = FILE_END;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ INVALID_FILE_SIZE_ = ((DWORD_)0xFFFFFFFF);
|
||||
const DWORD_ INVALID_SET_FILE_POINTER_ = ((DWORD_)-1);
|
||||
const DWORD_ INVALID_FILE_ATTRIBUTES_ = ((DWORD_)-1);
|
||||
|
||||
const DWORD_ FILE_ATTRIBUTE_READONLY_ = 0x00000001;
|
||||
const DWORD_ FILE_ATTRIBUTE_HIDDEN_ = 0x00000002;
|
||||
const DWORD_ FILE_ATTRIBUTE_SYSTEM_ = 0x00000004;
|
||||
const DWORD_ FILE_ATTRIBUTE_DIRECTORY_ = 0x00000010;
|
||||
const DWORD_ FILE_ATTRIBUTE_ARCHIVE_ = 0x00000020;
|
||||
const DWORD_ FILE_ATTRIBUTE_DEVICE_ = 0x00000040;
|
||||
const DWORD_ FILE_ATTRIBUTE_NORMAL_ = 0x00000080;
|
||||
const DWORD_ FILE_ATTRIBUTE_TEMPORARY_ = 0x00000100;
|
||||
const DWORD_ FILE_ATTRIBUTE_SPARSE_FILE_ = 0x00000200;
|
||||
const DWORD_ FILE_ATTRIBUTE_REPARSE_POINT_ = 0x00000400;
|
||||
const DWORD_ FILE_ATTRIBUTE_COMPRESSED_ = 0x00000800;
|
||||
const DWORD_ FILE_ATTRIBUTE_OFFLINE_ = 0x00001000;
|
||||
const DWORD_ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED_ = 0x00002000;
|
||||
const DWORD_ FILE_ATTRIBUTE_ENCRYPTED_ = 0x00004000;
|
||||
|
||||
const DWORD_ CREATE_NEW_ = 1;
|
||||
const DWORD_ CREATE_ALWAYS_ = 2;
|
||||
const DWORD_ OPEN_EXISTING_ = 3;
|
||||
const DWORD_ OPEN_ALWAYS_ = 4;
|
||||
const DWORD_ TRUNCATE_EXISTING_ = 5;
|
||||
|
||||
const DWORD_ FILE_SHARE_READ_ = 0x00000001;
|
||||
const DWORD_ FILE_SHARE_WRITE_ = 0x00000002;
|
||||
const DWORD_ FILE_SHARE_DELETE_ = 0x00000004;
|
||||
|
||||
const DWORD_ FILE_BEGIN_ = 0;
|
||||
const DWORD_ FILE_CURRENT_ = 1;
|
||||
const DWORD_ FILE_END_ = 2;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// This constant is not defined in Windows SDK up until 6.0A
|
||||
const DWORD_ FILE_ATTRIBUTE_VIRTUAL_ = 0x00010000;
|
||||
|
||||
// These constants are not defined in Windows SDK up until 8.0 and MinGW/MinGW-w64 (as of 2016-02-14).
|
||||
// They are documented to be supported only since Windows 8/Windows Server 2012
|
||||
// but defined unconditionally.
|
||||
const DWORD_ FILE_ATTRIBUTE_INTEGRITY_STREAM_ = 0x00008000;
|
||||
const DWORD_ FILE_ATTRIBUTE_NO_SCRUB_DATA_ = 0x00020000;
|
||||
// Undocumented
|
||||
const DWORD_ FILE_ATTRIBUTE_EA_ = 0x00040000;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::DeleteFileA;
|
||||
using ::MoveFileExA;
|
||||
using ::GetFileAttributesA;
|
||||
using ::AreFileApisANSI;
|
||||
#endif
|
||||
|
||||
using ::DeleteFileW;
|
||||
using ::MoveFileExW;
|
||||
using ::GetFileAttributesW;
|
||||
|
||||
using ::FindClose;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
|
||||
using ::SetFileValidData;
|
||||
|
||||
#endif
|
||||
|
||||
using ::SetEndOfFile;
|
||||
using ::LockFile;
|
||||
using ::UnlockFile;
|
||||
using ::SetFilePointer;
|
||||
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateFileA(
|
||||
LPCSTR_ lpFileName,
|
||||
DWORD_ dwDesiredAccess,
|
||||
DWORD_ dwShareMode,
|
||||
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
|
||||
DWORD_ dwCreationDisposition,
|
||||
DWORD_ dwFlagsAndAttributes,
|
||||
HANDLE_ hTemplateFile)
|
||||
{
|
||||
return ::CreateFileA(
|
||||
lpFileName,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
hTemplateFile);
|
||||
}
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _WIN32_FIND_DATAA {
|
||||
DWORD_ dwFileAttributes;
|
||||
FILETIME_ ftCreationTime;
|
||||
FILETIME_ ftLastAccessTime;
|
||||
FILETIME_ ftLastWriteTime;
|
||||
DWORD_ nFileSizeHigh;
|
||||
DWORD_ nFileSizeLow;
|
||||
DWORD_ dwReserved0;
|
||||
DWORD_ dwReserved1;
|
||||
CHAR_ cFileName[MAX_PATH_];
|
||||
CHAR_ cAlternateFileName[14];
|
||||
#ifdef _MAC
|
||||
DWORD_ dwFileType;
|
||||
DWORD_ dwCreatorType;
|
||||
WORD_ wFinderFlags;
|
||||
#endif
|
||||
} WIN32_FIND_DATAA_, *PWIN32_FIND_DATAA_, *LPWIN32_FIND_DATAA_;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ FindFirstFileA(LPCSTR_ lpFileName, WIN32_FIND_DATAA_* lpFindFileData)
|
||||
{
|
||||
return ::FindFirstFileA(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ FindNextFileA(HANDLE_ hFindFile, WIN32_FIND_DATAA_* lpFindFileData)
|
||||
{
|
||||
return ::FindNextFileA(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateFileW(
|
||||
LPCWSTR_ lpFileName,
|
||||
DWORD_ dwDesiredAccess,
|
||||
DWORD_ dwShareMode,
|
||||
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
|
||||
DWORD_ dwCreationDisposition,
|
||||
DWORD_ dwFlagsAndAttributes,
|
||||
HANDLE_ hTemplateFile)
|
||||
{
|
||||
return ::CreateFileW(
|
||||
lpFileName,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
hTemplateFile);
|
||||
}
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _WIN32_FIND_DATAW {
|
||||
DWORD_ dwFileAttributes;
|
||||
FILETIME_ ftCreationTime;
|
||||
FILETIME_ ftLastAccessTime;
|
||||
FILETIME_ ftLastWriteTime;
|
||||
DWORD_ nFileSizeHigh;
|
||||
DWORD_ nFileSizeLow;
|
||||
DWORD_ dwReserved0;
|
||||
DWORD_ dwReserved1;
|
||||
WCHAR_ cFileName[MAX_PATH_];
|
||||
WCHAR_ cAlternateFileName[14];
|
||||
#ifdef _MAC
|
||||
DWORD_ dwFileType;
|
||||
DWORD_ dwCreatorType;
|
||||
WORD_ wFinderFlags;
|
||||
#endif
|
||||
} WIN32_FIND_DATAW_, *PWIN32_FIND_DATAW_, *LPWIN32_FIND_DATAW_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _BY_HANDLE_FILE_INFORMATION {
|
||||
DWORD_ dwFileAttributes;
|
||||
FILETIME_ ftCreationTime;
|
||||
FILETIME_ ftLastAccessTime;
|
||||
FILETIME_ ftLastWriteTime;
|
||||
DWORD_ dwVolumeSerialNumber;
|
||||
DWORD_ nFileSizeHigh;
|
||||
DWORD_ nFileSizeLow;
|
||||
DWORD_ nNumberOfLinks;
|
||||
DWORD_ nFileIndexHigh;
|
||||
DWORD_ nFileIndexLow;
|
||||
} BY_HANDLE_FILE_INFORMATION_, *PBY_HANDLE_FILE_INFORMATION_, *LPBY_HANDLE_FILE_INFORMATION_;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ FindFirstFileW(LPCWSTR_ lpFileName, WIN32_FIND_DATAW_* lpFindFileData)
|
||||
{
|
||||
return ::FindFirstFileW(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ FindNextFileW(HANDLE_ hFindFile, WIN32_FIND_DATAW_* lpFindFileData)
|
||||
{
|
||||
return ::FindNextFileW(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ GetFileSizeEx(HANDLE_ hFile, LARGE_INTEGER_* lpFileSize)
|
||||
{
|
||||
return ::GetFileSizeEx(hFile, reinterpret_cast< ::_LARGE_INTEGER* >(lpFileSize));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ LockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToLockLow,
|
||||
DWORD_ nNumberOfBytesToLockHigh,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::LockFileEx(hFile, dwFlags, dwReserved, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ UnlockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToUnlockLow,
|
||||
DWORD_ nNumberOfBytesToUnlockHigh,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::UnlockFileEx(hFile, dwReserved, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ ReadFile(
|
||||
HANDLE_ hFile,
|
||||
LPVOID_ lpBuffer,
|
||||
DWORD_ nNumberOfBytesToWrite,
|
||||
LPDWORD_ lpNumberOfBytesWritten,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::ReadFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ WriteFile(
|
||||
HANDLE_ hFile,
|
||||
LPCVOID_ lpBuffer,
|
||||
DWORD_ nNumberOfBytesToWrite,
|
||||
LPDWORD_ lpNumberOfBytesWritten,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ create_file(
|
||||
LPCSTR_ lpFileName,
|
||||
DWORD_ dwDesiredAccess,
|
||||
DWORD_ dwShareMode,
|
||||
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
|
||||
DWORD_ dwCreationDisposition,
|
||||
DWORD_ dwFlagsAndAttributes,
|
||||
HANDLE_ hTemplateFile)
|
||||
{
|
||||
return ::CreateFileA(
|
||||
lpFileName,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
hTemplateFile);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ delete_file(LPCSTR_ lpFileName)
|
||||
{
|
||||
return ::DeleteFileA(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ find_first_file(LPCSTR_ lpFileName, WIN32_FIND_DATAA_* lpFindFileData)
|
||||
{
|
||||
return ::FindFirstFileA(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ find_next_file(HANDLE_ hFindFile, WIN32_FIND_DATAA_* lpFindFileData)
|
||||
{
|
||||
return ::FindNextFileA(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ move_file(LPCSTR_ lpExistingFileName, LPCSTR_ lpNewFileName, DWORD_ dwFlags)
|
||||
{
|
||||
return ::MoveFileExA(lpExistingFileName, lpNewFileName, dwFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_file_attributes(LPCSTR_ lpFileName)
|
||||
{
|
||||
return ::GetFileAttributesA(lpFileName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_file(
|
||||
LPCWSTR_ lpFileName,
|
||||
DWORD_ dwDesiredAccess,
|
||||
DWORD_ dwShareMode,
|
||||
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
|
||||
DWORD_ dwCreationDisposition,
|
||||
DWORD_ dwFlagsAndAttributes,
|
||||
HANDLE_ hTemplateFile)
|
||||
{
|
||||
return ::CreateFileW(
|
||||
lpFileName,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
|
||||
dwCreationDisposition,
|
||||
dwFlagsAndAttributes,
|
||||
hTemplateFile);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ delete_file(LPCWSTR_ lpFileName)
|
||||
{
|
||||
return ::DeleteFileW(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ find_first_file(LPCWSTR_ lpFileName, WIN32_FIND_DATAW_* lpFindFileData)
|
||||
{
|
||||
return ::FindFirstFileW(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ find_next_file(HANDLE_ hFindFile, WIN32_FIND_DATAW_* lpFindFileData)
|
||||
{
|
||||
return ::FindNextFileW(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ move_file(LPCWSTR_ lpExistingFileName, LPCWSTR_ lpNewFileName, DWORD_ dwFlags)
|
||||
{
|
||||
return ::MoveFileExW(lpExistingFileName, lpNewFileName, dwFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_file_attributes(LPCWSTR_ lpFileName)
|
||||
{
|
||||
return ::GetFileAttributesW(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ GetFileInformationByHandle(HANDLE_ h, BY_HANDLE_FILE_INFORMATION_* info)
|
||||
{
|
||||
return ::GetFileInformationByHandle(h, reinterpret_cast< ::_BY_HANDLE_FILE_INFORMATION* >(info));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||
@@ -0,0 +1,238 @@
|
||||
// file_mapping.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
// Copyright 2016 Jorge Lodos
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_FILE_MAPPING_HPP
|
||||
#define BOOST_DETAIL_WINAPI_FILE_MAPPING_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateFileMappingA(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
::_SECURITY_ATTRIBUTES* lpFileMappingAttributes,
|
||||
boost::detail::winapi::DWORD_ flProtect,
|
||||
boost::detail::winapi::DWORD_ dwMaximumSizeHigh,
|
||||
boost::detail::winapi::DWORD_ dwMaximumSizeLow,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenFileMappingA(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateFileMappingW(
|
||||
boost::detail::winapi::HANDLE_ hFile,
|
||||
::_SECURITY_ATTRIBUTES* lpFileMappingAttributes,
|
||||
boost::detail::winapi::DWORD_ flProtect,
|
||||
boost::detail::winapi::DWORD_ dwMaximumSizeHigh,
|
||||
boost::detail::winapi::DWORD_ dwMaximumSizeLow,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenFileMappingW(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
|
||||
MapViewOfFile(
|
||||
boost::detail::winapi::HANDLE_ hFileMappingObject,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::detail::winapi::SIZE_T_ dwNumberOfBytesToMap);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
|
||||
MapViewOfFileEx(
|
||||
boost::detail::winapi::HANDLE_ hFileMappingObject,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::detail::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::detail::winapi::SIZE_T_ dwNumberOfBytesToMap,
|
||||
boost::detail::winapi::LPVOID_ lpBaseAddress);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FlushViewOfFile(
|
||||
boost::detail::winapi::LPCVOID_ lpBaseAddress,
|
||||
boost::detail::winapi::SIZE_T_ dwNumberOfBytesToFlush);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
UnmapViewOfFile(boost::detail::winapi::LPCVOID_ lpBaseAddress);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ SEC_FILE_ = SEC_FILE;
|
||||
const DWORD_ SEC_IMAGE_ = SEC_IMAGE;
|
||||
const DWORD_ SEC_RESERVE_ = SEC_RESERVE;
|
||||
const DWORD_ SEC_COMMIT_ = SEC_COMMIT;
|
||||
const DWORD_ SEC_NOCACHE_ = SEC_NOCACHE;
|
||||
|
||||
// These permission flags are undocumented and some of them are equivalent to the FILE_MAP_* flags.
|
||||
// SECTION_QUERY enables NtQuerySection.
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FSection%2FNtQuerySection.html
|
||||
const DWORD_ SECTION_QUERY_ = SECTION_QUERY;
|
||||
const DWORD_ SECTION_MAP_WRITE_ = SECTION_MAP_WRITE;
|
||||
const DWORD_ SECTION_MAP_READ_ = SECTION_MAP_READ;
|
||||
const DWORD_ SECTION_MAP_EXECUTE_ = SECTION_MAP_EXECUTE;
|
||||
const DWORD_ SECTION_EXTEND_SIZE_ = SECTION_EXTEND_SIZE;
|
||||
const DWORD_ SECTION_ALL_ACCESS_ = SECTION_ALL_ACCESS;
|
||||
|
||||
const DWORD_ FILE_MAP_COPY_ = FILE_MAP_COPY;
|
||||
const DWORD_ FILE_MAP_WRITE_ = FILE_MAP_WRITE;
|
||||
const DWORD_ FILE_MAP_READ_ = FILE_MAP_READ;
|
||||
const DWORD_ FILE_MAP_ALL_ACCESS_ = FILE_MAP_ALL_ACCESS;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ SEC_FILE_ = 0x800000;
|
||||
const DWORD_ SEC_IMAGE_ = 0x1000000;
|
||||
const DWORD_ SEC_RESERVE_ = 0x4000000;
|
||||
const DWORD_ SEC_COMMIT_ = 0x8000000;
|
||||
const DWORD_ SEC_NOCACHE_ = 0x10000000;
|
||||
|
||||
// These permission flags are undocumented and some of them are equivalent to the FILE_MAP_* flags.
|
||||
// SECTION_QUERY enables NtQuerySection.
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FSection%2FNtQuerySection.html
|
||||
const DWORD_ SECTION_QUERY_ = 0x00000001;
|
||||
const DWORD_ SECTION_MAP_WRITE_ = 0x00000002;
|
||||
const DWORD_ SECTION_MAP_READ_ = 0x00000004;
|
||||
const DWORD_ SECTION_MAP_EXECUTE_ = 0x00000008;
|
||||
const DWORD_ SECTION_EXTEND_SIZE_ = 0x00000010;
|
||||
const DWORD_ SECTION_ALL_ACCESS_ = 0x000F001F; // STANDARD_RIGHTS_REQUIRED | SECTION_*
|
||||
|
||||
const DWORD_ FILE_MAP_COPY_ = SECTION_QUERY_;
|
||||
const DWORD_ FILE_MAP_WRITE_ = SECTION_MAP_WRITE_;
|
||||
const DWORD_ FILE_MAP_READ_ = SECTION_MAP_READ_;
|
||||
const DWORD_ FILE_MAP_ALL_ACCESS_ = SECTION_ALL_ACCESS_;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// These constants are not defined in Windows SDK up until the one shipped with MSVC 8 and MinGW (as of 2016-02-14)
|
||||
const DWORD_ SECTION_MAP_EXECUTE_EXPLICIT_ = 0x00000020; // not included in SECTION_ALL_ACCESS
|
||||
const DWORD_ FILE_MAP_EXECUTE_ = SECTION_MAP_EXECUTE_EXPLICIT_; // not included in FILE_MAP_ALL_ACCESS
|
||||
|
||||
// These constants are not defined in Windows SDK up until 6.0A and MinGW (as of 2016-02-14)
|
||||
const DWORD_ SEC_PROTECTED_IMAGE_ = 0x2000000;
|
||||
const DWORD_ SEC_WRITECOMBINE_ = 0x40000000;
|
||||
const DWORD_ SEC_LARGE_PAGES_ = 0x80000000;
|
||||
const DWORD_ SEC_IMAGE_NO_EXECUTE_ = (SEC_IMAGE_ | SEC_NOCACHE_);
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenFileMappingA;
|
||||
#endif
|
||||
using ::OpenFileMappingW;
|
||||
using ::MapViewOfFile;
|
||||
using ::MapViewOfFileEx;
|
||||
using ::FlushViewOfFile;
|
||||
using ::UnmapViewOfFile;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateFileMappingA(
|
||||
HANDLE_ hFile,
|
||||
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
|
||||
DWORD_ flProtect,
|
||||
DWORD_ dwMaximumSizeHigh,
|
||||
DWORD_ dwMaximumSizeLow,
|
||||
LPCSTR_ lpName)
|
||||
{
|
||||
return ::CreateFileMappingA(
|
||||
hFile,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
|
||||
flProtect,
|
||||
dwMaximumSizeHigh,
|
||||
dwMaximumSizeLow,
|
||||
lpName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateFileMappingW(
|
||||
HANDLE_ hFile,
|
||||
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
|
||||
DWORD_ flProtect,
|
||||
DWORD_ dwMaximumSizeHigh,
|
||||
DWORD_ dwMaximumSizeLow,
|
||||
LPCWSTR_ lpName)
|
||||
{
|
||||
return ::CreateFileMappingW(
|
||||
hFile,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
|
||||
flProtect,
|
||||
dwMaximumSizeHigh,
|
||||
dwMaximumSizeLow,
|
||||
lpName);
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ create_file_mapping(
|
||||
HANDLE_ hFile,
|
||||
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
|
||||
DWORD_ flProtect,
|
||||
DWORD_ dwMaximumSizeHigh,
|
||||
DWORD_ dwMaximumSizeLow,
|
||||
LPCSTR_ lpName)
|
||||
{
|
||||
return ::CreateFileMappingA(
|
||||
hFile,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
|
||||
flProtect,
|
||||
dwMaximumSizeHigh,
|
||||
dwMaximumSizeLow,
|
||||
lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_file_mapping(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenFileMappingA(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_file_mapping(
|
||||
HANDLE_ hFile,
|
||||
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
|
||||
DWORD_ flProtect,
|
||||
DWORD_ dwMaximumSizeHigh,
|
||||
DWORD_ dwMaximumSizeLow,
|
||||
LPCWSTR_ lpName)
|
||||
{
|
||||
return ::CreateFileMappingW(
|
||||
hFile,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
|
||||
flProtect,
|
||||
dwMaximumSizeHigh,
|
||||
dwMaximumSizeLow,
|
||||
lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_file_mapping(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::OpenFileMappingW(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_FILE_MAPPING_HPP
|
||||
@@ -0,0 +1,34 @@
|
||||
// get_current_process.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Windows CE define GetCurrentProcess as an inline function in kfuncs.h
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentProcess(BOOST_DETAIL_WINAPI_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::GetCurrentProcess;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP
|
||||
@@ -0,0 +1,33 @@
|
||||
// get_current_process_id.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Windows CE define GetCurrentProcessId as an inline function in kfuncs.h
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentProcessId(BOOST_DETAIL_WINAPI_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::GetCurrentProcessId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP
|
||||
@@ -0,0 +1,34 @@
|
||||
// get_current_thread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentThread(BOOST_DETAIL_WINAPI_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::GetCurrentThread;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP
|
||||
@@ -0,0 +1,34 @@
|
||||
// get_current_thread_id.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Windows CE define GetCurrentThreadId as an inline function in kfuncs.h
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentThreadId(BOOST_DETAIL_WINAPI_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::GetCurrentThreadId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP
|
||||
@@ -0,0 +1,33 @@
|
||||
// get_last_error.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetLastError(BOOST_DETAIL_WINAPI_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::GetLastError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP
|
||||
@@ -0,0 +1,60 @@
|
||||
// get_process_times.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Windows CE does not define GetProcessTimes
|
||||
#if !defined( UNDER_CE )
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/time.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
GetProcessTimes(
|
||||
boost::detail::winapi::HANDLE_ hProcess,
|
||||
::_FILETIME* lpCreationTime,
|
||||
::_FILETIME* lpExitTime,
|
||||
::_FILETIME* lpKernelTime,
|
||||
::_FILETIME* lpUserTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ GetProcessTimes(
|
||||
HANDLE_ hProcess,
|
||||
LPFILETIME_ lpCreationTime,
|
||||
LPFILETIME_ lpExitTime,
|
||||
LPFILETIME_ lpKernelTime,
|
||||
LPFILETIME_ lpUserTime)
|
||||
{
|
||||
return ::GetProcessTimes(
|
||||
hProcess,
|
||||
reinterpret_cast< ::_FILETIME* >(lpCreationTime),
|
||||
reinterpret_cast< ::_FILETIME* >(lpExitTime),
|
||||
reinterpret_cast< ::_FILETIME* >(lpKernelTime),
|
||||
reinterpret_cast< ::_FILETIME* >(lpUserTime));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !defined( UNDER_CE )
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP
|
||||
@@ -0,0 +1,63 @@
|
||||
// get_system_directory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_SYSTEM_DIRECTORY_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_GET_SYSTEM_DIRECTORY_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::UINT_ WINAPI
|
||||
GetSystemDirectoryA(
|
||||
boost::detail::winapi::LPSTR_ lpBuffer,
|
||||
boost::detail::winapi::UINT_ uSize);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::UINT_ WINAPI
|
||||
GetSystemDirectoryW(
|
||||
boost::detail::winapi::LPWSTR_ lpBuffer,
|
||||
boost::detail::winapi::UINT_ uSize);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::GetSystemDirectoryA;
|
||||
#endif
|
||||
using ::GetSystemDirectoryW;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE UINT_ get_system_directory(LPSTR_ lpBuffer, UINT_ uSize)
|
||||
{
|
||||
return ::GetSystemDirectoryA(lpBuffer, uSize);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE UINT_ get_system_directory(LPWSTR_ lpBuffer, UINT_ uSize)
|
||||
{
|
||||
return ::GetSystemDirectoryW(lpBuffer, uSize);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_SYSTEM_DIRECTORY_HPP_
|
||||
@@ -0,0 +1,55 @@
|
||||
// get_thread_times.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/time.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
GetThreadTimes(
|
||||
boost::detail::winapi::HANDLE_ hThread,
|
||||
::_FILETIME* lpCreationTime,
|
||||
::_FILETIME* lpExitTime,
|
||||
::_FILETIME* lpKernelTime,
|
||||
::_FILETIME* lpUserTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ GetThreadTimes(
|
||||
HANDLE_ hThread,
|
||||
LPFILETIME_ lpCreationTime,
|
||||
LPFILETIME_ lpExitTime,
|
||||
LPFILETIME_ lpKernelTime,
|
||||
LPFILETIME_ lpUserTime)
|
||||
{
|
||||
return ::GetThreadTimes(
|
||||
hThread,
|
||||
reinterpret_cast< ::_FILETIME* >(lpCreationTime),
|
||||
reinterpret_cast< ::_FILETIME* >(lpExitTime),
|
||||
reinterpret_cast< ::_FILETIME* >(lpKernelTime),
|
||||
reinterpret_cast< ::_FILETIME* >(lpUserTime));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP
|
||||
@@ -0,0 +1,62 @@
|
||||
// handle_info.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_HANDLE_INFO_HPP_
|
||||
#define BOOST_DETAIL_HANDLE_INFO_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
GetHandleInformation(
|
||||
boost::detail::winapi::HANDLE_ hObject,
|
||||
boost::detail::winapi::LPDWORD_ lpdwFlags);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetHandleInformation(
|
||||
boost::detail::winapi::HANDLE_ hObject,
|
||||
boost::detail::winapi::DWORD_ dwMask,
|
||||
boost::detail::winapi::DWORD_ dwFlags);
|
||||
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
using ::GetHandleInformation;
|
||||
using ::SetHandleInformation;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
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;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#endif // BOOST_DETAIL_HANDLE_INFO_HPP_
|
||||
@@ -0,0 +1,73 @@
|
||||
// handles.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CloseHandle(boost::detail::winapi::HANDLE_ handle);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
DuplicateHandle(
|
||||
boost::detail::winapi::HANDLE_ hSourceProcessHandle,
|
||||
boost::detail::winapi::HANDLE_ hSourceHandle,
|
||||
boost::detail::winapi::HANDLE_ hTargetProcessHandle,
|
||||
boost::detail::winapi::HANDLE_* lpTargetHandle,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::DWORD_ dwOptions);
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CompareObjectHandles(
|
||||
boost::detail::winapi::HANDLE_ hFirstObjectHandle,
|
||||
boost::detail::winapi::HANDLE_ hSecondObjectHandle);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
using ::CloseHandle;
|
||||
using ::DuplicateHandle;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10
|
||||
using ::CompareObjectHandles;
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
const DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE;
|
||||
const DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS;
|
||||
const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE;
|
||||
#else
|
||||
const DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1;
|
||||
const DWORD_ DUPLICATE_SAME_ACCESS_ = 2;
|
||||
const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1);
|
||||
#endif
|
||||
|
||||
const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_;
|
||||
const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_;
|
||||
const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||
@@ -0,0 +1,72 @@
|
||||
// heap_memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_HEAP_MEMORY_HPP
|
||||
#define BOOST_DETAIL_WINAPI_HEAP_MEMORY_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
#undef HeapAlloc
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
GetProcessHeap(BOOST_DETAIL_WINAPI_VOID);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetProcessHeaps(boost::detail::winapi::DWORD_ NumberOfHeaps, boost::detail::winapi::PHANDLE_ ProcessHeaps);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
HeapCreate(
|
||||
boost::detail::winapi::DWORD_ flOptions,
|
||||
boost::detail::winapi::SIZE_T_ dwInitialSize,
|
||||
boost::detail::winapi::SIZE_T_ dwMaximumSize);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
HeapDestroy(boost::detail::winapi::HANDLE_ hHeap);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
|
||||
HeapAlloc(
|
||||
boost::detail::winapi::HANDLE_ hHeap,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::SIZE_T_ dwBytes);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
|
||||
HeapReAlloc(
|
||||
boost::detail::winapi::HANDLE_ hHeap,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPVOID_ lpMem,
|
||||
boost::detail::winapi::SIZE_T_ dwBytes);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
HeapFree(
|
||||
boost::detail::winapi::HANDLE_ hHeap,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPVOID_ lpMem);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::GetProcessHeap;
|
||||
using ::GetProcessHeaps;
|
||||
using ::HeapCreate;
|
||||
using ::HeapDestroy;
|
||||
using ::HeapAlloc;
|
||||
using ::HeapReAlloc;
|
||||
using ::HeapFree;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_HEAP_MEMORY_HPP
|
||||
@@ -0,0 +1,123 @@
|
||||
// init_once.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_INIT_ONCE_HPP
|
||||
#define BOOST_DETAIL_WINAPI_INIT_ONCE_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if defined( BOOST_WINAPI_IS_MINGW_W64 )
|
||||
struct _RTL_RUN_ONCE;
|
||||
#else
|
||||
union _RTL_RUN_ONCE;
|
||||
#endif
|
||||
|
||||
typedef boost::detail::winapi::BOOL_
|
||||
(WINAPI *PINIT_ONCE_FN) (
|
||||
::_RTL_RUN_ONCE* InitOnce,
|
||||
boost::detail::winapi::PVOID_ Parameter,
|
||||
boost::detail::winapi::PVOID_ *Context);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
InitOnceInitialize(::_RTL_RUN_ONCE* InitOnce);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitOnceExecuteOnce(
|
||||
::_RTL_RUN_ONCE* InitOnce,
|
||||
::PINIT_ONCE_FN InitFn,
|
||||
boost::detail::winapi::PVOID_ Parameter,
|
||||
boost::detail::winapi::LPVOID_ *Context);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitOnceBeginInitialize(
|
||||
::_RTL_RUN_ONCE* lpInitOnce,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::PBOOL_ fPending,
|
||||
boost::detail::winapi::LPVOID_ *lpContext);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitOnceComplete(
|
||||
::_RTL_RUN_ONCE* lpInitOnce,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::LPVOID_ lpContext);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef union BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_RUN_ONCE {
|
||||
PVOID_ Ptr;
|
||||
} INIT_ONCE_, *PINIT_ONCE_, *LPINIT_ONCE_;
|
||||
|
||||
extern "C" {
|
||||
typedef BOOL_ (WINAPI *PINIT_ONCE_FN_) (PINIT_ONCE_ lpInitOnce, PVOID_ Parameter, PVOID_ *Context);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ InitOnceInitialize(PINIT_ONCE_ lpInitOnce)
|
||||
{
|
||||
::InitOnceInitialize(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ InitOnceExecuteOnce(PINIT_ONCE_ lpInitOnce, PINIT_ONCE_FN_ InitFn, PVOID_ Parameter, LPVOID_ *Context)
|
||||
{
|
||||
return ::InitOnceExecuteOnce(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce), reinterpret_cast< ::PINIT_ONCE_FN >(InitFn), Parameter, Context);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ InitOnceBeginInitialize(PINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, PBOOL_ fPending, LPVOID_ *lpContext)
|
||||
{
|
||||
return ::InitOnceBeginInitialize(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce), dwFlags, fPending, lpContext);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ InitOnceComplete(PINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, LPVOID_ lpContext)
|
||||
{
|
||||
return ::InitOnceComplete(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce), dwFlags, lpContext);
|
||||
}
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT
|
||||
const DWORD_ INIT_ONCE_ASYNC_ = INIT_ONCE_ASYNC;
|
||||
const DWORD_ INIT_ONCE_CHECK_ONLY_ = INIT_ONCE_CHECK_ONLY;
|
||||
const DWORD_ INIT_ONCE_INIT_FAILED_ = INIT_ONCE_INIT_FAILED;
|
||||
const DWORD_ INIT_ONCE_CTX_RESERVED_BITS_ = INIT_ONCE_CTX_RESERVED_BITS;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT {0}
|
||||
const DWORD_ INIT_ONCE_ASYNC_ = 0x00000002UL;
|
||||
const DWORD_ INIT_ONCE_CHECK_ONLY_ = 0x00000001UL;
|
||||
const DWORD_ INIT_ONCE_INIT_FAILED_ = 0x00000004UL;
|
||||
const DWORD_ INIT_ONCE_CTX_RESERVED_BITS_ = 2;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ init_once_async = INIT_ONCE_ASYNC_;
|
||||
const DWORD_ init_once_check_only = INIT_ONCE_CHECK_ONLY_;
|
||||
const DWORD_ init_once_init_failed = INIT_ONCE_INIT_FAILED_;
|
||||
const DWORD_ init_once_ctx_reserved_bits = INIT_ONCE_CTX_RESERVED_BITS_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_INIT_ONCE_HPP
|
||||
@@ -0,0 +1,119 @@
|
||||
// jobs.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_JOBS_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_JOBS_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/access_rights.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateJobObjectA(
|
||||
::_SECURITY_ATTRIBUTES* lpJobAttributes,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateJobObjectW(
|
||||
::_SECURITY_ATTRIBUTES* lpJobAttributes,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI AssignProcessToJobObject(
|
||||
boost::detail::winapi::HANDLE_ hJob,
|
||||
boost::detail::winapi::HANDLE_ hProcess);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI IsProcessInJob(
|
||||
boost::detail::winapi::HANDLE_ ProcessHandle,
|
||||
boost::detail::winapi::HANDLE_ JobHandle,
|
||||
boost::detail::winapi::PBOOL_ Result);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI TerminateJobObject(
|
||||
boost::detail::winapi::HANDLE_ hJob,
|
||||
boost::detail::winapi::UINT_ uExitCode);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI OpenJobObjectA(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandles,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI OpenJobObjectW(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandles,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost { namespace detail { namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
const DWORD_ JOB_OBJECT_ASSIGN_PROCESS_ = JOB_OBJECT_ASSIGN_PROCESS;
|
||||
const DWORD_ JOB_OBJECT_SET_ATTRIBUTES_ = JOB_OBJECT_SET_ATTRIBUTES;
|
||||
const DWORD_ JOB_OBJECT_QUERY_ = JOB_OBJECT_QUERY;
|
||||
const DWORD_ JOB_OBJECT_TERMINATE_ = JOB_OBJECT_TERMINATE;
|
||||
const DWORD_ JOB_OBJECT_SET_SECURITY_ATTRIBUTES_ = JOB_OBJECT_SET_SECURITY_ATTRIBUTES;
|
||||
const DWORD_ JOB_OBJECT_ALL_ACCESS_ = JOB_OBJECT_ALL_ACCESS;
|
||||
#else
|
||||
const DWORD_ JOB_OBJECT_ASSIGN_PROCESS_ = 0x0001;
|
||||
const DWORD_ JOB_OBJECT_SET_ATTRIBUTES_ = 0x0002;
|
||||
const DWORD_ JOB_OBJECT_QUERY_ = 0x0004;
|
||||
const DWORD_ JOB_OBJECT_TERMINATE_ = 0x0008;
|
||||
const DWORD_ JOB_OBJECT_SET_SECURITY_ATTRIBUTES_ = 0x0010;
|
||||
const DWORD_ JOB_OBJECT_ALL_ACCESS_ = (STANDARD_RIGHTS_REQUIRED_ | SYNCHRONIZE_ | 0x1F);
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenJobObjectA;
|
||||
#endif
|
||||
|
||||
using ::OpenJobObjectW;
|
||||
|
||||
using ::AssignProcessToJobObject;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
using ::IsProcessInJob;
|
||||
#endif
|
||||
using ::TerminateJobObject;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateJobObjectA(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCSTR_ lpName)
|
||||
{
|
||||
return ::CreateJobObjectA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_job_object(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCSTR_ lpName)
|
||||
{
|
||||
return ::CreateJobObjectA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_job_object(DWORD_ dwDesiredAccess, BOOL_ bInheritHandles, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenJobObjectA(dwDesiredAccess, bInheritHandles, lpName);
|
||||
}
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateJobObjectW(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::CreateJobObjectW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_job_object(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::CreateJobObjectW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_job_object(DWORD_ dwDesiredAccess, BOOL_ bInheritHandles, LPCWSTR_ lpName)
|
||||
{
|
||||
return OpenJobObjectW(dwDesiredAccess, bInheritHandles, lpName);
|
||||
}
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_JOBS_HPP_
|
||||
@@ -0,0 +1,51 @@
|
||||
// limits.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_LIMITS_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_LIMITS_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ MAX_PATH_ = MAX_PATH;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ MAX_PATH_ = 260;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
|
||||
|
||||
const DWORD_ UNICODE_STRING_MAX_BYTES_ = UNICODE_STRING_MAX_BYTES;
|
||||
const DWORD_ UNICODE_STRING_MAX_CHARS_ = UNICODE_STRING_MAX_CHARS;
|
||||
|
||||
#else
|
||||
|
||||
const DWORD_ UNICODE_STRING_MAX_BYTES_ = 65534;
|
||||
const DWORD_ UNICODE_STRING_MAX_CHARS_ = 32767;
|
||||
|
||||
#endif
|
||||
|
||||
const DWORD_ max_path = MAX_PATH_;
|
||||
const DWORD_ unicode_string_max_bytes = UNICODE_STRING_MAX_BYTES_;
|
||||
const DWORD_ unicode_string_max_chars = UNICODE_STRING_MAX_CHARS_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_LIMITS_HPP_
|
||||
@@ -0,0 +1,51 @@
|
||||
// local_memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_LOCAL_MEMORY_HPP
|
||||
#define BOOST_DETAIL_WINAPI_LOCAL_MEMORY_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
namespace boost { namespace detail { namespace winapi {
|
||||
typedef HANDLE_ HLOCAL_;
|
||||
}}}
|
||||
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HLOCAL_ WINAPI
|
||||
LocalAlloc(
|
||||
boost::detail::winapi::UINT_ uFlags,
|
||||
boost::detail::winapi::SIZE_T_ uBytes);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HLOCAL_ WINAPI
|
||||
LocalReAlloc(
|
||||
boost::detail::winapi::HLOCAL_ hMem,
|
||||
boost::detail::winapi::SIZE_T_ uBytes,
|
||||
boost::detail::winapi::UINT_ uFlags);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HLOCAL_ WINAPI LocalFree(boost::detail::winapi::HLOCAL_ hMem);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::HLOCAL HLOCAL_;
|
||||
#endif
|
||||
using ::LocalAlloc;
|
||||
using ::LocalReAlloc;
|
||||
using ::LocalFree;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_LOCAL_MEMORY_HPP
|
||||
@@ -0,0 +1,20 @@
|
||||
// memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||
#define BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||
|
||||
#include <boost/detail/winapi/heap_memory.hpp>
|
||||
#include <boost/detail/winapi/local_memory.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||
@@ -0,0 +1,184 @@
|
||||
// mutex.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_MUTEX_HPP
|
||||
#define BOOST_DETAIL_WINAPI_MUTEX_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateMutexA(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::detail::winapi::BOOL_ bInitialOwner,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateMutexExA(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::detail::winapi::LPCSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenMutexA(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateMutexW(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::detail::winapi::BOOL_ bInitialOwner,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateMutexExW(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::detail::winapi::LPCWSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenMutexW(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
ReleaseMutex(boost::detail::winapi::HANDLE_ hMutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenMutexA;
|
||||
#endif
|
||||
using ::OpenMutexW;
|
||||
using ::ReleaseMutex;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ MUTEX_ALL_ACCESS_ = MUTEX_ALL_ACCESS;
|
||||
const DWORD_ MUTEX_MODIFY_STATE_ = MUTEX_MODIFY_STATE;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ CREATE_MUTEX_INITIAL_OWNER_ = CREATE_MUTEX_INITIAL_OWNER;
|
||||
#endif
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ MUTEX_ALL_ACCESS_ = 0x001F0001;
|
||||
const DWORD_ MUTEX_MODIFY_STATE_ = 0x00000001;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ CREATE_MUTEX_INITIAL_OWNER_ = 0x00000001;
|
||||
#endif
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ mutex_all_access = MUTEX_ALL_ACCESS_;
|
||||
const DWORD_ mutex_modify_state = MUTEX_MODIFY_STATE_;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ create_mutex_initial_owner = CREATE_MUTEX_INITIAL_OWNER_;
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateMutexA(SECURITY_ATTRIBUTES_* lpMutexAttributes, BOOL_ bInitialOwner, LPCSTR_ lpName)
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ flags = bInitialOwner ? create_mutex_initial_owner : 0u;
|
||||
return ::CreateMutexExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, flags, mutex_all_access);
|
||||
#else
|
||||
return ::CreateMutexA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), bInitialOwner, lpName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE HANDLE_ CreateMutexExA(
|
||||
SECURITY_ATTRIBUTES_* lpMutexAttributes,
|
||||
LPCSTR_ lpName,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ dwDesiredAccess)
|
||||
{
|
||||
return ::CreateMutexExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, dwFlags, dwDesiredAccess);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateMutexW(SECURITY_ATTRIBUTES_* lpMutexAttributes, BOOL_ bInitialOwner, LPCWSTR_ lpName)
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ flags = bInitialOwner ? create_mutex_initial_owner : 0u;
|
||||
return ::CreateMutexExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, flags, mutex_all_access);
|
||||
#else
|
||||
return ::CreateMutexW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), bInitialOwner, lpName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE HANDLE_ CreateMutexExW(
|
||||
SECURITY_ATTRIBUTES_* lpMutexAttributes,
|
||||
LPCWSTR_ lpName,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ dwDesiredAccess)
|
||||
{
|
||||
return ::CreateMutexExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, dwFlags, dwDesiredAccess);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ create_mutex(SECURITY_ATTRIBUTES_* lpAttributes, BOOL_ bInitialOwner, LPCSTR_ lpName)
|
||||
{
|
||||
return winapi::CreateMutexA(lpAttributes, bInitialOwner, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_mutex(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenMutexA(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_mutex(SECURITY_ATTRIBUTES_* lpAttributes, BOOL_ bInitialOwner, LPCWSTR_ lpName)
|
||||
{
|
||||
return winapi::CreateMutexW(lpAttributes, bInitialOwner, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_mutex(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::OpenMutexW(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(SECURITY_ATTRIBUTES_* lpAttributes, BOOL_ bInitialOwner)
|
||||
{
|
||||
return winapi::CreateMutexW(lpAttributes, bInitialOwner, 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_MUTEX_HPP
|
||||
@@ -0,0 +1,51 @@
|
||||
// overlapped.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_OVERLAPPED_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_OVERLAPPED_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _OVERLAPPED;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
|
||||
#endif
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _OVERLAPPED {
|
||||
ULONG_PTR_ Internal;
|
||||
ULONG_PTR_ InternalHigh;
|
||||
union {
|
||||
struct {
|
||||
DWORD_ Offset;
|
||||
DWORD_ OffsetHigh;
|
||||
};
|
||||
PVOID_ Pointer;
|
||||
};
|
||||
HANDLE_ hEvent;
|
||||
} OVERLAPPED_, *LPOVERLAPPED_;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_OVERLAPPED_HPP_
|
||||
@@ -0,0 +1,56 @@
|
||||
// page_protection_flags.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_PAGE_PROTECTION_FLAGS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_PAGE_PROTECTION_FLAGS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ PAGE_NOACCESS_ = PAGE_NOACCESS;
|
||||
const DWORD_ PAGE_READONLY_ = PAGE_READONLY;
|
||||
const DWORD_ PAGE_READWRITE_ = PAGE_READWRITE;
|
||||
const DWORD_ PAGE_WRITECOPY_ = PAGE_WRITECOPY;
|
||||
const DWORD_ PAGE_EXECUTE_ = PAGE_EXECUTE;
|
||||
const DWORD_ PAGE_EXECUTE_READ_ = PAGE_EXECUTE_READ;
|
||||
const DWORD_ PAGE_EXECUTE_READWRITE_ = PAGE_EXECUTE_READWRITE;
|
||||
const DWORD_ PAGE_EXECUTE_WRITECOPY_ = PAGE_EXECUTE_WRITECOPY;
|
||||
const DWORD_ PAGE_GUARD_ = PAGE_GUARD;
|
||||
const DWORD_ PAGE_NOCACHE_ = PAGE_NOCACHE;
|
||||
const DWORD_ PAGE_WRITECOMBINE_ = PAGE_WRITECOMBINE;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ PAGE_NOACCESS_ = 0x01;
|
||||
const DWORD_ PAGE_READONLY_ = 0x02;
|
||||
const DWORD_ PAGE_READWRITE_ = 0x04;
|
||||
const DWORD_ PAGE_WRITECOPY_ = 0x08;
|
||||
const DWORD_ PAGE_EXECUTE_ = 0x10;
|
||||
const DWORD_ PAGE_EXECUTE_READ_ = 0x20;
|
||||
const DWORD_ PAGE_EXECUTE_READWRITE_ = 0x40;
|
||||
const DWORD_ PAGE_EXECUTE_WRITECOPY_ = 0x80;
|
||||
const DWORD_ PAGE_GUARD_ = 0x100;
|
||||
const DWORD_ PAGE_NOCACHE_ = 0x200;
|
||||
const DWORD_ PAGE_WRITECOMBINE_ = 0x400;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_PAGE_PROTECTION_FLAGS_HPP
|
||||
@@ -0,0 +1,317 @@
|
||||
// pipes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_PIPES_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_PIPES_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/detail/winapi/overlapped.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ImpersonateNamedPipeClient(
|
||||
boost::detail::winapi::HANDLE_ hNamedPipe);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI CreatePipe(
|
||||
boost::detail::winapi::PHANDLE_ hReadPipe,
|
||||
boost::detail::winapi::PHANDLE_ hWritePipe,
|
||||
_SECURITY_ATTRIBUTES* lpPipeAttributes,
|
||||
boost::detail::winapi::DWORD_ nSize);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ConnectNamedPipe(
|
||||
boost::detail::winapi::HANDLE_ hNamedPipe,
|
||||
_OVERLAPPED* lpOverlapped);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI DisconnectNamedPipe(
|
||||
boost::detail::winapi::HANDLE_ hNamedPipe);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SetNamedPipeHandleState(
|
||||
boost::detail::winapi::HANDLE_ hNamedPipe,
|
||||
boost::detail::winapi::LPDWORD_ lpMode,
|
||||
boost::detail::winapi::LPDWORD_ lpMaxCollectionCount,
|
||||
boost::detail::winapi::LPDWORD_ lpCollectDataTimeout);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI PeekNamedPipe(
|
||||
boost::detail::winapi::HANDLE_ hNamedPipe,
|
||||
boost::detail::winapi::LPVOID_ lpBuffer,
|
||||
boost::detail::winapi::DWORD_ nBufferSize,
|
||||
boost::detail::winapi::LPDWORD_ lpBytesRead,
|
||||
boost::detail::winapi::LPDWORD_ lpTotalBytesAvail,
|
||||
boost::detail::winapi::LPDWORD_ lpBytesLeftThisMessage);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI TransactNamedPipe(
|
||||
boost::detail::winapi::HANDLE_ hNamedPipe,
|
||||
boost::detail::winapi::LPVOID_ lpInBuffer,
|
||||
boost::detail::winapi::DWORD_ nInBufferSize,
|
||||
boost::detail::winapi::LPVOID_ lpOutBuffer,
|
||||
boost::detail::winapi::DWORD_ nOutBufferSize,
|
||||
boost::detail::winapi::LPDWORD_ lpBytesRead,
|
||||
_OVERLAPPED* lpOverlapped);
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateNamedPipeA(
|
||||
boost::detail::winapi::LPCSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwOpenMode,
|
||||
boost::detail::winapi::DWORD_ dwPipeMode,
|
||||
boost::detail::winapi::DWORD_ nMaxInstances,
|
||||
boost::detail::winapi::DWORD_ nOutBufferSize,
|
||||
boost::detail::winapi::DWORD_ nInBufferSize,
|
||||
boost::detail::winapi::DWORD_ nDefaultTimeOut,
|
||||
_SECURITY_ATTRIBUTES *lpSecurityAttributes);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI WaitNamedPipeA(
|
||||
boost::detail::winapi::LPCSTR_ lpNamedPipeName,
|
||||
boost::detail::winapi::DWORD_ nTimeOut);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateNamedPipeW(
|
||||
boost::detail::winapi::LPCWSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwOpenMode,
|
||||
boost::detail::winapi::DWORD_ dwPipeMode,
|
||||
boost::detail::winapi::DWORD_ nMaxInstances,
|
||||
boost::detail::winapi::DWORD_ nOutBufferSize,
|
||||
boost::detail::winapi::DWORD_ nInBufferSize,
|
||||
boost::detail::winapi::DWORD_ nDefaultTimeOut,
|
||||
_SECURITY_ATTRIBUTES* lpSecurityAttributes);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI WaitNamedPipeW(
|
||||
boost::detail::winapi::LPCWSTR_ lpNamedPipeName,
|
||||
boost::detail::winapi::DWORD_ nTimeOut);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI GetNamedPipeClientComputerNameA(
|
||||
boost::detail::winapi::HANDLE_ Pipe,
|
||||
boost::detail::winapi::LPSTR_ ClientComputerName,
|
||||
boost::detail::winapi::ULONG_ ClientComputerNameLength);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI GetNamedPipeClientComputerNameW(
|
||||
boost::detail::winapi::HANDLE_ Pipe,
|
||||
boost::detail::winapi::LPWSTR_ ClientComputerName,
|
||||
boost::detail::winapi::ULONG_ ClientComputerNameLength);
|
||||
#endif
|
||||
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ PIPE_ACCESS_DUPLEX_ = PIPE_ACCESS_DUPLEX;
|
||||
const DWORD_ PIPE_ACCESS_INBOUND_ = PIPE_ACCESS_INBOUND;
|
||||
const DWORD_ PIPE_ACCESS_OUTBOUND_ = PIPE_ACCESS_OUTBOUND;
|
||||
|
||||
const DWORD_ PIPE_TYPE_BYTE_ = PIPE_TYPE_BYTE;
|
||||
const DWORD_ PIPE_TYPE_MESSAGE_ = PIPE_TYPE_MESSAGE;
|
||||
|
||||
const DWORD_ PIPE_READMODE_BYTE_ = PIPE_READMODE_BYTE;
|
||||
const DWORD_ PIPE_READMODE_MESSAGE_ = PIPE_READMODE_MESSAGE;
|
||||
|
||||
const DWORD_ PIPE_WAIT_ = PIPE_WAIT;
|
||||
const DWORD_ PIPE_NOWAIT_ = PIPE_NOWAIT;
|
||||
|
||||
const DWORD_ PIPE_UNLIMITED_INSTANCES_ = PIPE_UNLIMITED_INSTANCES;
|
||||
|
||||
const DWORD_ NMPWAIT_USE_DEFAULT_WAIT_ = NMPWAIT_USE_DEFAULT_WAIT;
|
||||
const DWORD_ NMPWAIT_NOWAIT_ = NMPWAIT_NOWAIT;
|
||||
const DWORD_ NMPWAIT_WAIT_FOREVER_ = NMPWAIT_WAIT_FOREVER;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ PIPE_ACCESS_DUPLEX_ = 0x00000003;
|
||||
const DWORD_ PIPE_ACCESS_INBOUND_ = 0x00000001;
|
||||
const DWORD_ PIPE_ACCESS_OUTBOUND_ = 0x00000002;
|
||||
|
||||
const DWORD_ PIPE_TYPE_BYTE_ = 0x00000000;
|
||||
const DWORD_ PIPE_TYPE_MESSAGE_ = 0x00000004;
|
||||
|
||||
const DWORD_ PIPE_READMODE_BYTE_ = 0x00000000;
|
||||
const DWORD_ PIPE_READMODE_MESSAGE_ = 0x00000002;
|
||||
|
||||
const DWORD_ PIPE_WAIT_ = 0x00000000;
|
||||
const DWORD_ PIPE_NOWAIT_ = 0x00000001;
|
||||
|
||||
const DWORD_ PIPE_UNLIMITED_INSTANCES_ = 255u;
|
||||
|
||||
const DWORD_ NMPWAIT_USE_DEFAULT_WAIT_ = 0x00000000;
|
||||
const DWORD_ NMPWAIT_NOWAIT_ = 0x00000001;
|
||||
const DWORD_ NMPWAIT_WAIT_FOREVER_ = 0xFFFFFFFF;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// These constants are not defined in Windows SDK prior to 7.0A
|
||||
const DWORD_ PIPE_ACCEPT_REMOTE_CLIENTS_ = 0x00000000;
|
||||
const DWORD_ PIPE_REJECT_REMOTE_CLIENTS_ = 0x00000008;
|
||||
|
||||
using ::ImpersonateNamedPipeClient;
|
||||
using ::DisconnectNamedPipe;
|
||||
using ::SetNamedPipeHandleState;
|
||||
using ::PeekNamedPipe;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::WaitNamedPipeA;
|
||||
#endif
|
||||
using ::WaitNamedPipeW;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::GetNamedPipeClientComputerNameA;
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::GetNamedPipeClientComputerNameW;
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ CreatePipe(PHANDLE_ hReadPipe, PHANDLE_ hWritePipe, LPSECURITY_ATTRIBUTES_ lpPipeAttributes, DWORD_ nSize)
|
||||
{
|
||||
return ::CreatePipe(hReadPipe, hWritePipe, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpPipeAttributes), nSize);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ ConnectNamedPipe(HANDLE_ hNamedPipe, LPOVERLAPPED_ lpOverlapped)
|
||||
{
|
||||
return ::ConnectNamedPipe(hNamedPipe, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ TransactNamedPipe(HANDLE_ hNamedPipe, LPVOID_ lpInBuffer, DWORD_ nInBufferSize, LPVOID_ lpOutBuffer, DWORD_ nOutBufferSize, LPDWORD_ lpBytesRead, LPOVERLAPPED_ lpOverlapped)
|
||||
{
|
||||
return ::TransactNamedPipe(hNamedPipe, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesRead, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateNamedPipeA(
|
||||
LPCSTR_ lpName,
|
||||
DWORD_ dwOpenMode,
|
||||
DWORD_ dwPipeMode,
|
||||
DWORD_ nMaxInstances,
|
||||
DWORD_ nOutBufferSize,
|
||||
DWORD_ nInBufferSize,
|
||||
DWORD_ nDefaultTimeOut,
|
||||
LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
|
||||
{
|
||||
return ::CreateNamedPipeA(
|
||||
lpName,
|
||||
dwOpenMode,
|
||||
dwPipeMode,
|
||||
nMaxInstances,
|
||||
nOutBufferSize,
|
||||
nInBufferSize,
|
||||
nDefaultTimeOut,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_named_pipe(
|
||||
LPCSTR_ lpName,
|
||||
DWORD_ dwOpenMode,
|
||||
DWORD_ dwPipeMode,
|
||||
DWORD_ nMaxInstances,
|
||||
DWORD_ nOutBufferSize,
|
||||
DWORD_ nInBufferSize,
|
||||
DWORD_ nDefaultTimeOut,
|
||||
LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
|
||||
{
|
||||
return ::CreateNamedPipeA(
|
||||
lpName,
|
||||
dwOpenMode,
|
||||
dwPipeMode,
|
||||
nMaxInstances,
|
||||
nOutBufferSize,
|
||||
nInBufferSize,
|
||||
nDefaultTimeOut,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
|
||||
}
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateNamedPipeW(
|
||||
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,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_named_pipe(
|
||||
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,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE BOOL_ wait_named_pipe(LPCSTR_ lpNamedPipeName, DWORD_ nTimeOut)
|
||||
{
|
||||
return ::WaitNamedPipeA(lpNamedPipeName, nTimeOut);
|
||||
}
|
||||
#endif //BOOST_NO_ANSI_APIS
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ wait_named_pipe(LPCWSTR_ lpNamedPipeName, DWORD_ nTimeOut)
|
||||
{
|
||||
return ::WaitNamedPipeW(lpNamedPipeName, nTimeOut);
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE BOOL_ get_named_pipe_client_computer_name(HANDLE_ Pipe, LPSTR_ ClientComputerName, ULONG_ ClientComputerNameLength)
|
||||
{
|
||||
return ::GetNamedPipeClientComputerNameA(Pipe, ClientComputerName, ClientComputerNameLength);
|
||||
}
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ get_named_pipe_client_computer_name(HANDLE_ Pipe, LPWSTR_ ClientComputerName, ULONG_ ClientComputerNameLength)
|
||||
{
|
||||
return ::GetNamedPipeClientComputerNameW(Pipe, ClientComputerName, ClientComputerNameLength);
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_PIPES_HPP_
|
||||
@@ -0,0 +1,78 @@
|
||||
// priority_class.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_PRIORITY_CLASS_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_PRIORITY_CLASS_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetPriorityClass(boost::detail::winapi::HANDLE_ hProcess);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetPriorityClass(
|
||||
boost::detail::winapi::HANDLE_ hProcess,
|
||||
boost::detail::winapi::DWORD_ dwPriorityClass);
|
||||
|
||||
} // extern "C"
|
||||
#endif //defined BOOST_WINDOWS_H
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
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_ BELOW_NORMAL_PRIORITY_CLASS_ = BELOW_NORMAL_PRIORITY_CLASS;
|
||||
const DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = ABOVE_NORMAL_PRIORITY_CLASS;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = PROCESS_MODE_BACKGROUND_BEGIN;
|
||||
const DWORD_ PROCESS_MODE_BACKGROUND_END_ = PROCESS_MODE_BACKGROUND_END;
|
||||
#endif
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
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_ BELOW_NORMAL_PRIORITY_CLASS_ = 0x4000;
|
||||
const DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = 0x8000;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = 0x100000;
|
||||
const DWORD_ PROCESS_MODE_BACKGROUND_END_ = 0x200000;
|
||||
#endif
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
using ::GetPriorityClass;
|
||||
using ::SetPriorityClass;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_PRIORITY_CLASS_HPP_
|
||||
@@ -0,0 +1,421 @@
|
||||
// process.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
// Copyright 2016 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_PROCESS_HPP_
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/access_rights.hpp>
|
||||
#include <boost/detail/winapi/get_current_process.hpp>
|
||||
#include <boost/detail/winapi/get_current_process_id.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
struct _PROCESS_INFORMATION;
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
struct _STARTUPINFOA;
|
||||
#endif
|
||||
struct _STARTUPINFOW;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
struct _PROC_THREAD_ATTRIBUTE_LIST;
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
struct _STARTUPINFOEXA;
|
||||
#endif
|
||||
struct _STARTUPINFOEXW;
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT BOOST_NORETURN boost::detail::winapi::VOID_ WINAPI
|
||||
ExitProcess(boost::detail::winapi::UINT_ uExitCode);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI TerminateProcess(
|
||||
boost::detail::winapi::HANDLE_ hProcess,
|
||||
boost::detail::winapi::UINT_ uExitCode);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI GetExitCodeProcess(
|
||||
boost::detail::winapi::HANDLE_ hProcess,
|
||||
boost::detail::winapi::LPDWORD_ lpExitCode);
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI CreateProcessA(
|
||||
boost::detail::winapi::LPCSTR_ lpApplicationName,
|
||||
boost::detail::winapi::LPSTR_ lpCommandLine,
|
||||
::_SECURITY_ATTRIBUTES* lpProcessAttributes,
|
||||
::_SECURITY_ATTRIBUTES* lpThreadAttributes,
|
||||
boost::detail::winapi::INT_ bInheritHandles,
|
||||
boost::detail::winapi::DWORD_ dwCreationFlags,
|
||||
boost::detail::winapi::LPVOID_ lpEnvironment,
|
||||
boost::detail::winapi::LPCSTR_ lpCurrentDirectory,
|
||||
::_STARTUPINFOA* lpStartupInfo,
|
||||
::_PROCESS_INFORMATION* lpProcessInformation);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI CreateProcessW(
|
||||
boost::detail::winapi::LPCWSTR_ lpApplicationName,
|
||||
boost::detail::winapi::LPWSTR_ lpCommandLine,
|
||||
::_SECURITY_ATTRIBUTES* lpProcessAttributes,
|
||||
::_SECURITY_ATTRIBUTES* lpThreadAttributes,
|
||||
boost::detail::winapi::INT_ bInheritHandles,
|
||||
boost::detail::winapi::DWORD_ dwCreationFlags,
|
||||
boost::detail::winapi::LPVOID_ lpEnvironment,
|
||||
boost::detail::winapi::LPCWSTR_ lpCurrentDirectory,
|
||||
::_STARTUPINFOW* lpStartupInfo,
|
||||
::_PROCESS_INFORMATION* lpProcessInformation);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI OpenProcess(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::DWORD_ dwProcessId);
|
||||
|
||||
} // extern "C"
|
||||
#endif //defined BOOST_WINDOWS_H
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#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_ 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_ CREATE_BREAKAWAY_FROM_JOB_ = CREATE_BREAKAWAY_FROM_JOB;
|
||||
const DWORD_ CREATE_DEFAULT_ERROR_MODE_ = CREATE_DEFAULT_ERROR_MODE;
|
||||
const DWORD_ CREATE_NO_WINDOW_ = CREATE_NO_WINDOW;
|
||||
|
||||
// Undocumented
|
||||
const DWORD_ PROFILE_USER_ = PROFILE_USER;
|
||||
const DWORD_ PROFILE_KERNEL_ = PROFILE_KERNEL;
|
||||
const DWORD_ PROFILE_SERVER_ = PROFILE_SERVER;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ CREATE_PROTECTED_PROCESS_ = CREATE_PROTECTED_PROCESS;
|
||||
const DWORD_ EXTENDED_STARTUPINFO_PRESENT_ = EXTENDED_STARTUPINFO_PRESENT;
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
|
||||
const DWORD_ INHERIT_PARENT_AFFINITY_ = INHERIT_PARENT_AFFINITY;
|
||||
#endif
|
||||
|
||||
// Only documented for Windows CE
|
||||
#if defined(UNDER_CE)
|
||||
const DWORD_ INHERIT_CALLER_PRIORITY_ = INHERIT_CALLER_PRIORITY;
|
||||
#endif
|
||||
|
||||
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;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
|
||||
const DWORD_ STARTF_TITLEISLINKNAME_ = STARTF_TITLEISLINKNAME;
|
||||
const DWORD_ STARTF_TITLEISAPPID_ = STARTF_TITLEISAPPID;
|
||||
const DWORD_ STARTF_PREVENTPINNING_ = STARTF_PREVENTPINNING;
|
||||
#endif
|
||||
|
||||
const DWORD_ PROCESS_TERMINATE_ = PROCESS_TERMINATE;
|
||||
const DWORD_ PROCESS_CREATE_THREAD_ = PROCESS_CREATE_THREAD;
|
||||
const DWORD_ PROCESS_SET_SESSIONID_ = PROCESS_SET_SESSIONID;
|
||||
const DWORD_ PROCESS_VM_OPERATION_ = PROCESS_VM_OPERATION;
|
||||
const DWORD_ PROCESS_VM_READ_ = PROCESS_VM_READ;
|
||||
const DWORD_ PROCESS_VM_WRITE_ = PROCESS_VM_WRITE;
|
||||
const DWORD_ PROCESS_DUP_HANDLE_ = PROCESS_DUP_HANDLE;
|
||||
const DWORD_ PROCESS_CREATE_PROCESS_ = PROCESS_CREATE_PROCESS;
|
||||
const DWORD_ PROCESS_SET_QUOTA_ = PROCESS_SET_QUOTA;
|
||||
const DWORD_ PROCESS_SET_INFORMATION_ = PROCESS_SET_INFORMATION;
|
||||
const DWORD_ PROCESS_QUERY_INFORMATION_ = PROCESS_QUERY_INFORMATION;
|
||||
const DWORD_ PROCESS_SUSPEND_RESUME_ = PROCESS_SUSPEND_RESUME;
|
||||
const DWORD_ PROCESS_ALL_ACCESS_ = PROCESS_ALL_ACCESS;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
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_ 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_ CREATE_BREAKAWAY_FROM_JOB_ = 0x1000000;
|
||||
const DWORD_ CREATE_DEFAULT_ERROR_MODE_ = 0x4000000;
|
||||
const DWORD_ CREATE_NO_WINDOW_ = 0x8000000;
|
||||
|
||||
// Undocumented
|
||||
const DWORD_ PROFILE_USER_ = 0x10000000;
|
||||
const DWORD_ PROFILE_KERNEL_ = 0x20000000;
|
||||
const DWORD_ PROFILE_SERVER_ = 0x40000000;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ CREATE_PROTECTED_PROCESS_ = 0x40000;
|
||||
const DWORD_ EXTENDED_STARTUPINFO_PRESENT_ = 0x80000;
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
|
||||
const DWORD_ INHERIT_PARENT_AFFINITY_ = 0x10000;
|
||||
#endif
|
||||
|
||||
// Only documented for Windows CE
|
||||
#if defined(UNDER_CE)
|
||||
const DWORD_ INHERIT_CALLER_PRIORITY_ = 0x20000;
|
||||
#endif
|
||||
|
||||
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;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
|
||||
const DWORD_ STARTF_TITLEISLINKNAME_ = 0x00000800;
|
||||
const DWORD_ STARTF_TITLEISAPPID_ = 0x00001000;
|
||||
const DWORD_ STARTF_PREVENTPINNING_ = 0x00002000;
|
||||
#endif
|
||||
|
||||
const DWORD_ PROCESS_TERMINATE_ = 0x0001;
|
||||
const DWORD_ PROCESS_CREATE_THREAD_ = 0x0002;
|
||||
const DWORD_ PROCESS_SET_SESSIONID_ = 0x0004;
|
||||
const DWORD_ PROCESS_VM_OPERATION_ = 0x0008;
|
||||
const DWORD_ PROCESS_VM_READ_ = 0x0010;
|
||||
const DWORD_ PROCESS_VM_WRITE_ = 0x0020;
|
||||
const DWORD_ PROCESS_DUP_HANDLE_ = 0x0040;
|
||||
const DWORD_ PROCESS_CREATE_PROCESS_ = 0x0080;
|
||||
const DWORD_ PROCESS_SET_QUOTA_ = 0x0100;
|
||||
const DWORD_ PROCESS_SET_INFORMATION_ = 0x0200;
|
||||
const DWORD_ PROCESS_QUERY_INFORMATION_ = 0x0400;
|
||||
const DWORD_ PROCESS_SUSPEND_RESUME_ = 0x0800;
|
||||
const DWORD_ PROCESS_ALL_ACCESS_ = (STANDARD_RIGHTS_REQUIRED_ | SYNCHRONIZE_ | 0xFFF);
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
|
||||
|
||||
const DWORD_ CREATE_PRESERVE_CODE_AUTHZ_LEVEL_ = CREATE_PRESERVE_CODE_AUTHZ_LEVEL;
|
||||
|
||||
// Undocumented
|
||||
const DWORD_ CREATE_IGNORE_SYSTEM_DEFAULT_ = CREATE_IGNORE_SYSTEM_DEFAULT;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
|
||||
|
||||
const DWORD_ CREATE_PRESERVE_CODE_AUTHZ_LEVEL_ = 0x2000000;
|
||||
|
||||
// Undocumented
|
||||
const DWORD_ CREATE_IGNORE_SYSTEM_DEFAULT_ = 0x80000000;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _PROCESS_INFORMATION {
|
||||
HANDLE_ hProcess;
|
||||
HANDLE_ hThread;
|
||||
DWORD_ dwProcessId;
|
||||
DWORD_ dwThreadId;
|
||||
} PROCESS_INFORMATION_, *PPROCESS_INFORMATION_, *LPPROCESS_INFORMATION_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _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;
|
||||
LPBYTE_ lpReserved2;
|
||||
HANDLE_ hStdInput;
|
||||
HANDLE_ hStdOutput;
|
||||
HANDLE_ hStdError;
|
||||
} STARTUPINFOA_, *LPSTARTUPINFOA_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _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;
|
||||
LPBYTE_ lpReserved2;
|
||||
HANDLE_ hStdInput;
|
||||
HANDLE_ hStdOutput;
|
||||
HANDLE_ hStdError;
|
||||
} STARTUPINFOW_, *LPSTARTUPINFOW_;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
typedef struct _PROC_THREAD_ATTRIBUTE_LIST PROC_THREAD_ATTRIBUTE_LIST_, *PPROC_THREAD_ATTRIBUTE_LIST_;
|
||||
|
||||
#if !defined(BOOST_NO_ANSI_APIS)
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _STARTUPINFOEXA {
|
||||
STARTUPINFOA_ StartupInfo;
|
||||
PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
|
||||
} STARTUPINFOEXA_, *LPSTARTUPINFOEXA_;
|
||||
#endif //BOOST_NO_ANSI_APIS
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _STARTUPINFOEXW {
|
||||
STARTUPINFOW_ StartupInfo;
|
||||
PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
|
||||
} STARTUPINFOEXW_, *LPSTARTUPINFOEXW_;
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
using ::GetExitCodeProcess;
|
||||
using ::ExitProcess;
|
||||
using ::TerminateProcess;
|
||||
using ::OpenProcess;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE BOOL_ CreateProcessA(
|
||||
LPCSTR_ lpApplicationName,
|
||||
LPSTR_ lpCommandLine,
|
||||
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
|
||||
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
|
||||
INT_ bInheritHandles,
|
||||
DWORD_ dwCreationFlags,
|
||||
LPVOID_ lpEnvironment,
|
||||
LPCSTR_ lpCurrentDirectory,
|
||||
LPSTARTUPINFOA_ lpStartupInfo,
|
||||
LPPROCESS_INFORMATION_ lpProcessInformation)
|
||||
{
|
||||
return ::CreateProcessA(
|
||||
lpApplicationName,
|
||||
lpCommandLine,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
|
||||
bInheritHandles,
|
||||
dwCreationFlags,
|
||||
lpEnvironment,
|
||||
lpCurrentDirectory,
|
||||
reinterpret_cast< ::_STARTUPINFOA* >(lpStartupInfo),
|
||||
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ create_process(
|
||||
LPCSTR_ lpApplicationName,
|
||||
LPSTR_ lpCommandLine,
|
||||
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
|
||||
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
|
||||
INT_ bInheritHandles,
|
||||
DWORD_ dwCreationFlags,
|
||||
LPVOID_ lpEnvironment,
|
||||
LPCSTR_ lpCurrentDirectory,
|
||||
LPSTARTUPINFOA_ lpStartupInfo,
|
||||
LPPROCESS_INFORMATION_ lpProcessInformation)
|
||||
{
|
||||
return ::CreateProcessA(
|
||||
lpApplicationName,
|
||||
lpCommandLine,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
|
||||
bInheritHandles,
|
||||
dwCreationFlags,
|
||||
lpEnvironment,
|
||||
lpCurrentDirectory,
|
||||
reinterpret_cast< ::_STARTUPINFOA* >(lpStartupInfo),
|
||||
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ CreateProcessW(
|
||||
LPCWSTR_ lpApplicationName,
|
||||
LPWSTR_ lpCommandLine,
|
||||
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
|
||||
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
|
||||
INT_ bInheritHandles,
|
||||
DWORD_ dwCreationFlags,
|
||||
LPVOID_ lpEnvironment,
|
||||
LPCWSTR_ lpCurrentDirectory,
|
||||
LPSTARTUPINFOW_ lpStartupInfo,
|
||||
LPPROCESS_INFORMATION_ lpProcessInformation)
|
||||
{
|
||||
return ::CreateProcessW(
|
||||
lpApplicationName,
|
||||
lpCommandLine,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
|
||||
bInheritHandles,
|
||||
dwCreationFlags,
|
||||
lpEnvironment,
|
||||
lpCurrentDirectory,
|
||||
reinterpret_cast< ::_STARTUPINFOW* >(lpStartupInfo),
|
||||
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ create_process(
|
||||
LPCWSTR_ lpApplicationName,
|
||||
LPWSTR_ lpCommandLine,
|
||||
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
|
||||
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
|
||||
INT_ bInheritHandles,
|
||||
DWORD_ dwCreationFlags,
|
||||
LPVOID_ lpEnvironment,
|
||||
LPCWSTR_ lpCurrentDirectory,
|
||||
LPSTARTUPINFOW_ lpStartupInfo,
|
||||
LPPROCESS_INFORMATION_ lpProcessInformation)
|
||||
{
|
||||
return ::CreateProcessW(
|
||||
lpApplicationName,
|
||||
lpCommandLine,
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
|
||||
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
|
||||
bInheritHandles,
|
||||
dwCreationFlags,
|
||||
lpEnvironment,
|
||||
lpCurrentDirectory,
|
||||
reinterpret_cast< ::_STARTUPINFOW* >(lpStartupInfo),
|
||||
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP_
|
||||
@@ -0,0 +1,80 @@
|
||||
// security.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _ACL;
|
||||
struct _SECURITY_DESCRIPTOR;
|
||||
#if defined( BOOST_WINAPI_IS_MINGW )
|
||||
typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
|
||||
#else
|
||||
typedef boost::detail::winapi::PVOID_ PSECURITY_DESCRIPTOR;
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
InitializeSecurityDescriptor(
|
||||
PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
||||
boost::detail::winapi::DWORD_ dwRevision);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetSecurityDescriptorDacl(
|
||||
PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
||||
boost::detail::winapi::BOOL_ bDaclPresent,
|
||||
::_ACL* pDacl,
|
||||
boost::detail::winapi::BOOL_ bDaclDefaulted);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef PVOID_ PSID_;
|
||||
typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _ACL {
|
||||
BYTE_ AclRevision;
|
||||
BYTE_ Sbz1;
|
||||
WORD_ AclSize;
|
||||
WORD_ AceCount;
|
||||
WORD_ Sbz2;
|
||||
} ACL_, *PACL_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SECURITY_DESCRIPTOR {
|
||||
BYTE_ Revision;
|
||||
BYTE_ Sbz1;
|
||||
SECURITY_DESCRIPTOR_CONTROL_ Control;
|
||||
PSID_ Owner;
|
||||
PSID_ Group;
|
||||
PACL_ Sacl;
|
||||
PACL_ Dacl;
|
||||
} SECURITY_DESCRIPTOR_, *PISECURITY_DESCRIPTOR_;
|
||||
|
||||
typedef ::PSECURITY_DESCRIPTOR PSECURITY_DESCRIPTOR_;
|
||||
|
||||
using ::InitializeSecurityDescriptor;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR_ pSecurityDescriptor, BOOL_ bDaclPresent, PACL_ pDacl, BOOL_ bDaclDefaulted)
|
||||
{
|
||||
return ::SetSecurityDescriptorDacl(pSecurityDescriptor, bDaclPresent, reinterpret_cast< ::_ACL* >(pDacl), bDaclDefaulted);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||
@@ -0,0 +1,177 @@
|
||||
// semaphore.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SEMAPHORE_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SEMAPHORE_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateSemaphoreA(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::detail::winapi::LONG_ lInitialCount,
|
||||
boost::detail::winapi::LONG_ lMaximumCount,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateSemaphoreExA(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::detail::winapi::LONG_ lInitialCount,
|
||||
boost::detail::winapi::LONG_ lMaximumCount,
|
||||
boost::detail::winapi::LPCSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenSemaphoreA(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateSemaphoreW(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::detail::winapi::LONG_ lInitialCount,
|
||||
boost::detail::winapi::LONG_ lMaximumCount,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateSemaphoreExW(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::detail::winapi::LONG_ lInitialCount,
|
||||
boost::detail::winapi::LONG_ lMaximumCount,
|
||||
boost::detail::winapi::LPCWSTR_ lpName,
|
||||
boost::detail::winapi::DWORD_ dwFlags,
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenSemaphoreW(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
ReleaseSemaphore(
|
||||
boost::detail::winapi::HANDLE_ hSemaphore,
|
||||
boost::detail::winapi::LONG_ lReleaseCount,
|
||||
boost::detail::winapi::LPLONG_ lpPreviousCount);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenSemaphoreA;
|
||||
#endif
|
||||
using ::OpenSemaphoreW;
|
||||
using ::ReleaseSemaphore;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ SEMAPHORE_ALL_ACCESS_ = SEMAPHORE_ALL_ACCESS;
|
||||
const DWORD_ SEMAPHORE_MODIFY_STATE_ = SEMAPHORE_MODIFY_STATE;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ SEMAPHORE_ALL_ACCESS_ = 0x001F0003;
|
||||
const DWORD_ SEMAPHORE_MODIFY_STATE_ = 0x00000002;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// Undocumented and not present in Windows SDK. Enables NtQuerySemaphore.
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FEvent%2FNtQueryEvent.html
|
||||
const DWORD_ SEMAPHORE_QUERY_STATE_ = 0x00000001;
|
||||
|
||||
const DWORD_ semaphore_all_access = SEMAPHORE_ALL_ACCESS_;
|
||||
const DWORD_ semaphore_modify_state = SEMAPHORE_MODIFY_STATE_;
|
||||
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreA(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCSTR_ lpName)
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
return ::CreateSemaphoreExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, 0, semaphore_all_access);
|
||||
#else
|
||||
return ::CreateSemaphoreA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreExA(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
|
||||
{
|
||||
return ::CreateSemaphoreExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, dwFlags, dwDesiredAccess);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreW(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName)
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
return ::CreateSemaphoreExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, 0, semaphore_all_access);
|
||||
#else
|
||||
return ::CreateSemaphoreW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreExW(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
|
||||
{
|
||||
return ::CreateSemaphoreExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, dwFlags, dwDesiredAccess);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ create_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCSTR_ lpName)
|
||||
{
|
||||
return winapi::CreateSemaphoreA(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_semaphore(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenSemaphoreA(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName)
|
||||
{
|
||||
return winapi::CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_semaphore(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::OpenSemaphoreW(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount)
|
||||
{
|
||||
return winapi::CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SEMAPHORE_HPP
|
||||
@@ -0,0 +1,145 @@
|
||||
// shell.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SHELL_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_SHELL_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/limits.hpp>
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HICON);
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
struct _SHFILEINFOA;
|
||||
#endif
|
||||
struct _SHFILEINFOW;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_PTR_ WINAPI SHGetFileInfoA(
|
||||
boost::detail::winapi::LPCSTR_ pszPath,
|
||||
boost::detail::winapi::DWORD_ dwFileAttributes,
|
||||
::_SHFILEINFOA *psfinsigned,
|
||||
boost::detail::winapi::UINT_ cbFileInfons,
|
||||
boost::detail::winapi::UINT_ uFlags);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_PTR_ WINAPI SHGetFileInfoW(
|
||||
boost::detail::winapi::LPCWSTR_ pszPath,
|
||||
boost::detail::winapi::DWORD_ dwFileAttributes,
|
||||
::_SHFILEINFOW *psfinsigned,
|
||||
boost::detail::winapi::UINT_ cbFileInfons,
|
||||
boost::detail::winapi::UINT_ uFlags);
|
||||
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef ::HICON HICON_;
|
||||
|
||||
#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;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
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;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// These constants are only declared for _WIN32_IE >= 0x0500. We don't set IE version
|
||||
// and 5.0 is the default version since NT4 SP6, so just define the constants unconditionally.
|
||||
const DWORD_ SHGFI_ADDOVERLAYS_ = 0x000000020;
|
||||
const DWORD_ SHGFI_OVERLAYINDEX_ = 0x000000040;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SHFILEINFOA {
|
||||
HICON_ hIcon;
|
||||
int iIcon;
|
||||
DWORD_ dwAttributes;
|
||||
CHAR_ szDisplayName[MAX_PATH_];
|
||||
CHAR_ szTypeName[80];
|
||||
} SHFILEINFOA_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SHFILEINFOW {
|
||||
HICON_ hIcon;
|
||||
int iIcon;
|
||||
DWORD_ dwAttributes;
|
||||
WCHAR_ szDisplayName[MAX_PATH_];
|
||||
WCHAR_ szTypeName[80];
|
||||
} SHFILEINFOW_;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoA(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
|
||||
{
|
||||
return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
|
||||
{
|
||||
return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_ANSI_APIS
|
||||
|
||||
BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoW(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
|
||||
{
|
||||
return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
|
||||
{
|
||||
return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SHELL_HPP_
|
||||
@@ -0,0 +1,105 @@
|
||||
// show_window.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2016 Klemens D. Morgenstern
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SHOW_WINDOW_HPP_
|
||||
#define BOOST_DETAIL_WINAPI_SHOW_WINDOW_HPP_
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HWND);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ShowWindow(
|
||||
HWND hWnd,
|
||||
int nCmdShow);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ShowWindowAsync(
|
||||
HWND hWnd,
|
||||
int nCmdShow);
|
||||
}
|
||||
#endif // BOOST_USE_WINDOWS_H
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef ::HWND HWND_;
|
||||
using ::ShowWindow;
|
||||
using ::ShowWindowAsync;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H ) && !defined( NOSHOWWINDOW )
|
||||
|
||||
const DWORD_ SW_HIDE_ = SW_HIDE;
|
||||
const DWORD_ SW_SHOWNORMAL_ = SW_SHOWNORMAL;
|
||||
const DWORD_ SW_NORMAL_ = SW_NORMAL;
|
||||
const DWORD_ SW_SHOWMINIMIZED_ = SW_SHOWMINIMIZED;
|
||||
const DWORD_ SW_SHOWMAXIMIZED_ = SW_SHOWMAXIMIZED;
|
||||
const DWORD_ SW_MAXIMIZE_ = SW_MAXIMIZE;
|
||||
const DWORD_ SW_SHOWNOACTIVATE_ = SW_SHOWNOACTIVATE;
|
||||
const DWORD_ SW_SHOW_ = SW_SHOW;
|
||||
const DWORD_ SW_MINIMIZE_ = SW_MINIMIZE;
|
||||
const DWORD_ SW_SHOWMINNOACTIVE_ = SW_SHOWMINNOACTIVE;
|
||||
const DWORD_ SW_SHOWNA_ = SW_SHOWNA;
|
||||
const DWORD_ SW_RESTORE_ = SW_RESTORE;
|
||||
const DWORD_ SW_SHOWDEFAULT_ = SW_SHOWDEFAULT;
|
||||
const DWORD_ SW_FORCEMINIMIZE_ = SW_FORCEMINIMIZE;
|
||||
const DWORD_ SW_MAX_ = SW_MAX;
|
||||
const DWORD_ HIDE_WINDOW_ = HIDE_WINDOW;
|
||||
const DWORD_ SHOW_OPENWINDOW_ = SHOW_OPENWINDOW;
|
||||
const DWORD_ SHOW_ICONWINDOW_ = SHOW_ICONWINDOW;
|
||||
const DWORD_ SHOW_FULLSCREEN_ = SHOW_FULLSCREEN;
|
||||
const DWORD_ SHOW_OPENNOACTIVATE_ = SHOW_OPENNOACTIVATE;
|
||||
const DWORD_ SW_PARENTCLOSING_ = SW_PARENTCLOSING;
|
||||
const DWORD_ SW_OTHERZOOM_ = SW_OTHERZOOM;
|
||||
const DWORD_ SW_PARENTOPENING_ = SW_PARENTOPENING;
|
||||
const DWORD_ 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_PLAT_WINDOWS_DESKTOP
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SHOW_WINDOW_HPP_
|
||||
@@ -0,0 +1,116 @@
|
||||
// srw_lock.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SRW_LOCK_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SRW_LOCK_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WIN6 \
|
||||
|| (defined(_MSC_VER) && _MSC_VER < 1600)
|
||||
// Windows SDK 6.0A, which is used by MSVC 9, does not have TryAcquireSRWLock* neither in headers nor in .lib files,
|
||||
// although the functions are present in later SDKs since Windows API version 6.
|
||||
#define BOOST_WINAPI_NO_TRY_ACQUIRE_SRWLOCK
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _RTL_SRWLOCK;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
InitializeSRWLock(::_RTL_SRWLOCK* SRWLock);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
ReleaseSRWLockExclusive(::_RTL_SRWLOCK* SRWLock);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
ReleaseSRWLockShared(::_RTL_SRWLOCK* SRWLock);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
AcquireSRWLockExclusive(::_RTL_SRWLOCK* SRWLock);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
AcquireSRWLockShared(::_RTL_SRWLOCK* SRWLock);
|
||||
|
||||
#if !defined( BOOST_WINAPI_NO_TRY_ACQUIRE_SRWLOCK )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOLEAN_ WINAPI
|
||||
TryAcquireSRWLockExclusive(::_RTL_SRWLOCK* SRWLock);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOLEAN_ WINAPI
|
||||
TryAcquireSRWLockShared(::_RTL_SRWLOCK* SRWLock);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_SRWLOCK {
|
||||
PVOID_ Ptr;
|
||||
} SRWLOCK_, *PSRWLOCK_;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT SRWLOCK_INIT
|
||||
#else
|
||||
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT {0}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE VOID_ InitializeSRWLock(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
::InitializeSRWLock(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ ReleaseSRWLockExclusive(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
::ReleaseSRWLockExclusive(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ ReleaseSRWLockShared(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
::ReleaseSRWLockShared(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ AcquireSRWLockExclusive(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
::AcquireSRWLockExclusive(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE VOID_ AcquireSRWLockShared(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
::AcquireSRWLockShared(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
|
||||
#if !defined( BOOST_WINAPI_NO_TRY_ACQUIRE_SRWLOCK )
|
||||
BOOST_FORCEINLINE BOOLEAN_ TryAcquireSRWLockExclusive(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
return ::TryAcquireSRWLockExclusive(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOLEAN_ TryAcquireSRWLockShared(PSRWLOCK_ SRWLock)
|
||||
{
|
||||
return ::TryAcquireSRWLockShared(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SRW_LOCK_HPP
|
||||
@@ -0,0 +1,28 @@
|
||||
// synchronizaion.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/critical_section.hpp>
|
||||
#include <boost/detail/winapi/wait.hpp>
|
||||
#include <boost/detail/winapi/event.hpp>
|
||||
#include <boost/detail/winapi/mutex.hpp>
|
||||
#include <boost/detail/winapi/semaphore.hpp>
|
||||
#include <boost/detail/winapi/init_once.hpp>
|
||||
#include <boost/detail/winapi/srw_lock.hpp>
|
||||
#include <boost/detail/winapi/condition_variable.hpp>
|
||||
#include <boost/detail/winapi/apc.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||
@@ -0,0 +1,83 @@
|
||||
// system.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright (c) Microsoft Corporation 2014
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(push)
|
||||
// nonstandard extension used : nameless struct/union
|
||||
#pragma warning(disable: 4201)
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _SYSTEM_INFO;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
GetSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
GetNativeSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEM_INFO {
|
||||
union {
|
||||
DWORD_ dwOemId;
|
||||
struct {
|
||||
WORD_ wProcessorArchitecture;
|
||||
WORD_ wReserved;
|
||||
} DUMMYSTRUCTNAME;
|
||||
} DUMMYUNIONNAME;
|
||||
DWORD_ dwPageSize;
|
||||
LPVOID_ lpMinimumApplicationAddress;
|
||||
LPVOID_ lpMaximumApplicationAddress;
|
||||
DWORD_PTR_ dwActiveProcessorMask;
|
||||
DWORD_ dwNumberOfProcessors;
|
||||
DWORD_ dwProcessorType;
|
||||
DWORD_ dwAllocationGranularity;
|
||||
WORD_ wProcessorLevel;
|
||||
WORD_ wProcessorRevision;
|
||||
} SYSTEM_INFO_, *LPSYSTEM_INFO_;
|
||||
|
||||
BOOST_FORCEINLINE VOID_ GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
|
||||
{
|
||||
::GetSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
BOOST_FORCEINLINE VOID_ GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
|
||||
{
|
||||
::GetNativeSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||
@@ -0,0 +1,42 @@
|
||||
// thread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||
#define BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/get_current_thread.hpp>
|
||||
#include <boost/detail/winapi/get_current_thread_id.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
SleepEx(
|
||||
boost::detail::winapi::DWORD_ dwMilliseconds,
|
||||
boost::detail::winapi::BOOL_ bAlertable);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI Sleep(boost::detail::winapi::DWORD_ dwMilliseconds);
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SwitchToThread(BOOST_DETAIL_WINAPI_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
using ::SleepEx;
|
||||
using ::Sleep;
|
||||
using ::SwitchToThread;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||
@@ -0,0 +1,126 @@
|
||||
// thread_pool.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
|
||||
#define BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
|
||||
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
typedef boost::detail::winapi::VOID_ (NTAPI *WAITORTIMERCALLBACKFUNC)
|
||||
(boost::detail::winapi::PVOID_, boost::detail::winapi::BOOLEAN_);
|
||||
typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
RegisterWaitForSingleObject(
|
||||
boost::detail::winapi::PHANDLE_ phNewWaitObject,
|
||||
boost::detail::winapi::HANDLE_ hObject,
|
||||
WAITORTIMERCALLBACK Callback,
|
||||
boost::detail::winapi::PVOID_ Context,
|
||||
boost::detail::winapi::ULONG_ dwMilliseconds,
|
||||
boost::detail::winapi::ULONG_ dwFlags);
|
||||
}
|
||||
#endif
|
||||
|
||||
// MinGW is buggy - it is missing these function declarations for Win2000
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) || (defined(BOOST_WINAPI_IS_MINGW) && BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP)
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
UnregisterWait(boost::detail::winapi::HANDLE_ WaitHandle);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
UnregisterWaitEx(
|
||||
boost::detail::winapi::HANDLE_ WaitHandle,
|
||||
boost::detail::winapi::HANDLE_ CompletionEvent);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_;
|
||||
typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_;
|
||||
|
||||
using ::RegisterWaitForSingleObject;
|
||||
using ::UnregisterWait;
|
||||
using ::UnregisterWaitEx;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const ULONG_ WT_EXECUTEDEFAULT_ = WT_EXECUTEDEFAULT;
|
||||
const ULONG_ WT_EXECUTEINIOTHREAD_ = WT_EXECUTEINIOTHREAD;
|
||||
#if defined( BOOST_WINAPI_IS_MINGW )
|
||||
const ULONG_ WT_EXECUTEINUITHREAD_ = 0x00000002;
|
||||
#else
|
||||
const ULONG_ WT_EXECUTEINUITHREAD_ = WT_EXECUTEINUITHREAD;
|
||||
#endif
|
||||
const ULONG_ WT_EXECUTEINWAITTHREAD_ = WT_EXECUTEINWAITTHREAD;
|
||||
const ULONG_ WT_EXECUTEONLYONCE_ = WT_EXECUTEONLYONCE;
|
||||
const ULONG_ WT_EXECUTEINTIMERTHREAD_ = WT_EXECUTEINTIMERTHREAD;
|
||||
const ULONG_ WT_EXECUTELONGFUNCTION_ = WT_EXECUTELONGFUNCTION;
|
||||
#if defined( BOOST_WINAPI_IS_MINGW )
|
||||
const ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = 0x00000040;
|
||||
#else
|
||||
const ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = WT_EXECUTEINPERSISTENTIOTHREAD;
|
||||
#endif
|
||||
const ULONG_ WT_EXECUTEINPERSISTENTTHREAD_ = WT_EXECUTEINPERSISTENTTHREAD;
|
||||
const ULONG_ WT_TRANSFER_IMPERSONATION_ = WT_TRANSFER_IMPERSONATION;
|
||||
|
||||
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
|
||||
{
|
||||
return WT_SET_MAX_THREADPOOL_THREADS(flags, limit);
|
||||
}
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const ULONG_ WT_EXECUTEDEFAULT_ = 0x00000000;
|
||||
const ULONG_ WT_EXECUTEINIOTHREAD_ = 0x00000001;
|
||||
const ULONG_ WT_EXECUTEINUITHREAD_ = 0x00000002;
|
||||
const ULONG_ WT_EXECUTEINWAITTHREAD_ = 0x00000004;
|
||||
const ULONG_ WT_EXECUTEONLYONCE_ = 0x00000008;
|
||||
const ULONG_ WT_EXECUTEINTIMERTHREAD_ = 0x00000020;
|
||||
const ULONG_ WT_EXECUTELONGFUNCTION_ = 0x00000010;
|
||||
const ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = 0x00000040;
|
||||
const ULONG_ WT_EXECUTEINPERSISTENTTHREAD_ = 0x00000080;
|
||||
const ULONG_ WT_TRANSFER_IMPERSONATION_ = 0x00000100;
|
||||
|
||||
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
|
||||
{
|
||||
return flags | (limit << 16);
|
||||
}
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const ULONG_ wt_execute_default = WT_EXECUTEDEFAULT_;
|
||||
const ULONG_ wt_execute_in_io_thread = WT_EXECUTEINIOTHREAD_;
|
||||
const ULONG_ wt_execute_in_ui_thread = WT_EXECUTEINUITHREAD_;
|
||||
const ULONG_ wt_execute_in_wait_thread = WT_EXECUTEINWAITTHREAD_;
|
||||
const ULONG_ wt_execute_only_once = WT_EXECUTEONLYONCE_;
|
||||
const ULONG_ wt_execute_in_timer_thread = WT_EXECUTEINTIMERTHREAD_;
|
||||
const ULONG_ wt_execute_long_function = WT_EXECUTELONGFUNCTION_;
|
||||
const ULONG_ wt_execute_in_persistent_io_thread = WT_EXECUTEINPERSISTENTIOTHREAD_;
|
||||
const ULONG_ wt_execute_in_persistent_thread = WT_EXECUTEINPERSISTENTTHREAD_;
|
||||
const ULONG_ wt_transfer_impersonation = WT_TRANSFER_IMPERSONATION_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
|
||||
@@ -0,0 +1,139 @@
|
||||
// time.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright (c) Microsoft Corporation 2014
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TIME_HPP
|
||||
#define BOOST_DETAIL_WINAPI_TIME_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/predef/platform.h>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _FILETIME;
|
||||
struct _SYSTEMTIME;
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
GetSystemTime(::_SYSTEMTIME* lpSystemTime);
|
||||
|
||||
#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
|
||||
GetSystemTimeAsFileTime(::_FILETIME* lpSystemTimeAsFileTime);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SystemTimeToFileTime(
|
||||
const ::_SYSTEMTIME* lpSystemTime,
|
||||
::_FILETIME* lpFileTime);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FileTimeToSystemTime(
|
||||
const ::_FILETIME* lpFileTime,
|
||||
::_SYSTEMTIME* lpSystemTime);
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
FileTimeToLocalFileTime(
|
||||
const ::_FILETIME* lpFileTime,
|
||||
::_FILETIME* lpLocalFileTime);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
LocalFileTimeToFileTime(
|
||||
const ::_FILETIME* lpLocalFileTime,
|
||||
::_FILETIME* lpFileTime);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
GetTickCount(BOOST_DETAIL_WINAPI_VOID);
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::ULONGLONG_ WINAPI
|
||||
GetTickCount64(BOOST_DETAIL_WINAPI_VOID);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _FILETIME {
|
||||
DWORD_ dwLowDateTime;
|
||||
DWORD_ dwHighDateTime;
|
||||
} FILETIME_, *PFILETIME_, *LPFILETIME_;
|
||||
|
||||
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEMTIME {
|
||||
WORD_ wYear;
|
||||
WORD_ wMonth;
|
||||
WORD_ wDayOfWeek;
|
||||
WORD_ wDay;
|
||||
WORD_ wHour;
|
||||
WORD_ wMinute;
|
||||
WORD_ wSecond;
|
||||
WORD_ wMilliseconds;
|
||||
} SYSTEMTIME_, *PSYSTEMTIME_, *LPSYSTEMTIME_;
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
using ::GetTickCount;
|
||||
#endif
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
using ::GetTickCount64;
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE VOID_ GetSystemTime(LPSYSTEMTIME_ lpSystemTime)
|
||||
{
|
||||
::GetSystemTime(reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
|
||||
}
|
||||
|
||||
#if defined( BOOST_HAS_GETSYSTEMTIMEASFILETIME )
|
||||
BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(LPFILETIME_ lpSystemTimeAsFileTime)
|
||||
{
|
||||
::GetSystemTimeAsFileTime(reinterpret_cast< ::_FILETIME* >(lpSystemTimeAsFileTime));
|
||||
}
|
||||
#else
|
||||
// Windows CE does not define GetSystemTimeAsFileTime
|
||||
BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
|
||||
{
|
||||
boost::detail::winapi::SYSTEMTIME_ st;
|
||||
boost::detail::winapi::GetSystemTime(&st);
|
||||
boost::detail::winapi::SystemTimeToFileTime(&st, lpFileTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime)
|
||||
{
|
||||
return ::SystemTimeToFileTime(reinterpret_cast< const ::_SYSTEMTIME* >(lpSystemTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ FileTimeToSystemTime(const FILETIME_* lpFileTime, SYSTEMTIME_* lpSystemTime)
|
||||
{
|
||||
return ::FileTimeToSystemTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
|
||||
}
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_DESKTOP
|
||||
BOOST_FORCEINLINE BOOL_ FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime)
|
||||
{
|
||||
return ::FileTimeToLocalFileTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_FILETIME* >(lpLocalFileTime));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ LocalFileTimeToFileTime(const FILETIME_* lpLocalFileTime, FILETIME_* lpFileTime)
|
||||
{
|
||||
return ::LocalFileTimeToFileTime(reinterpret_cast< const ::_FILETIME* >(lpLocalFileTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_TIME_HPP
|
||||
@@ -0,0 +1,48 @@
|
||||
// timers.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ QueryPerformanceCounter(LARGE_INTEGER_* lpPerformanceCount)
|
||||
{
|
||||
return ::QueryPerformanceCounter(reinterpret_cast< ::_LARGE_INTEGER* >(lpPerformanceCount));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ QueryPerformanceFrequency(LARGE_INTEGER_* lpFrequency)
|
||||
{
|
||||
return ::QueryPerformanceFrequency(reinterpret_cast< ::_LARGE_INTEGER* >(lpFrequency));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||
@@ -0,0 +1,60 @@
|
||||
// tls.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TLS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_TLS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( UNDER_CE )
|
||||
// Windows CE define TlsAlloc and TlsFree as inline functions in kfuncs.h
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
TlsAlloc(BOOST_DETAIL_WINAPI_VOID);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
TlsFree(boost::detail::winapi::DWORD_ dwTlsIndex);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
|
||||
TlsGetValue(boost::detail::winapi::DWORD_ dwTlsIndex);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
TlsSetValue(
|
||||
boost::detail::winapi::DWORD_ dwTlsIndex,
|
||||
boost::detail::winapi::LPVOID_ lpTlsValue);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
using ::TlsAlloc;
|
||||
using ::TlsFree;
|
||||
using ::TlsGetValue;
|
||||
using ::TlsSetValue;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
const DWORD_ TLS_OUT_OF_INDEXES_ = TLS_OUT_OF_INDEXES;
|
||||
#else
|
||||
const DWORD_ TLS_OUT_OF_INDEXES_ = 0xFFFFFFFF;
|
||||
#endif
|
||||
|
||||
const DWORD_ tls_out_of_indexes = TLS_OUT_OF_INDEXES_;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_TLS_HPP
|
||||
@@ -0,0 +1,84 @@
|
||||
// wait.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
// Copyright 2015 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_WAIT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_WAIT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
WaitForSingleObject(
|
||||
boost::detail::winapi::HANDLE_ hHandle,
|
||||
boost::detail::winapi::DWORD_ dwMilliseconds);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
WaitForMultipleObjects(
|
||||
boost::detail::winapi::DWORD_ nCount,
|
||||
boost::detail::winapi::HANDLE_ const* lpHandles,
|
||||
boost::detail::winapi::BOOL_ bWaitAll,
|
||||
boost::detail::winapi::DWORD_ dwMilliseconds);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
|
||||
SignalObjectAndWait(
|
||||
boost::detail::winapi::HANDLE_ hObjectToSignal,
|
||||
boost::detail::winapi::HANDLE_ hObjectToWaitOn,
|
||||
boost::detail::winapi::DWORD_ dwMilliseconds,
|
||||
boost::detail::winapi::BOOL_ bAlertable);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
using ::WaitForMultipleObjects;
|
||||
using ::WaitForSingleObject;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
using ::SignalObjectAndWait;
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ INFINITE_ = INFINITE;
|
||||
const DWORD_ WAIT_ABANDONED_ = WAIT_ABANDONED;
|
||||
const DWORD_ WAIT_OBJECT_0_ = WAIT_OBJECT_0;
|
||||
const DWORD_ WAIT_TIMEOUT_ = WAIT_TIMEOUT;
|
||||
const DWORD_ WAIT_FAILED_ = WAIT_FAILED;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ INFINITE_ = (DWORD_)0xFFFFFFFF;
|
||||
const DWORD_ WAIT_ABANDONED_ = 0x00000080L;
|
||||
const DWORD_ WAIT_OBJECT_0_ = 0x00000000L;
|
||||
const DWORD_ WAIT_TIMEOUT_ = 0x00000102L;
|
||||
const DWORD_ WAIT_FAILED_ = (DWORD_)0xFFFFFFFF;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ infinite = INFINITE_;
|
||||
const DWORD_ wait_abandoned = WAIT_ABANDONED_;
|
||||
const DWORD_ wait_object_0 = WAIT_OBJECT_0_;
|
||||
const DWORD_ wait_timeout = WAIT_TIMEOUT_;
|
||||
const DWORD_ wait_failed = WAIT_FAILED_;
|
||||
|
||||
const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_WAIT_HPP
|
||||
@@ -0,0 +1,145 @@
|
||||
// waitable_timer.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
|
||||
#define BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
typedef boost::detail::winapi::VOID_
|
||||
(WINAPI *PTIMERAPCROUTINE)(
|
||||
boost::detail::winapi::LPVOID_ lpArgToCompletionRoutine,
|
||||
boost::detail::winapi::DWORD_ dwTimerLowValue,
|
||||
boost::detail::winapi::DWORD_ dwTimerHighValue);
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateWaitableTimerA(
|
||||
::_SECURITY_ATTRIBUTES* lpTimerAttributes,
|
||||
boost::detail::winapi::BOOL_ bManualReset,
|
||||
boost::detail::winapi::LPCSTR_ lpTimerName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenWaitableTimerA(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCSTR_ lpTimerName);
|
||||
#endif
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
CreateWaitableTimerW(
|
||||
::_SECURITY_ATTRIBUTES* lpTimerAttributes,
|
||||
boost::detail::winapi::BOOL_ bManualReset,
|
||||
boost::detail::winapi::LPCWSTR_ lpTimerName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
|
||||
OpenWaitableTimerW(
|
||||
boost::detail::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::detail::winapi::BOOL_ bInheritHandle,
|
||||
boost::detail::winapi::LPCWSTR_ lpTimerName);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
SetWaitableTimer(
|
||||
boost::detail::winapi::HANDLE_ hTimer,
|
||||
const ::_LARGE_INTEGER* lpDueTime,
|
||||
boost::detail::winapi::LONG_ lPeriod,
|
||||
PTIMERAPCROUTINE pfnCompletionRoutine,
|
||||
boost::detail::winapi::LPVOID_ lpArgToCompletionRoutine,
|
||||
boost::detail::winapi::BOOL_ fResume);
|
||||
|
||||
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
|
||||
CancelWaitableTimer(boost::detail::winapi::HANDLE_ hTimer);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_;
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenWaitableTimerA;
|
||||
#endif
|
||||
using ::OpenWaitableTimerW;
|
||||
using ::CancelWaitableTimer;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ TIMER_ALL_ACCESS_ = TIMER_ALL_ACCESS;
|
||||
const DWORD_ TIMER_MODIFY_STATE_ = TIMER_MODIFY_STATE;
|
||||
const DWORD_ TIMER_QUERY_STATE_ = TIMER_QUERY_STATE;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ TIMER_ALL_ACCESS_ = 0x001F0003;
|
||||
const DWORD_ TIMER_MODIFY_STATE_ = 0x00000002;
|
||||
const DWORD_ TIMER_QUERY_STATE_ = 0x00000001;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ timer_all_access = TIMER_ALL_ACCESS_;
|
||||
const DWORD_ timer_modify_state = TIMER_MODIFY_STATE_;
|
||||
const DWORD_ timer_query_state = TIMER_QUERY_STATE_;
|
||||
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ CreateWaitableTimerA(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCSTR_ lpTimerName)
|
||||
{
|
||||
return ::CreateWaitableTimerA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateWaitableTimerW(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCWSTR_ lpTimerName)
|
||||
{
|
||||
return ::CreateWaitableTimerW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ SetWaitableTimer(
|
||||
HANDLE_ hTimer,
|
||||
const LARGE_INTEGER_* lpDueTime,
|
||||
LONG_ lPeriod,
|
||||
PTIMERAPCROUTINE_ pfnCompletionRoutine,
|
||||
LPVOID_ lpArgToCompletionRoutine,
|
||||
BOOL_ fResume)
|
||||
{
|
||||
return ::SetWaitableTimer(hTimer, reinterpret_cast< const ::_LARGE_INTEGER* >(lpDueTime), lPeriod, pfnCompletionRoutine, lpArgToCompletionRoutine, fResume);
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_FORCEINLINE HANDLE_ create_waitable_timer(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCSTR_ lpTimerName)
|
||||
{
|
||||
return ::CreateWaitableTimerA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_waitable_timer(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCWSTR_ lpTimerName)
|
||||
{
|
||||
return ::CreateWaitableTimerW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset)
|
||||
{
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
return ::CreateWaitableTimerW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, 0);
|
||||
#else
|
||||
return ::CreateWaitableTimerA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
|
||||
Reference in New Issue
Block a user