mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-19 14:36:36 -05:00
policy_cache.hpp
This commit is contained in:
parent
f5c5a1a991
commit
8183fc5114
2054 changed files with 473146 additions and 1 deletions
274
src/boost/winapi/basic_types.hpp
Normal file
274
src/boost/winapi/basic_types.hpp
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright 2015-2018 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_BASIC_TYPES_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_BASIC_TYPES_HPP_INCLUDED_
|
||||
|
||||
#include <boost/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__)
|
||||
# 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;
|
||||
typedef HANDLE HGLOBAL;
|
||||
typedef void* LPVOID;
|
||||
# include <kfuncs.h>
|
||||
# endif // UNDER_CE
|
||||
#else
|
||||
# error "Win32 functions not available"
|
||||
#endif
|
||||
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#if defined(_M_IX86) || defined(__i386__)
|
||||
#define BOOST_WINAPI_DETAIL_STDCALL __stdcall
|
||||
#else
|
||||
// On architectures other than 32-bit x86 __stdcall is ignored. Clang also issues a warning.
|
||||
#define BOOST_WINAPI_DETAIL_STDCALL
|
||||
#endif
|
||||
|
||||
#if defined(WINAPI)
|
||||
#define BOOST_WINAPI_WINAPI_CC WINAPI
|
||||
#else
|
||||
#define BOOST_WINAPI_WINAPI_CC BOOST_WINAPI_DETAIL_STDCALL
|
||||
#endif
|
||||
|
||||
#if defined(CALLBACK)
|
||||
#define BOOST_WINAPI_CALLBACK_CC CALLBACK
|
||||
#else
|
||||
#define BOOST_WINAPI_CALLBACK_CC BOOST_WINAPI_DETAIL_STDCALL
|
||||
#endif
|
||||
|
||||
#if defined(NTAPI)
|
||||
#define BOOST_WINAPI_NTAPI_CC NTAPI
|
||||
#else
|
||||
#define BOOST_WINAPI_NTAPI_CC BOOST_WINAPI_DETAIL_STDCALL
|
||||
#endif
|
||||
|
||||
#ifndef NO_STRICT
|
||||
#ifndef STRICT
|
||||
#define STRICT 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(STRICT)
|
||||
#define BOOST_WINAPI_DETAIL_DECLARE_HANDLE(x) struct x##__; typedef struct x##__ *x
|
||||
#else
|
||||
#define BOOST_WINAPI_DETAIL_DECLARE_HANDLE(x) typedef void* x
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_USE_WINDOWS_H)
|
||||
extern "C" {
|
||||
union _LARGE_INTEGER;
|
||||
struct _SECURITY_ATTRIBUTES;
|
||||
BOOST_WINAPI_DETAIL_DECLARE_HANDLE(HINSTANCE);
|
||||
typedef HINSTANCE HMODULE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define BOOST_WINAPI_DETAIL_EXTENSION __extension__
|
||||
#else
|
||||
#define BOOST_WINAPI_DETAIL_EXTENSION
|
||||
#endif
|
||||
|
||||
// MinGW64 gcc 4.8.2 fails to compile function declarations with boost::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_WINAPI_DETAIL_VOID void
|
||||
|
||||
namespace boost {
|
||||
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 ::UCHAR UCHAR_;
|
||||
typedef ::PUCHAR PUCHAR_;
|
||||
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 ULONG64_;
|
||||
typedef ::ULONGLONG PULONG64_;
|
||||
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 unsigned char UCHAR_;
|
||||
typedef UCHAR_* PUCHAR_;
|
||||
typedef BYTE_ BOOLEAN_;
|
||||
typedef BOOLEAN_* PBOOLEAN_;
|
||||
typedef unsigned short WORD_;
|
||||
typedef WORD_* PWORD_;
|
||||
typedef WORD_* LPWORD_;
|
||||
#if !defined(__LP64__)
|
||||
typedef unsigned long DWORD_;
|
||||
#else
|
||||
typedef unsigned int DWORD_;
|
||||
#endif
|
||||
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_;
|
||||
#if !defined(__LP64__)
|
||||
typedef long LONG_;
|
||||
typedef unsigned long ULONG_;
|
||||
#else
|
||||
typedef int LONG_;
|
||||
typedef unsigned int ULONG_;
|
||||
#endif
|
||||
typedef LONG_* PLONG_;
|
||||
typedef LONG_* LPLONG_;
|
||||
typedef ULONG_* PULONG_;
|
||||
#if defined(BOOST_HAS_MS_INT64)
|
||||
BOOST_WINAPI_DETAIL_EXTENSION typedef __int64 LONGLONG_;
|
||||
BOOST_WINAPI_DETAIL_EXTENSION typedef unsigned __int64 ULONGLONG_;
|
||||
#else
|
||||
BOOST_WINAPI_DETAIL_EXTENSION typedef long long LONGLONG_;
|
||||
BOOST_WINAPI_DETAIL_EXTENSION typedef unsigned long long ULONGLONG_;
|
||||
#endif
|
||||
typedef LONGLONG_ LONG64_, *PLONG64_;
|
||||
typedef ULONGLONG_ ULONG64_, *PULONG64_;
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef LONGLONG_ INT_PTR_;
|
||||
typedef ULONGLONG_ UINT_PTR_;
|
||||
typedef LONGLONG_ LONG_PTR_;
|
||||
typedef ULONGLONG_ ULONG_PTR_;
|
||||
#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 )
|
||||
|
||||
// ::NTSTATUS is defined in ntdef.h or winternl.h in different Windows SDKs, and is not included by windows.h by default, so always use LONG_
|
||||
typedef LONG_ NTSTATUS_;
|
||||
typedef NTSTATUS_ *PNTSTATUS_;
|
||||
|
||||
typedef ::HMODULE HMODULE_;
|
||||
|
||||
typedef union BOOST_MAY_ALIAS _LARGE_INTEGER {
|
||||
BOOST_WINAPI_DETAIL_EXTENSION struct {
|
||||
DWORD_ LowPart;
|
||||
LONG_ HighPart;
|
||||
};
|
||||
struct {
|
||||
DWORD_ LowPart;
|
||||
LONG_ HighPart;
|
||||
} u;
|
||||
LONGLONG_ QuadPart;
|
||||
} LARGE_INTEGER_, *PLARGE_INTEGER_;
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _SECURITY_ATTRIBUTES {
|
||||
DWORD_ nLength;
|
||||
LPVOID_ lpSecurityDescriptor;
|
||||
BOOL_ bInheritHandle;
|
||||
} SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_BASIC_TYPES_HPP_INCLUDED_
|
||||
251
src/boost/winapi/config.hpp
Normal file
251
src/boost/winapi/config.hpp
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
/*
|
||||
* Copyright 2013, 2017 Andrey Semashev
|
||||
* Copyright 2017 James E. King, III
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/platform.h>
|
||||
#if defined(__CYGWIN__)
|
||||
// Cygwin 64 compiler does not define _WIN64 and instead defines it in a private header. We can't define _WIN64 ourselves because
|
||||
// the header defines the macro unconditionally and if the user includes both Boost.WinAPI and Cygwin WinAPI headers there will be conflict.
|
||||
#include <_cygwin.h>
|
||||
#endif
|
||||
#if defined(__MINGW32__)
|
||||
// MinGW and MinGW-w64 define __MINGW32_VERSION_MAJOR/MINOR and __MINGW64_VERSION_MAJOR/MINOR macros in a private header.
|
||||
#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).
|
||||
// BOOST_WINAPI_IS_CYGWIN indicates that the target Windows SDK is provided by MinGW variant from Cygwin (https://cygwin.com/).
|
||||
#if defined(__CYGWIN__)
|
||||
#define BOOST_WINAPI_IS_CYGWIN
|
||||
#elif BOOST_PLAT_MINGW
|
||||
#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
|
||||
|
||||
// These constants reflect NTDDI_* macros from sdkddkver.h
|
||||
#define BOOST_WINAPI_NTDDI_WIN2K 0x05000000
|
||||
#define BOOST_WINAPI_NTDDI_WIN2KSP1 0x05000100
|
||||
#define BOOST_WINAPI_NTDDI_WIN2KSP2 0x05000200
|
||||
#define BOOST_WINAPI_NTDDI_WIN2KSP3 0x05000300
|
||||
#define BOOST_WINAPI_NTDDI_WIN2KSP4 0x05000400
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_WINXP 0x05010000
|
||||
#define BOOST_WINAPI_NTDDI_WINXPSP1 0x05010100
|
||||
#define BOOST_WINAPI_NTDDI_WINXPSP2 0x05010200
|
||||
#define BOOST_WINAPI_NTDDI_WINXPSP3 0x05010300
|
||||
#define BOOST_WINAPI_NTDDI_WINXPSP4 0x05010400
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_WS03 0x05020000
|
||||
#define BOOST_WINAPI_NTDDI_WS03SP1 0x05020100
|
||||
#define BOOST_WINAPI_NTDDI_WS03SP2 0x05020200
|
||||
#define BOOST_WINAPI_NTDDI_WS03SP3 0x05020300
|
||||
#define BOOST_WINAPI_NTDDI_WS03SP4 0x05020400
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_WIN6 0x06000000
|
||||
#define BOOST_WINAPI_NTDDI_WIN6SP1 0x06000100
|
||||
#define BOOST_WINAPI_NTDDI_WIN6SP2 0x06000200
|
||||
#define BOOST_WINAPI_NTDDI_WIN6SP3 0x06000300
|
||||
#define BOOST_WINAPI_NTDDI_WIN6SP4 0x06000400
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_VISTA BOOST_WINAPI_NTDDI_WIN6
|
||||
#define BOOST_WINAPI_NTDDI_VISTASP1 BOOST_WINAPI_NTDDI_WIN6SP1
|
||||
#define BOOST_WINAPI_NTDDI_VISTASP2 BOOST_WINAPI_NTDDI_WIN6SP2
|
||||
#define BOOST_WINAPI_NTDDI_VISTASP3 BOOST_WINAPI_NTDDI_WIN6SP3
|
||||
#define BOOST_WINAPI_NTDDI_VISTASP4 BOOST_WINAPI_NTDDI_WIN6SP4
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_LONGHORN BOOST_WINAPI_NTDDI_VISTA
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_WS08 BOOST_WINAPI_NTDDI_WIN6SP1
|
||||
#define BOOST_WINAPI_NTDDI_WS08SP2 BOOST_WINAPI_NTDDI_WIN6SP2
|
||||
#define BOOST_WINAPI_NTDDI_WS08SP3 BOOST_WINAPI_NTDDI_WIN6SP3
|
||||
#define BOOST_WINAPI_NTDDI_WS08SP4 BOOST_WINAPI_NTDDI_WIN6SP4
|
||||
|
||||
#define BOOST_WINAPI_NTDDI_WIN7 0x06010000
|
||||
#define BOOST_WINAPI_NTDDI_WIN7SP1 0x06010100 // Not defined in Windows SDK
|
||||
#define BOOST_WINAPI_NTDDI_WIN8 0x06020000
|
||||
#define BOOST_WINAPI_NTDDI_WINBLUE 0x06030000
|
||||
#define BOOST_WINAPI_NTDDI_WINTHRESHOLD 0x0A000000
|
||||
#define BOOST_WINAPI_NTDDI_WIN10 0x0A000000
|
||||
#define BOOST_WINAPI_NTDDI_WIN10_TH2 0x0A000001
|
||||
#define BOOST_WINAPI_NTDDI_WIN10_RS1 0x0A000002
|
||||
#define BOOST_WINAPI_NTDDI_WIN10_RS2 0x0A000003
|
||||
#define BOOST_WINAPI_NTDDI_WIN10_RS3 0x0A000004
|
||||
|
||||
#define BOOST_WINAPI_DETAIL_MAKE_NTDDI_VERSION2(x) x##0000
|
||||
#define BOOST_WINAPI_DETAIL_MAKE_NTDDI_VERSION(x) BOOST_WINAPI_DETAIL_MAKE_NTDDI_VERSION2(x)
|
||||
|
||||
#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 10 API on compilers that support it and latest versions on the others
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1500) || defined(BOOST_WINAPI_IS_MINGW)
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP
|
||||
#elif (defined(_MSC_VER) && _MSC_VER < 1600)
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN6
|
||||
#elif (defined(_MSC_VER) && _MSC_VER < 1700)
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN7
|
||||
#elif (defined(_MSC_VER) && _MSC_VER < 1800)
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN8
|
||||
#elif (defined(_MSC_VER) && _MSC_VER < 1900)
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINBLUE
|
||||
#else
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN10
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_USE_NTDDI_VERSION)
|
||||
#if defined(NTDDI_VERSION)
|
||||
#define BOOST_USE_NTDDI_VERSION NTDDI_VERSION
|
||||
// Default to respective Windows version with the latest Service Pack
|
||||
#elif BOOST_USE_WINAPI_VERSION == BOOST_WINAPI_VERSION_WIN2K
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_NTDDI_WIN2KSP4
|
||||
#elif BOOST_USE_WINAPI_VERSION == BOOST_WINAPI_VERSION_WINXP
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_NTDDI_WINXPSP3
|
||||
#elif BOOST_USE_WINAPI_VERSION == BOOST_WINAPI_VERSION_WS03
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_NTDDI_WS03SP2
|
||||
#elif BOOST_USE_WINAPI_VERSION == BOOST_WINAPI_VERSION_WIN6
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_NTDDI_WIN6SP2
|
||||
#elif BOOST_USE_WINAPI_VERSION == BOOST_WINAPI_VERSION_WIN7
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_NTDDI_WIN7SP1
|
||||
#elif BOOST_USE_WINAPI_VERSION == BOOST_WINAPI_VERSION_WIN10
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_NTDDI_WIN10_RS3
|
||||
#else
|
||||
#define BOOST_USE_NTDDI_VERSION BOOST_WINAPI_DETAIL_MAKE_NTDDI_VERSION(BOOST_USE_WINAPI_VERSION)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Known Windows SDK versions, taken from VER_PRODUCTBUILD macro value defined in ntverp.h.
|
||||
// These values can be used to compare with BOOST_PLAT_WINDOWS_SDK_VERSION from Boost.Predef.
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_MSVC71 BOOST_VERSION_NUMBER(0, 0, 3668) // Windows SDK bundled with MSVC 7.1
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_MSVC8 BOOST_VERSION_NUMBER(0, 0, 3790) // Windows SDK bundled with MSVC 8
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_6_0 BOOST_VERSION_NUMBER(0, 0, 6000) // Windows SDK 6.0
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_7_0 BOOST_VERSION_NUMBER(0, 0, 7600) // Windows SDK 7.0, 7.1
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_8_0 BOOST_VERSION_NUMBER(0, 0, 9200) // Windows SDK 8.0
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_8_1 BOOST_VERSION_NUMBER(0, 0, 9600) // Windows SDK 8.1
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_10_0 BOOST_VERSION_NUMBER(0, 0, 10011) // Windows SDK 10.0
|
||||
// MinGW does not have the ntverp.h header but it defines VER_PRODUCTBUILD in ddk/ntifs.h.
|
||||
// Cygwin MinGW also defines this version.
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_MINGW BOOST_VERSION_NUMBER(0, 0, 10000)
|
||||
// MinGW-w64 defines the same version as the Windows SDK bundled with MSVC 8
|
||||
#define BOOST_WINAPI_WINDOWS_SDK_MINGW_W64 BOOST_VERSION_NUMBER(0, 0, 3790)
|
||||
|
||||
#if !defined(BOOST_USE_WINAPI_FAMILY)
|
||||
#if defined(WINAPI_FAMILY)
|
||||
#define BOOST_USE_WINAPI_FAMILY WINAPI_FAMILY
|
||||
#elif defined(WINAPI_FAMILY_DESKTOP_APP)
|
||||
// If none is specified, default to a desktop application which is the most
|
||||
// backwards compatible to previous ways of doing things, if families are even
|
||||
// defined.
|
||||
#define BOOST_USE_WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// UWP Support
|
||||
//
|
||||
// On platforms without windows family partition support it is assumed one
|
||||
// has all APIs and access is controlled by _WIN32_WINNT or similar mechanisms.
|
||||
//
|
||||
// Leveraging Boost.Predef here
|
||||
//
|
||||
#if BOOST_PLAT_WINDOWS_UWP
|
||||
#define BOOST_WINAPI_PARTITION_APP (BOOST_PLAT_WINDOWS_DESKTOP || BOOST_PLAT_WINDOWS_STORE || BOOST_WINAPI_PARTITION_PHONE)
|
||||
#define BOOST_WINAPI_PARTITION_PC (BOOST_PLAT_WINDOWS_STORE)
|
||||
#define BOOST_WINAPI_PARTITION_PHONE (BOOST_PLAT_WINDOWS_PHONE)
|
||||
#define BOOST_WINAPI_PARTITION_SYSTEM (BOOST_PLAT_WINDOWS_SYSTEM)
|
||||
#define BOOST_WINAPI_PARTITION_SERVER (BOOST_PLAT_WINDOWS_SERVER)
|
||||
#define BOOST_WINAPI_PARTITION_DESKTOP (BOOST_PLAT_WINDOWS_DESKTOP)
|
||||
#else // BOOST_PLAT_WINDOWS_UWP
|
||||
#define BOOST_WINAPI_PARTITION_APP (1)
|
||||
#define BOOST_WINAPI_PARTITION_PC (1)
|
||||
#define BOOST_WINAPI_PARTITION_PHONE (1)
|
||||
#define BOOST_WINAPI_PARTITION_SYSTEM (1)
|
||||
#define BOOST_WINAPI_PARTITION_SERVER (1)
|
||||
#define BOOST_WINAPI_PARTITION_DESKTOP (1)
|
||||
#endif // BOOST_PLAT_WINDOWS_UWP
|
||||
|
||||
//
|
||||
// Windows 8.x SDK defines some items in the DESKTOP partition and then Windows SDK 10.0 defines
|
||||
// the same items to be in APP or SYSTEM partitions, and APP expands to DESKTOP or PC or PHONE.
|
||||
// The definition of BOOST_WINAPI_PARTITION_APP_SYSTEM provides a universal way to get this
|
||||
// right as it is seen in a number of places in the SDK.
|
||||
//
|
||||
#define BOOST_WINAPI_PARTITION_APP_SYSTEM \
|
||||
( \
|
||||
((BOOST_PLAT_WINDOWS_SDK_VERSION >= BOOST_WINAPI_WINDOWS_SDK_10_0) && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)) || \
|
||||
((BOOST_PLAT_WINDOWS_SDK_VERSION < BOOST_WINAPI_WINDOWS_SDK_10_0) && BOOST_WINAPI_PARTITION_DESKTOP) \
|
||||
)
|
||||
|
||||
// Simiarly, some other symbols were re-classified as DESKTOP or SYSTEM
|
||||
#define BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM \
|
||||
( \
|
||||
((BOOST_PLAT_WINDOWS_SDK_VERSION >= BOOST_WINAPI_WINDOWS_SDK_10_0) && (BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM)) || \
|
||||
((BOOST_PLAT_WINDOWS_SDK_VERSION < BOOST_WINAPI_WINDOWS_SDK_10_0) && BOOST_WINAPI_PARTITION_DESKTOP) \
|
||||
)
|
||||
|
||||
#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_USE_NTDDI_VERSION
|
||||
#endif
|
||||
#if !defined(WINAPI_FAMILY) && defined(BOOST_USE_WINAPI_FAMILY)
|
||||
#define WINAPI_FAMILY BOOST_USE_WINAPI_FAMILY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (WIN32_PLATFORM_PSPC)
|
||||
#define BOOST_WINAPI_IMPORT BOOST_SYMBOL_IMPORT
|
||||
#define BOOST_WINAPI_IMPORT_EXCEPT_WM
|
||||
#elif defined (_WIN32_WCE)
|
||||
#define BOOST_WINAPI_IMPORT
|
||||
#define BOOST_WINAPI_IMPORT_EXCEPT_WM
|
||||
#else
|
||||
#define BOOST_WINAPI_IMPORT BOOST_SYMBOL_IMPORT
|
||||
#define BOOST_WINAPI_IMPORT_EXCEPT_WM BOOST_SYMBOL_IMPORT
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
21
src/boost/winapi/detail/footer.hpp
Normal file
21
src/boost/winapi/detail/footer.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
|
||||
#if defined(_MSC_VER) && !(defined(__INTEL_COMPILER) || defined(__clang__))
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \
|
||||
&& (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
27
src/boost/winapi/detail/header.hpp
Normal file
27
src/boost/winapi/detail/header.hpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
|
||||
#if defined(_MSC_VER) && !(defined(__INTEL_COMPILER) || defined(__clang__))
|
||||
|
||||
#pragma warning(push, 3)
|
||||
// nonstandard extension used : nameless struct/union
|
||||
#pragma warning(disable: 4201)
|
||||
// Inconsistent annotation for 'X'
|
||||
#pragma warning(disable: 28251)
|
||||
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \
|
||||
&& (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
// ISO C++ 1998 does not support 'long long'
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_WINAPI_ENABLE_WARNINGS)
|
||||
106
src/boost/winapi/directory_management.hpp
Normal file
106
src/boost/winapi/directory_management.hpp
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* 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_WINAPI_DIRECTORY_MANAGEMENT_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_DIRECTORY_MANAGEMENT_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/get_system_directory.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateDirectoryA(boost::winapi::LPCSTR_, ::_SECURITY_ATTRIBUTES*);
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetTempPathA(boost::winapi::DWORD_ length, boost::winapi::LPSTR_ buffer);
|
||||
#endif
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
RemoveDirectoryA(boost::winapi::LPCSTR_);
|
||||
#endif
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateDirectoryW(boost::winapi::LPCWSTR_, ::_SECURITY_ATTRIBUTES*);
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetTempPathW(boost::winapi::DWORD_ length, boost::winapi::LPWSTR_ buffer);
|
||||
#endif
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
RemoveDirectoryW(boost::winapi::LPCWSTR_);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
using ::GetTempPathA;
|
||||
#endif
|
||||
using ::RemoveDirectoryA;
|
||||
#endif
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
using ::GetTempPathW;
|
||||
#endif
|
||||
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));
|
||||
}
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPSTR_ buffer)
|
||||
{
|
||||
return ::GetTempPathA(length, buffer);
|
||||
}
|
||||
#endif
|
||||
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));
|
||||
}
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPWSTR_ buffer)
|
||||
{
|
||||
return ::GetTempPathW(length, buffer);
|
||||
}
|
||||
#endif
|
||||
BOOST_FORCEINLINE BOOL_ remove_directory(LPCWSTR_ pPathName)
|
||||
{
|
||||
return ::RemoveDirectoryW(pPathName);
|
||||
}
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_DIRECTORY_MANAGEMENT_HPP_INCLUDED_
|
||||
199
src/boost/winapi/dll.hpp
Normal file
199
src/boost/winapi/dll.hpp
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright 2014 Renato Tegon Forti, Antony Polukhin
|
||||
* Copyright 2015, 2020 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_WINAPI_DLL_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_DLL_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/get_proc_address.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HMODULE_ BOOST_WINAPI_WINAPI_CC
|
||||
LoadLibraryA(boost::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HMODULE_ BOOST_WINAPI_WINAPI_CC
|
||||
LoadLibraryExA(
|
||||
boost::winapi::LPCSTR_ lpFileName,
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::DWORD_ dwFlags
|
||||
);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HMODULE_ BOOST_WINAPI_WINAPI_CC
|
||||
GetModuleHandleA(boost::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetModuleFileNameA(
|
||||
boost::winapi::HMODULE_ hModule,
|
||||
boost::winapi::LPSTR_ lpFilename,
|
||||
boost::winapi::DWORD_ nSize
|
||||
);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HMODULE_ BOOST_WINAPI_WINAPI_CC
|
||||
LoadLibraryW(boost::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HMODULE_ BOOST_WINAPI_WINAPI_CC
|
||||
LoadLibraryExW(
|
||||
boost::winapi::LPCWSTR_ lpFileName,
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::DWORD_ dwFlags
|
||||
);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HMODULE_ BOOST_WINAPI_WINAPI_CC
|
||||
GetModuleHandleW(boost::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetModuleFileNameW(
|
||||
boost::winapi::HMODULE_ hModule,
|
||||
boost::winapi::LPWSTR_ lpFilename,
|
||||
boost::winapi::DWORD_ nSize
|
||||
);
|
||||
|
||||
struct _MEMORY_BASIC_INFORMATION;
|
||||
|
||||
#if !defined( BOOST_WINAPI_IS_MINGW )
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::SIZE_T_ BOOST_WINAPI_WINAPI_CC
|
||||
VirtualQuery(
|
||||
boost::winapi::LPCVOID_ lpAddress,
|
||||
::_MEMORY_BASIC_INFORMATION* lpBuffer,
|
||||
boost::winapi::SIZE_T_ dwLength
|
||||
);
|
||||
#else // !defined( BOOST_WINAPI_IS_MINGW )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
VirtualQuery(
|
||||
boost::winapi::LPCVOID_ lpAddress,
|
||||
::_MEMORY_BASIC_INFORMATION* lpBuffer,
|
||||
boost::winapi::DWORD_ dwLength
|
||||
);
|
||||
#endif // !defined( BOOST_WINAPI_IS_MINGW )
|
||||
} // extern "C"
|
||||
#endif // #if !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_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 )
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ DONT_RESOLVE_DLL_REFERENCES_ = DONT_RESOLVE_DLL_REFERENCES;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ LOAD_WITH_ALTERED_SEARCH_PATH_ = LOAD_WITH_ALTERED_SEARCH_PATH;
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ DONT_RESOLVE_DLL_REFERENCES_ = 0x00000001;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ LOAD_WITH_ALTERED_SEARCH_PATH_ = 0x00000008;
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// This one is not defined by MinGW
|
||||
BOOST_CONSTEXPR_OR_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;
|
||||
|
||||
BOOST_FORCEINLINE SIZE_T_ VirtualQuery(LPCVOID_ lpAddress, MEMORY_BASIC_INFORMATION_* lpBuffer, SIZE_T_ 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 boost
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
//
|
||||
// FreeLibrary is in a different partition set (slightly)
|
||||
//
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if !defined(BOOST_USE_WINDOWS_H)
|
||||
extern "C" {
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FreeLibrary(boost::winapi::HMODULE_ hModule);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::FreeLibrary;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_DLL_HPP_INCLUDED_
|
||||
3181
src/boost/winapi/error_codes.hpp
Normal file
3181
src/boost/winapi/error_codes.hpp
Normal file
File diff suppressed because it is too large
Load diff
156
src/boost/winapi/error_handling.hpp
Normal file
156
src/boost/winapi/error_handling.hpp
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
* 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_WINAPI_ERROR_HANDLING_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_ERROR_HANDLING_HPP_INCLUDED_
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/get_last_error.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
FormatMessageA(
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::LPCVOID_ lpSource,
|
||||
boost::winapi::DWORD_ dwMessageId,
|
||||
boost::winapi::DWORD_ dwLanguageId,
|
||||
boost::winapi::LPSTR_ lpBuffer,
|
||||
boost::winapi::DWORD_ nSize,
|
||||
va_list *Arguments);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
FormatMessageW(
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::LPCVOID_ lpSource,
|
||||
boost::winapi::DWORD_ dwMessageId,
|
||||
boost::winapi::DWORD_ dwLanguageId,
|
||||
boost::winapi::LPWSTR_ lpBuffer,
|
||||
boost::winapi::DWORD_ nSize,
|
||||
va_list *Arguments);
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
BOOST_WINAPI_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
|
||||
SetErrorMode(boost::winapi::UINT_ uMode);
|
||||
#endif
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER;
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST WORD_ LANG_NEUTRAL_= LANG_NEUTRAL;
|
||||
BOOST_CONSTEXPR_OR_CONST WORD_ LANG_INVARIANT_= LANG_INVARIANT;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST WORD_ SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default
|
||||
|
||||
BOOST_FORCEINLINE BOOST_CONSTEXPR WORD_ MAKELANGID_(WORD_ p, WORD_ s) BOOST_NOEXCEPT
|
||||
{
|
||||
return static_cast< WORD_ >(MAKELANGID(p, s));
|
||||
}
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_FAILCRITICALERRORS_ = SEM_FAILCRITICALERRORS;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_NOGPFAULTERRORBOX_ = SEM_NOGPFAULTERRORBOX;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_NOALIGNMENTFAULTEXCEPT_ = SEM_NOALIGNMENTFAULTEXCEPT;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_NOOPENFILEERRORBOX_ = SEM_NOOPENFILEERRORBOX;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100;
|
||||
#endif
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_FROM_STRING_= 0x00000400;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST WORD_ LANG_NEUTRAL_= 0x00;
|
||||
BOOST_CONSTEXPR_OR_CONST WORD_ LANG_INVARIANT_= 0x7f;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST WORD_ SUBLANG_DEFAULT_= 0x01; // user default
|
||||
|
||||
BOOST_FORCEINLINE BOOST_CONSTEXPR WORD_ MAKELANGID_(WORD_ p, WORD_ s) BOOST_NOEXCEPT
|
||||
{
|
||||
return static_cast< WORD_ >((static_cast< DWORD_ >(s) << 10u) | p);
|
||||
}
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_FAILCRITICALERRORS_ = 0x0001;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_NOGPFAULTERRORBOX_ = 0x0002;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_NOALIGNMENTFAULTEXCEPT_ = 0x0004;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEM_NOOPENFILEERRORBOX_ = 0x8000;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::FormatMessageA;
|
||||
#endif
|
||||
using ::FormatMessageW;
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
using ::SetErrorMode;
|
||||
#endif
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_ERROR_HANDLING_HPP_INCLUDED_
|
||||
597
src/boost/winapi/file_management.hpp
Normal file
597
src/boost/winapi/file_management.hpp
Normal file
|
|
@ -0,0 +1,597 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright 2015 Andrey Semashev
|
||||
* Copyright 2016 Jorge Lodos
|
||||
* Copyright 2017 James E. King, III
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_FILE_MANAGEMENT_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_FILE_MANAGEMENT_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/limits.hpp>
|
||||
#include <boost/winapi/time.hpp>
|
||||
#include <boost/winapi/overlapped.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/*
|
||||
* UWP:
|
||||
* API SDK 8 SDK 10 _WIN32_WINNT
|
||||
* AreFileApisANSI DESKTOP - DESKTOP | SYSTEM
|
||||
* CreateFile DESKTOP - DESKTOP | SYSTEM
|
||||
* DeleteFile APP - APP | SYSTEM
|
||||
* FindClose APP - APP | SYSTEM
|
||||
* FindFirstFile DESKTOP > APP | SYSTEM
|
||||
* FindNextFile DESKTOP > APP | SYSTEM
|
||||
* GetFileAttributes DESKTOP > APP | SYSTEM
|
||||
* GetFileInformationByHandle DESKTOP - DESKTOP | SYSTEM
|
||||
* GetFileSizeEx DESKTOP > APP | SYSTEM
|
||||
* LockFile DESKTOP - DESKTOP | SYSTEM
|
||||
* MoveFileEx APP - APP | SYSTEM
|
||||
* ReadFile APP - APP | SYSTEM
|
||||
* SetEndOfFile APP - APP | SYSTEM
|
||||
* SetFilePointer DESKTOP > APP | SYSTEM
|
||||
* SetFileValidData DESKTOP - DESKTOP | SYSTEM >= 0x0501
|
||||
* UnlockFile DESKTOP - DESKTOP | SYSTEM
|
||||
* WriteFile APP - APP | SYSTEM
|
||||
*/
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
AreFileApisANSI(BOOST_WINAPI_DETAIL_VOID);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateFileA(
|
||||
boost::winapi::LPCSTR_ lpFileName,
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::DWORD_ dwShareMode,
|
||||
::_SECURITY_ATTRIBUTES* lpSecurityAttributes,
|
||||
boost::winapi::DWORD_ dwCreationDisposition,
|
||||
boost::winapi::DWORD_ dwFlagsAndAttributes,
|
||||
boost::winapi::HANDLE_ hTemplateFile);
|
||||
|
||||
struct _WIN32_FIND_DATAA;
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
FindFirstFileA(boost::winapi::LPCSTR_ lpFileName, ::_WIN32_FIND_DATAA* lpFindFileData);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FindNextFileA(boost::winapi::HANDLE_ hFindFile, ::_WIN32_FIND_DATAA* lpFindFileData);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateFileW(
|
||||
boost::winapi::LPCWSTR_ lpFileName,
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::DWORD_ dwShareMode,
|
||||
::_SECURITY_ATTRIBUTES* lpSecurityAttributes,
|
||||
boost::winapi::DWORD_ dwCreationDisposition,
|
||||
boost::winapi::DWORD_ dwFlagsAndAttributes,
|
||||
boost::winapi::HANDLE_ hTemplateFile);
|
||||
|
||||
struct _WIN32_FIND_DATAW;
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
FindFirstFileW(boost::winapi::LPCWSTR_ lpFileName, ::_WIN32_FIND_DATAW* lpFindFileData);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FindNextFileW(boost::winapi::HANDLE_ hFindFile, ::_WIN32_FIND_DATAW* lpFindFileData);
|
||||
|
||||
struct _BY_HANDLE_FILE_INFORMATION;
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
GetFileInformationByHandle(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
::_BY_HANDLE_FILE_INFORMATION* lpFileInformation);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
LockFile(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToLockLow,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToLockHigh);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
LockFileEx(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::DWORD_ dwReserved,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToLockLow,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToLockHigh,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
SetFileValidData(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::LONGLONG_ ValidDataLength);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
UnlockFile(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToUnlockLow,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToUnlockHigh);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
UnlockFileEx(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::DWORD_ dwReserved,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToUnlockLow,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToUnlockHigh,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
DeleteFileA(boost::winapi::LPCSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
MoveFileExA(
|
||||
boost::winapi::LPCSTR_ lpExistingFileName,
|
||||
boost::winapi::LPCSTR_ lpNewFileName,
|
||||
boost::winapi::DWORD_ dwFlags);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
DeleteFileW(boost::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FindClose(boost::winapi::HANDLE_ hFindFile);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
MoveFileExW(
|
||||
boost::winapi::LPCWSTR_ lpExistingFileName,
|
||||
boost::winapi::LPCWSTR_ lpNewFileName,
|
||||
boost::winapi::DWORD_ dwFlags);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
ReadFile(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::LPVOID_ lpBuffer,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToRead,
|
||||
boost::winapi::LPDWORD_ lpNumberOfBytesRead,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
SetEndOfFile(boost::winapi::HANDLE_ hFile);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
WriteFile(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::LPCVOID_ lpBuffer,
|
||||
boost::winapi::DWORD_ nNumberOfBytesToWrite,
|
||||
boost::winapi::LPDWORD_ lpNumberOfBytesWritten,
|
||||
::_OVERLAPPED* lpOverlapped);
|
||||
#endif // BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetFileAttributesA(boost::winapi::LPCSTR_ lpFileName);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetFileAttributesW(boost::winapi::LPCWSTR_ lpFileName);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
GetFileSizeEx(boost::winapi::HANDLE_ hFile, ::_LARGE_INTEGER* lpFileSize);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
SetFilePointer(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
boost::winapi::LONG_ lpDistanceToMove,
|
||||
boost::winapi::PLONG_ lpDistanceToMoveHigh,
|
||||
boost::winapi::DWORD_ dwMoveMethod);
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
} // extern "C"
|
||||
#endif // !defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INVALID_FILE_SIZE_ = INVALID_FILE_SIZE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INVALID_SET_FILE_POINTER_ = INVALID_SET_FILE_POINTER;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INVALID_FILE_ATTRIBUTES_ = INVALID_FILE_ATTRIBUTES;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_READONLY_ = FILE_ATTRIBUTE_READONLY;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_HIDDEN_ = FILE_ATTRIBUTE_HIDDEN;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_SYSTEM_ = FILE_ATTRIBUTE_SYSTEM;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_DIRECTORY_ = FILE_ATTRIBUTE_DIRECTORY;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_ARCHIVE_ = FILE_ATTRIBUTE_ARCHIVE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_DEVICE_ = FILE_ATTRIBUTE_DEVICE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_NORMAL_ = FILE_ATTRIBUTE_NORMAL;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_TEMPORARY_ = FILE_ATTRIBUTE_TEMPORARY;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_SPARSE_FILE_ = FILE_ATTRIBUTE_SPARSE_FILE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_REPARSE_POINT_ = FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_COMPRESSED_ = FILE_ATTRIBUTE_COMPRESSED;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_OFFLINE_ = FILE_ATTRIBUTE_OFFLINE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED_ = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_ENCRYPTED_ = FILE_ATTRIBUTE_ENCRYPTED;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NEW_ = CREATE_NEW;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_ALWAYS_ = CREATE_ALWAYS;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ OPEN_EXISTING_ = OPEN_EXISTING;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ OPEN_ALWAYS_ = OPEN_ALWAYS;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ TRUNCATE_EXISTING_ = TRUNCATE_EXISTING;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_SHARE_READ_ = FILE_SHARE_READ;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_SHARE_WRITE_ = FILE_SHARE_WRITE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_SHARE_DELETE_ = FILE_SHARE_DELETE;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_BEGIN_ = FILE_BEGIN;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_CURRENT_ = FILE_CURRENT;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_END_ = FILE_END;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INVALID_FILE_SIZE_ = ((DWORD_)0xFFFFFFFF);
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INVALID_SET_FILE_POINTER_ = ((DWORD_)-1);
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INVALID_FILE_ATTRIBUTES_ = ((DWORD_)-1);
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_READONLY_ = 0x00000001;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_HIDDEN_ = 0x00000002;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_SYSTEM_ = 0x00000004;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_DIRECTORY_ = 0x00000010;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_ARCHIVE_ = 0x00000020;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_DEVICE_ = 0x00000040;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_NORMAL_ = 0x00000080;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_TEMPORARY_ = 0x00000100;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_SPARSE_FILE_ = 0x00000200;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_REPARSE_POINT_ = 0x00000400;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_COMPRESSED_ = 0x00000800;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_OFFLINE_ = 0x00001000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED_ = 0x00002000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_ENCRYPTED_ = 0x00004000;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NEW_ = 1;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_ALWAYS_ = 2;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ OPEN_EXISTING_ = 3;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ OPEN_ALWAYS_ = 4;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ TRUNCATE_EXISTING_ = 5;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_SHARE_READ_ = 0x00000001;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_SHARE_WRITE_ = 0x00000002;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_SHARE_DELETE_ = 0x00000004;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_BEGIN_ = 0;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_CURRENT_ = 1;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_END_ = 2;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
// Some of these constants are not defined by Windows SDK in MinGW or older MSVC
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_WRITE_THROUGH_ = 0x80000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_OVERLAPPED_ = 0x40000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_NO_BUFFERING_ = 0x20000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_RANDOM_ACCESS_ = 0x10000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_SEQUENTIAL_SCAN_ = 0x08000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_DELETE_ON_CLOSE_ = 0x04000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_BACKUP_SEMANTICS_ = 0x02000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_POSIX_SEMANTICS_ = 0x01000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_SESSION_AWARE_ = 0x00800000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_OPEN_REPARSE_POINT_ = 0x00200000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_OPEN_NO_RECALL_ = 0x00100000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_FIRST_PIPE_INSTANCE_ = 0x00080000;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_FLAG_OPEN_REQUIRING_OPLOCK_ = 0x00040000;
|
||||
#endif
|
||||
|
||||
// This constant is not defined in Windows SDK up until 6.0A
|
||||
BOOST_CONSTEXPR_OR_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.
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_INTEGRITY_STREAM_ = 0x00008000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_NO_SCRUB_DATA_ = 0x00020000;
|
||||
// Undocumented
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_ATTRIBUTE_EA_ = 0x00040000;
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::AreFileApisANSI;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
typedef struct BOOST_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 HANDLE_ find_first_file(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));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ find_next_file(HANDLE_ hFindFile, WIN32_FIND_DATAA_* lpFindFileData)
|
||||
{
|
||||
return ::FindNextFileA(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
|
||||
}
|
||||
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
typedef struct BOOST_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_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 HANDLE_ find_first_file(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_ find_next_file(HANDLE_ hFindFile, WIN32_FIND_DATAW_* lpFindFileData)
|
||||
{
|
||||
return ::FindNextFileW(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ GetFileInformationByHandle(HANDLE_ h, BY_HANDLE_FILE_INFORMATION_* info)
|
||||
{
|
||||
return ::GetFileInformationByHandle(h, reinterpret_cast< ::_BY_HANDLE_FILE_INFORMATION* >(info));
|
||||
}
|
||||
|
||||
using ::LockFile;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
using ::SetFileValidData;
|
||||
#endif
|
||||
|
||||
using ::UnlockFile;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ UnlockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToUnlockLow,
|
||||
DWORD_ nNumberOfBytesToUnlockHigh,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::UnlockFileEx(hFile, dwReserved, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::DeleteFileA;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ delete_file(LPCSTR_ lpFileName)
|
||||
{
|
||||
return ::DeleteFileA(lpFileName);
|
||||
}
|
||||
|
||||
using ::MoveFileExA;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ move_file(LPCSTR_ lpExistingFileName, LPCSTR_ lpNewFileName, DWORD_ dwFlags)
|
||||
{
|
||||
return ::MoveFileExA(lpExistingFileName, lpNewFileName, dwFlags);
|
||||
}
|
||||
|
||||
#endif
|
||||
using ::DeleteFileW;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ delete_file(LPCWSTR_ lpFileName)
|
||||
{
|
||||
return ::DeleteFileW(lpFileName);
|
||||
}
|
||||
|
||||
using ::FindClose;
|
||||
using ::MoveFileExW;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ move_file(LPCWSTR_ lpExistingFileName, LPCWSTR_ lpNewFileName, DWORD_ dwFlags)
|
||||
{
|
||||
return ::MoveFileExW(lpExistingFileName, lpNewFileName, dwFlags);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ ReadFile(
|
||||
HANDLE_ hFile,
|
||||
LPVOID_ lpBuffer,
|
||||
DWORD_ nNumberOfBytesToWrite,
|
||||
LPDWORD_ lpNumberOfBytesWritten,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::ReadFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
|
||||
using ::SetEndOfFile;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ WriteFile(
|
||||
HANDLE_ hFile,
|
||||
LPCVOID_ lpBuffer,
|
||||
DWORD_ nNumberOfBytesToWrite,
|
||||
LPDWORD_ lpNumberOfBytesWritten,
|
||||
OVERLAPPED_* lpOverlapped)
|
||||
{
|
||||
return ::WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
|
||||
}
|
||||
#endif // BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::GetFileAttributesA;
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_file_attributes(LPCSTR_ lpFileName)
|
||||
{
|
||||
return ::GetFileAttributesA(lpFileName);
|
||||
}
|
||||
#endif
|
||||
using ::GetFileAttributesW;
|
||||
|
||||
BOOST_FORCEINLINE DWORD_ get_file_attributes(LPCWSTR_ lpFileName)
|
||||
{
|
||||
return ::GetFileAttributesW(lpFileName);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ GetFileSizeEx(HANDLE_ hFile, LARGE_INTEGER_* lpFileSize)
|
||||
{
|
||||
return ::GetFileSizeEx(hFile, reinterpret_cast< ::_LARGE_INTEGER* >(lpFileSize));
|
||||
}
|
||||
|
||||
using ::SetFilePointer;
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_FILE_MANAGEMENT_HPP_INCLUDED_
|
||||
262
src/boost/winapi/file_mapping.hpp
Normal file
262
src/boost/winapi/file_mapping.hpp
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright 2015 Andrey Semashev
|
||||
* Copyright 2016 Jorge Lodos
|
||||
* Copyright 2017 James E. King, III
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_FILE_MAPPING_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_FILE_MAPPING_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/*
|
||||
* UWP:
|
||||
* API SDK 8 SDK 10
|
||||
* CreateFileMapping DESKTOP - DESKTOP | SYSTEM
|
||||
* FlushViewOfFile APP - APP | SYSTEM
|
||||
* MapViewOfFile DESKTOP - DESKTOP | SYSTEM
|
||||
* MapViewOfFileEx DESKTOP - DESKTOP | SYSTEM
|
||||
* OpenFileMapping DESKTOP - DESKTOP | SYSTEM
|
||||
* UnmapViewOfFile APP - APP | SYSTEM
|
||||
*/
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateFileMappingA(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
::_SECURITY_ATTRIBUTES* lpFileMappingAttributes,
|
||||
boost::winapi::DWORD_ flProtect,
|
||||
boost::winapi::DWORD_ dwMaximumSizeHigh,
|
||||
boost::winapi::DWORD_ dwMaximumSizeLow,
|
||||
boost::winapi::LPCSTR_ lpName);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
OpenFileMappingA(
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::LPCSTR_ lpName);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateFileMappingW(
|
||||
boost::winapi::HANDLE_ hFile,
|
||||
::_SECURITY_ATTRIBUTES* lpFileMappingAttributes,
|
||||
boost::winapi::DWORD_ flProtect,
|
||||
boost::winapi::DWORD_ dwMaximumSizeHigh,
|
||||
boost::winapi::DWORD_ dwMaximumSizeLow,
|
||||
boost::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::LPVOID_ BOOST_WINAPI_WINAPI_CC
|
||||
MapViewOfFile(
|
||||
boost::winapi::HANDLE_ hFileMappingObject,
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::winapi::SIZE_T_ dwNumberOfBytesToMap);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::LPVOID_ BOOST_WINAPI_WINAPI_CC
|
||||
MapViewOfFileEx(
|
||||
boost::winapi::HANDLE_ hFileMappingObject,
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::DWORD_ dwFileOffsetHigh,
|
||||
boost::winapi::DWORD_ dwFileOffsetLow,
|
||||
boost::winapi::SIZE_T_ dwNumberOfBytesToMap,
|
||||
boost::winapi::LPVOID_ lpBaseAddress);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
OpenFileMappingW(
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::LPCWSTR_ lpName);
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FlushViewOfFile(
|
||||
boost::winapi::LPCVOID_ lpBaseAddress,
|
||||
boost::winapi::SIZE_T_ dwNumberOfBytesToFlush);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
UnmapViewOfFile(boost::winapi::LPCVOID_ lpBaseAddress);
|
||||
#endif // BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_FILE_ = SEC_FILE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_IMAGE_ = SEC_IMAGE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_RESERVE_ = SEC_RESERVE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_COMMIT_ = SEC_COMMIT;
|
||||
BOOST_CONSTEXPR_OR_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
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_QUERY_ = SECTION_QUERY;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_WRITE_ = SECTION_MAP_WRITE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_READ_ = SECTION_MAP_READ;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_EXECUTE_ = SECTION_MAP_EXECUTE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_EXTEND_SIZE_ = SECTION_EXTEND_SIZE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_ALL_ACCESS_ = SECTION_ALL_ACCESS;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_COPY_ = FILE_MAP_COPY;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_WRITE_ = FILE_MAP_WRITE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_READ_ = FILE_MAP_READ;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_ALL_ACCESS_ = FILE_MAP_ALL_ACCESS;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_FILE_ = 0x800000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_IMAGE_ = 0x1000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_RESERVE_ = 0x4000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_COMMIT_ = 0x8000000;
|
||||
BOOST_CONSTEXPR_OR_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
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_QUERY_ = 0x00000001;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_WRITE_ = 0x00000002;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_READ_ = 0x00000004;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_EXECUTE_ = 0x00000008;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_EXTEND_SIZE_ = 0x00000010;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_ALL_ACCESS_ = 0x000F001F; // STANDARD_RIGHTS_REQUIRED | SECTION_*
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_COPY_ = SECTION_QUERY_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_WRITE_ = SECTION_MAP_WRITE_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ FILE_MAP_READ_ = SECTION_MAP_READ_;
|
||||
BOOST_CONSTEXPR_OR_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)
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SECTION_MAP_EXECUTE_EXPLICIT_ = 0x00000020; // not included in SECTION_ALL_ACCESS
|
||||
BOOST_CONSTEXPR_OR_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)
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_PROTECTED_IMAGE_ = 0x2000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_WRITECOMBINE_ = 0x40000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_LARGE_PAGES_ = 0x80000000;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEC_IMAGE_NO_EXECUTE_ = (SEC_IMAGE_ | SEC_NOCACHE_);
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP
|
||||
#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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
using ::OpenFileMappingA;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_file_mapping(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenFileMappingA(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
using ::MapViewOfFile;
|
||||
using ::MapViewOfFileEx;
|
||||
using ::OpenFileMappingW;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_file_mapping(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::OpenFileMappingW(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
using ::FlushViewOfFile;
|
||||
using ::UnmapViewOfFile;
|
||||
#endif // BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_FILE_MAPPING_HPP_INCLUDED_
|
||||
34
src/boost/winapi/get_current_process.hpp
Normal file
34
src/boost/winapi/get_current_process.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_CURRENT_PROCESS_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_CURRENT_PROCESS_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.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_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC GetCurrentProcess(BOOST_WINAPI_DETAIL_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::GetCurrentProcess;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_GET_CURRENT_PROCESS_HPP_INCLUDED_
|
||||
33
src/boost/winapi/get_current_process_id.hpp
Normal file
33
src/boost/winapi/get_current_process_id.hpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_CURRENT_PROCESS_ID_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_CURRENT_PROCESS_ID_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.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_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC GetCurrentProcessId(BOOST_WINAPI_DETAIL_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::GetCurrentProcessId;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_GET_CURRENT_PROCESS_ID_HPP_INCLUDED_
|
||||
34
src/boost/winapi/get_current_thread.hpp
Normal file
34
src/boost/winapi/get_current_thread.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_CURRENT_THREAD_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_CURRENT_THREAD_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.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_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC GetCurrentThread(BOOST_WINAPI_DETAIL_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::GetCurrentThread;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_GET_CURRENT_THREAD_HPP_INCLUDED_
|
||||
34
src/boost/winapi/get_current_thread_id.hpp
Normal file
34
src/boost/winapi/get_current_thread_id.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_CURRENT_THREAD_ID_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_CURRENT_THREAD_ID_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.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_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC GetCurrentThreadId(BOOST_WINAPI_DETAIL_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::GetCurrentThreadId;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_GET_CURRENT_THREAD_ID_HPP_INCLUDED_
|
||||
33
src/boost/winapi/get_last_error.hpp
Normal file
33
src/boost/winapi/get_last_error.hpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_LAST_ERROR_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_LAST_ERROR_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC GetLastError(BOOST_WINAPI_DETAIL_VOID);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::GetLastError;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_GET_LAST_ERROR_HPP_INCLUDED_
|
||||
81
src/boost/winapi/get_proc_address.hpp
Normal file
81
src/boost/winapi/get_proc_address.hpp
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright 2020 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_GET_PROC_ADDRESS_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_PROC_ADDRESS_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#if !defined(BOOST_USE_WINDOWS_H)
|
||||
namespace boost { namespace winapi {
|
||||
#ifdef _WIN64
|
||||
typedef INT_PTR_ (BOOST_WINAPI_WINAPI_CC *FARPROC_)();
|
||||
typedef INT_PTR_ (BOOST_WINAPI_WINAPI_CC *NEARPROC_)();
|
||||
typedef INT_PTR_ (BOOST_WINAPI_WINAPI_CC *PROC_)();
|
||||
#else
|
||||
typedef int (BOOST_WINAPI_WINAPI_CC *FARPROC_)();
|
||||
typedef int (BOOST_WINAPI_WINAPI_CC *NEARPROC_)();
|
||||
typedef int (BOOST_WINAPI_WINAPI_CC *PROC_)();
|
||||
#endif // _WIN64
|
||||
}} // namespace boost::winapi
|
||||
|
||||
extern "C" {
|
||||
#if !defined(UNDER_CE)
|
||||
BOOST_WINAPI_IMPORT boost::winapi::FARPROC_ BOOST_WINAPI_WINAPI_CC
|
||||
GetProcAddress(boost::winapi::HMODULE_ hModule, boost::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_WINAPI_IMPORT_EXCEPT_WM boost::winapi::FARPROC_ BOOST_WINAPI_WINAPI_CC
|
||||
GetProcAddressA(boost::winapi::HMODULE_ hModule, boost::winapi::LPCSTR_ lpProcName);
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::FARPROC_ BOOST_WINAPI_WINAPI_CC
|
||||
GetProcAddressW(boost::winapi::HMODULE_ hModule, boost::winapi::LPCWSTR_ lpProcName);
|
||||
#endif
|
||||
} // extern "C"
|
||||
#endif // !defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if defined(BOOST_USE_WINDOWS_H)
|
||||
typedef ::FARPROC FARPROC_;
|
||||
typedef ::NEARPROC NEARPROC_;
|
||||
typedef ::PROC PROC_;
|
||||
#endif // defined(BOOST_USE_WINDOWS_H)
|
||||
|
||||
#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
|
||||
}
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#endif // BOOST_WINAPI_GET_PROC_ADDRESS_HPP_INCLUDED_
|
||||
63
src/boost/winapi/get_process_times.hpp
Normal file
63
src/boost/winapi/get_process_times.hpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Windows CE does not define GetProcessTimes
|
||||
#if !defined( UNDER_CE )
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/time.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
GetProcessTimes(
|
||||
boost::winapi::HANDLE_ hProcess,
|
||||
::_FILETIME* lpCreationTime,
|
||||
::_FILETIME* lpExitTime,
|
||||
::_FILETIME* lpKernelTime,
|
||||
::_FILETIME* lpUserTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#endif // !defined( UNDER_CE )
|
||||
#endif // BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
|
||||
64
src/boost/winapi/get_system_directory.hpp
Normal file
64
src/boost/winapi/get_system_directory.hpp
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP
|
||||
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
|
||||
GetSystemDirectoryA(
|
||||
boost::winapi::LPSTR_ lpBuffer,
|
||||
boost::winapi::UINT_ uSize);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
|
||||
GetSystemDirectoryW(
|
||||
boost::winapi::LPWSTR_ lpBuffer,
|
||||
boost::winapi::UINT_ uSize);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP
|
||||
|
||||
#endif // BOOST_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_
|
||||
75
src/boost/winapi/handles.hpp
Normal file
75
src/boost/winapi/handles.hpp
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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_WINAPI_HANDLES_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_HANDLES_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
CloseHandle(boost::winapi::HANDLE_ handle);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
DuplicateHandle(
|
||||
boost::winapi::HANDLE_ hSourceProcessHandle,
|
||||
boost::winapi::HANDLE_ hSourceHandle,
|
||||
boost::winapi::HANDLE_ hTargetProcessHandle,
|
||||
boost::winapi::HANDLE_* lpTargetHandle,
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::DWORD_ dwOptions);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
CompareObjectHandles(
|
||||
boost::winapi::HANDLE_ hFirstObjectHandle,
|
||||
boost::winapi::HANDLE_ hSecondObjectHandle);
|
||||
#endif
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
using ::CloseHandle;
|
||||
using ::DuplicateHandle;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
|
||||
using ::CompareObjectHandles;
|
||||
#endif
|
||||
|
||||
// Note: MSVC-14.1 does not interpret INVALID_HANDLE_VALUE_ initializer as a constant expression
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS;
|
||||
const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE;
|
||||
#else
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = 2;
|
||||
const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1);
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_;
|
||||
// Note: The "unused" attribute here should not be necessary because the variable is a constant.
|
||||
// However, MinGW gcc 5.3 spams warnings about this particular constant.
|
||||
const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_HANDLES_HPP_INCLUDED_
|
||||
52
src/boost/winapi/limits.hpp
Normal file
52
src/boost/winapi/limits.hpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2016 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_LIMITS_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_LIMITS_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ MAX_PATH_ = MAX_PATH;
|
||||
|
||||
#else
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ MAX_PATH_ = 260;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ UNICODE_STRING_MAX_BYTES_ = UNICODE_STRING_MAX_BYTES;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ UNICODE_STRING_MAX_CHARS_ = UNICODE_STRING_MAX_CHARS;
|
||||
|
||||
#else
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ UNICODE_STRING_MAX_BYTES_ = 65534;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ UNICODE_STRING_MAX_CHARS_ = 32767;
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ max_path = MAX_PATH_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ unicode_string_max_bytes = UNICODE_STRING_MAX_BYTES_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ unicode_string_max_chars = UNICODE_STRING_MAX_CHARS_;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_LIMITS_HPP_INCLUDED_
|
||||
71
src/boost/winapi/local_memory.hpp
Normal file
71
src/boost/winapi/local_memory.hpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* 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_WINAPI_LOCAL_MEMORY_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_LOCAL_MEMORY_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
namespace boost { namespace winapi {
|
||||
typedef HANDLE_ HLOCAL_;
|
||||
}}
|
||||
|
||||
extern "C" {
|
||||
|
||||
#if defined (_WIN32_WCE )
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
|
||||
LocalAlloc(
|
||||
boost::winapi::UINT_ uFlags,
|
||||
boost::winapi::UINT_ uBytes);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
|
||||
LocalReAlloc(
|
||||
boost::winapi::HLOCAL_ hMem,
|
||||
boost::winapi::UINT_ uBytes,
|
||||
boost::winapi::UINT_ uFlags);
|
||||
#else
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
|
||||
LocalAlloc(
|
||||
boost::winapi::UINT_ uFlags,
|
||||
boost::winapi::SIZE_T_ uBytes);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC
|
||||
LocalReAlloc(
|
||||
boost::winapi::HLOCAL_ hMem,
|
||||
boost::winapi::SIZE_T_ uBytes,
|
||||
boost::winapi::UINT_ uFlags);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HLOCAL_ BOOST_WINAPI_WINAPI_CC LocalFree(boost::winapi::HLOCAL_ hMem);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::HLOCAL HLOCAL_;
|
||||
#endif
|
||||
using ::LocalAlloc;
|
||||
using ::LocalReAlloc;
|
||||
using ::LocalFree;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#endif // BOOST_WINAPI_LOCAL_MEMORY_HPP_INCLUDED_
|
||||
185
src/boost/winapi/mutex.hpp
Normal file
185
src/boost/winapi/mutex.hpp
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright 2015, 2017 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_MUTEX_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_MUTEX_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) && BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateMutexA(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::winapi::BOOL_ bInitialOwner,
|
||||
boost::winapi::LPCSTR_ lpName);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateMutexW(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::winapi::BOOL_ bInitialOwner,
|
||||
boost::winapi::LPCWSTR_ lpName);
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H ) && BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateMutexExA(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::winapi::LPCSTR_ lpName,
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
OpenMutexA(
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::LPCSTR_ lpName);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateMutexExW(
|
||||
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
|
||||
boost::winapi::LPCWSTR_ lpName,
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
OpenMutexW(
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::LPCWSTR_ lpName);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
ReleaseMutex(boost::winapi::HANDLE_ hMutex);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenMutexA;
|
||||
#endif
|
||||
using ::OpenMutexW;
|
||||
using ::ReleaseMutex;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ MUTEX_ALL_ACCESS_ = MUTEX_ALL_ACCESS;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ MUTEX_MODIFY_STATE_ = MUTEX_MODIFY_STATE;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_MUTEX_INITIAL_OWNER_ = CREATE_MUTEX_INITIAL_OWNER;
|
||||
#endif
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ MUTEX_ALL_ACCESS_ = 0x001F0001;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ MUTEX_MODIFY_STATE_ = 0x00000001;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_MUTEX_INITIAL_OWNER_ = 0x00000001;
|
||||
#endif
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ mutex_all_access = MUTEX_ALL_ACCESS_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ mutex_modify_state = MUTEX_MODIFY_STATE_;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_CONSTEXPR_OR_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_WINAPI_PARTITION_APP_SYSTEM && 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_WINAPI_PARTITION_APP_SYSTEM && 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_MUTEX_HPP_INCLUDED_
|
||||
45
src/boost/winapi/overlapped.hpp
Normal file
45
src/boost/winapi/overlapped.hpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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_WINAPI_OVERLAPPED_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_OVERLAPPED_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _OVERLAPPED;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _OVERLAPPED {
|
||||
ULONG_PTR_ Internal;
|
||||
ULONG_PTR_ InternalHigh;
|
||||
union {
|
||||
BOOST_WINAPI_DETAIL_EXTENSION struct {
|
||||
DWORD_ Offset;
|
||||
DWORD_ OffsetHigh;
|
||||
};
|
||||
PVOID_ Pointer;
|
||||
};
|
||||
HANDLE_ hEvent;
|
||||
} OVERLAPPED_, *LPOVERLAPPED_;
|
||||
|
||||
} // namespace winapi
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_OVERLAPPED_HPP_INCLUDED_
|
||||
89
src/boost/winapi/security.hpp
Normal file
89
src/boost/winapi/security.hpp
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* 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_WINAPI_SECURITY_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_SECURITY_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#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::winapi::PVOID_ PSECURITY_DESCRIPTOR;
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
InitializeSecurityDescriptor(
|
||||
PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
||||
boost::winapi::DWORD_ dwRevision);
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
SetSecurityDescriptorDacl(
|
||||
PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
||||
boost::winapi::BOOL_ bDaclPresent,
|
||||
::_ACL* pDacl,
|
||||
boost::winapi::BOOL_ bDaclDefaulted);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
typedef PVOID_ PSID_;
|
||||
typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _ACL {
|
||||
BYTE_ AclRevision;
|
||||
BYTE_ Sbz1;
|
||||
WORD_ AclSize;
|
||||
WORD_ AceCount;
|
||||
WORD_ Sbz2;
|
||||
} ACL_, *PACL_;
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _SECURITY_DESCRIPTOR {
|
||||
BYTE_ Revision;
|
||||
BYTE_ Sbz1;
|
||||
SECURITY_DESCRIPTOR_CONTROL_ Control;
|
||||
PSID_ Owner;
|
||||
PSID_ Group;
|
||||
PACL_ Sacl;
|
||||
PACL_ Dacl;
|
||||
} SECURITY_DESCRIPTOR_, *PISECURITY_DESCRIPTOR_;
|
||||
|
||||
// To abstract away the different ::PSECURITY_DESCRIPTOR on MinGW, we use PVOID_ universally here
|
||||
// and cast the pointers to ::PSECURITY_DESCRIPTOR in wrapper functions.
|
||||
typedef PVOID_ PSECURITY_DESCRIPTOR_;
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR_ pSecurityDescriptor, DWORD_ dwRevision)
|
||||
{
|
||||
return ::InitializeSecurityDescriptor(reinterpret_cast< ::PSECURITY_DESCRIPTOR >(pSecurityDescriptor), dwRevision);
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE BOOL_ SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR_ pSecurityDescriptor, BOOL_ bDaclPresent, PACL_ pDacl, BOOL_ bDaclDefaulted)
|
||||
{
|
||||
return ::SetSecurityDescriptorDacl(reinterpret_cast< ::PSECURITY_DESCRIPTOR >(pSecurityDescriptor), bDaclPresent, reinterpret_cast< ::_ACL* >(pDacl), bDaclDefaulted);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#endif // BOOST_WINAPI_SECURITY_HPP_INCLUDED_
|
||||
189
src/boost/winapi/semaphore.hpp
Normal file
189
src/boost/winapi/semaphore.hpp
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
* 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_WINAPI_SEMAPHORE_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_SEMAPHORE_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateSemaphoreA(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::winapi::LONG_ lInitialCount,
|
||||
boost::winapi::LONG_ lMaximumCount,
|
||||
boost::winapi::LPCSTR_ lpName);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateSemaphoreExA(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::winapi::LONG_ lInitialCount,
|
||||
boost::winapi::LONG_ lMaximumCount,
|
||||
boost::winapi::LPCSTR_ lpName,
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateSemaphoreW(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::winapi::LONG_ lInitialCount,
|
||||
boost::winapi::LONG_ lMaximumCount,
|
||||
boost::winapi::LPCWSTR_ lpName);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
CreateSemaphoreExW(
|
||||
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
|
||||
boost::winapi::LONG_ lInitialCount,
|
||||
boost::winapi::LONG_ lMaximumCount,
|
||||
boost::winapi::LPCWSTR_ lpName,
|
||||
boost::winapi::DWORD_ dwFlags,
|
||||
boost::winapi::DWORD_ dwDesiredAccess);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
ReleaseSemaphore(
|
||||
boost::winapi::HANDLE_ hSemaphore,
|
||||
boost::winapi::LONG_ lReleaseCount,
|
||||
boost::winapi::LPLONG_ lpPreviousCount);
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
OpenSemaphoreA(
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::LPCSTR_ lpName);
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
|
||||
OpenSemaphoreW(
|
||||
boost::winapi::DWORD_ dwDesiredAccess,
|
||||
boost::winapi::BOOL_ bInheritHandle,
|
||||
boost::winapi::LPCWSTR_ lpName);
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
using ::ReleaseSemaphore;
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEMAPHORE_ALL_ACCESS_ = SEMAPHORE_ALL_ACCESS;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEMAPHORE_MODIFY_STATE_ = SEMAPHORE_MODIFY_STATE;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEMAPHORE_ALL_ACCESS_ = 0x001F0003;
|
||||
BOOST_CONSTEXPR_OR_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
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ SEMAPHORE_QUERY_STATE_ = 0x00000001;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ semaphore_all_access = SEMAPHORE_ALL_ACCESS_;
|
||||
BOOST_CONSTEXPR_OR_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)
|
||||
{
|
||||
return ::CreateSemaphoreA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName);
|
||||
}
|
||||
|
||||
#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 // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreW(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::CreateSemaphoreW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName);
|
||||
}
|
||||
|
||||
#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);
|
||||
}
|
||||
#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_ create_anonymous_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount)
|
||||
{
|
||||
return winapi::CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, 0);
|
||||
}
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
|
||||
#if !defined( BOOST_NO_ANSI_APIS )
|
||||
using ::OpenSemaphoreA;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_semaphore(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
|
||||
{
|
||||
return ::OpenSemaphoreA(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
#endif // !defined( BOOST_NO_ANSI_APIS )
|
||||
|
||||
using ::OpenSemaphoreW;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ open_semaphore(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
|
||||
{
|
||||
return ::OpenSemaphoreW(dwDesiredAccess, bInheritHandle, lpName);
|
||||
}
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_SEMAPHORE_HPP_INCLUDED_
|
||||
80
src/boost/winapi/system.hpp
Normal file
80
src/boost/winapi/system.hpp
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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_WINAPI_SYSTEM_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _SYSTEM_INFO;
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
|
||||
GetSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
BOOST_WINAPI_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
|
||||
GetNativeSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _SYSTEM_INFO {
|
||||
BOOST_WINAPI_DETAIL_EXTENSION union {
|
||||
DWORD_ dwOemId;
|
||||
BOOST_WINAPI_DETAIL_EXTENSION struct {
|
||||
WORD_ wProcessorArchitecture;
|
||||
WORD_ wReserved;
|
||||
};
|
||||
};
|
||||
DWORD_ dwPageSize;
|
||||
LPVOID_ lpMinimumApplicationAddress;
|
||||
LPVOID_ lpMaximumApplicationAddress;
|
||||
DWORD_PTR_ dwActiveProcessorMask;
|
||||
DWORD_ dwNumberOfProcessors;
|
||||
DWORD_ dwProcessorType;
|
||||
DWORD_ dwAllocationGranularity;
|
||||
WORD_ wProcessorLevel;
|
||||
WORD_ wProcessorRevision;
|
||||
} SYSTEM_INFO_, *LPSYSTEM_INFO_;
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_FORCEINLINE VOID_ GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
|
||||
{
|
||||
::GetSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
|
||||
BOOST_FORCEINLINE VOID_ GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
|
||||
{
|
||||
::GetNativeSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
|
||||
46
src/boost/winapi/thread.hpp
Normal file
46
src/boost/winapi/thread.hpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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_WINAPI_THREAD_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_THREAD_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/get_current_thread.hpp>
|
||||
#include <boost/winapi/get_current_thread_id.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
SleepEx(
|
||||
boost::winapi::DWORD_ dwMilliseconds,
|
||||
boost::winapi::BOOL_ bAlertable);
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC Sleep(boost::winapi::DWORD_ dwMilliseconds);
|
||||
BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC SwitchToThread(BOOST_WINAPI_DETAIL_VOID);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
using ::SleepEx;
|
||||
using ::Sleep;
|
||||
using ::SwitchToThread;
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
#endif // BOOST_WINAPI_THREAD_HPP_INCLUDED_
|
||||
143
src/boost/winapi/time.hpp
Normal file
143
src/boost/winapi/time.hpp
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright (c) Microsoft Corporation 2014
|
||||
* Copyright 2015, 2017 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_TIME_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_TIME_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
struct _FILETIME;
|
||||
struct _SYSTEMTIME;
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
|
||||
GetSystemTime(::_SYSTEMTIME* lpSystemTime);
|
||||
|
||||
#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
|
||||
BOOST_WINAPI_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
|
||||
GetSystemTimeAsFileTime(::_FILETIME* lpSystemTimeAsFileTime);
|
||||
#endif
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
SystemTimeToFileTime(
|
||||
const ::_SYSTEMTIME* lpSystemTime,
|
||||
::_FILETIME* lpFileTime);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FileTimeToSystemTime(
|
||||
const ::_FILETIME* lpFileTime,
|
||||
::_SYSTEMTIME* lpSystemTime);
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
FileTimeToLocalFileTime(
|
||||
const ::_FILETIME* lpFileTime,
|
||||
::_FILETIME* lpLocalFileTime);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
LocalFileTimeToFileTime(
|
||||
const ::_FILETIME* lpLocalFileTime,
|
||||
::_FILETIME* lpFileTime);
|
||||
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
GetTickCount(BOOST_WINAPI_DETAIL_VOID);
|
||||
#endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
BOOST_WINAPI_IMPORT boost::winapi::ULONGLONG_ BOOST_WINAPI_WINAPI_CC
|
||||
GetTickCount64(BOOST_WINAPI_DETAIL_VOID);
|
||||
#endif
|
||||
|
||||
} // extern "C"
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _FILETIME {
|
||||
DWORD_ dwLowDateTime;
|
||||
DWORD_ dwHighDateTime;
|
||||
} FILETIME_, *PFILETIME_, *LPFILETIME_;
|
||||
|
||||
typedef struct BOOST_MAY_ALIAS _SYSTEMTIME {
|
||||
WORD_ wYear;
|
||||
WORD_ wMonth;
|
||||
WORD_ wDayOfWeek;
|
||||
WORD_ wDay;
|
||||
WORD_ wHour;
|
||||
WORD_ wMinute;
|
||||
WORD_ wSecond;
|
||||
WORD_ wMilliseconds;
|
||||
} SYSTEMTIME_, *PSYSTEMTIME_, *LPSYSTEMTIME_;
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
|
||||
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));
|
||||
}
|
||||
|
||||
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_WINAPI_PARTITION_APP_SYSTEM
|
||||
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 // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
#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::winapi::SYSTEMTIME_ st;
|
||||
boost::winapi::GetSystemTime(&st);
|
||||
boost::winapi::SystemTimeToFileTime(&st, lpFileTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_TIME_HPP_INCLUDED_
|
||||
48
src/boost/winapi/timers.hpp
Normal file
48
src/boost/winapi/timers.hpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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_WINAPI_TIMERS_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_TIMERS_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
|
||||
QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost {
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_TIMERS_HPP_INCLUDED_
|
||||
91
src/boost/winapi/wait.hpp
Normal file
91
src/boost/winapi/wait.hpp
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright 2010 Vicente J. Botet Escriba
|
||||
* Copyright 2015 Andrey Semashev
|
||||
* Copyright 2017 James E. King, III
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_WAIT_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_WAIT_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/wait_constants.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
extern "C" {
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
WaitForSingleObjectEx(
|
||||
boost::winapi::HANDLE_ hHandle,
|
||||
boost::winapi::DWORD_ dwMilliseconds,
|
||||
boost::winapi::BOOL_ bAlertable);
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
SignalObjectAndWait(
|
||||
boost::winapi::HANDLE_ hObjectToSignal,
|
||||
boost::winapi::HANDLE_ hObjectToWaitOn,
|
||||
boost::winapi::DWORD_ dwMilliseconds,
|
||||
boost::winapi::BOOL_ bAlertable);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
WaitForSingleObject(
|
||||
boost::winapi::HANDLE_ hHandle,
|
||||
boost::winapi::DWORD_ dwMilliseconds);
|
||||
|
||||
BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
WaitForMultipleObjects(
|
||||
boost::winapi::DWORD_ nCount,
|
||||
boost::winapi::HANDLE_ const* lpHandles,
|
||||
boost::winapi::BOOL_ bWaitAll,
|
||||
boost::winapi::DWORD_ dwMilliseconds);
|
||||
|
||||
BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
|
||||
WaitForMultipleObjectsEx(
|
||||
boost::winapi::DWORD_ nCount,
|
||||
boost::winapi::HANDLE_ const* lpHandles,
|
||||
boost::winapi::BOOL_ bWaitAll,
|
||||
boost::winapi::DWORD_ dwMilliseconds,
|
||||
boost::winapi::BOOL_ bAlertable);
|
||||
#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
using ::WaitForSingleObjectEx;
|
||||
#endif
|
||||
#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
|
||||
using ::SignalObjectAndWait;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOOST_WINAPI_PARTITION_APP_SYSTEM
|
||||
using ::WaitForMultipleObjects;
|
||||
using ::WaitForMultipleObjectsEx;
|
||||
using ::WaitForSingleObject;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_WAIT_HPP_INCLUDED_
|
||||
52
src/boost/winapi/wait_constants.hpp
Normal file
52
src/boost/winapi/wait_constants.hpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2020 Andrey Semashev
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
#ifndef BOOST_WINAPI_WAIT_CONSTANTS_HPP_INCLUDED_
|
||||
#define BOOST_WINAPI_WAIT_CONSTANTS_HPP_INCLUDED_
|
||||
|
||||
#include <boost/winapi/basic_types.hpp>
|
||||
#include <boost/winapi/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INFINITE_ = INFINITE;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_ABANDONED_ = WAIT_ABANDONED;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_OBJECT_0_ = WAIT_OBJECT_0;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_TIMEOUT_ = WAIT_TIMEOUT;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_FAILED_ = WAIT_FAILED;
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ INFINITE_ = (DWORD_)0xFFFFFFFF;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_ABANDONED_ = 0x00000080L;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_OBJECT_0_ = 0x00000000L;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_TIMEOUT_ = 0x00000102L;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ WAIT_FAILED_ = (DWORD_)0xFFFFFFFF;
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ infinite = INFINITE_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ wait_abandoned = WAIT_ABANDONED_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ wait_object_0 = WAIT_OBJECT_0_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ wait_timeout = WAIT_TIMEOUT_;
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ wait_failed = WAIT_FAILED_;
|
||||
|
||||
BOOST_CONSTEXPR_OR_CONST DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#include <boost/winapi/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_WINAPI_WAIT_CONSTANTS_HPP_INCLUDED_
|
||||
Loading…
Add table
Add a link
Reference in a new issue