mirror of
https://github.com/boostorg/detail.git
synced 2025-07-30 12:27:15 +02:00
The files were moved to Boost.WinAPI submodule.
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
// GetCurrentProcess.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentProcess;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentProcess();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
|
@ -1,38 +0,0 @@
|
||||
// GetCurrentThread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( UNDER_CE )
|
||||
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
|
||||
inline HANDLE_ GetCurrentThread()
|
||||
{
|
||||
return ::GetCurrentThread();
|
||||
}
|
||||
#else
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentThread;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
|
@ -1,31 +0,0 @@
|
||||
// GetLastError.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetLastError;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) DWORD_ WINAPI
|
||||
GetLastError();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
|
@ -1,39 +0,0 @@
|
||||
// GetProcessTimes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
||||
|
||||
#include <boost/detail/winapi/time.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetProcessTimes;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) BOOL_ WINAPI
|
||||
GetProcessTimes(
|
||||
HANDLE_ hProcess,
|
||||
LPFILETIME_ lpCreationTime,
|
||||
LPFILETIME_ lpExitTime,
|
||||
LPFILETIME_ lpKernelTime,
|
||||
LPFILETIME_ lpUserTime
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
|
@ -1,37 +0,0 @@
|
||||
// GetThreadTimes.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
||||
|
||||
#include <boost/detail/winapi/time.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetThreadTimes;
|
||||
#else
|
||||
extern "C" __declspec(dllimport) BOOL_ WINAPI
|
||||
GetThreadTimes(
|
||||
HANDLE_ hThread,
|
||||
LPFILETIME_ lpCreationTime,
|
||||
LPFILETIME_ lpExitTime,
|
||||
LPFILETIME_ lpKernelTime,
|
||||
LPFILETIME_ lpUserTime
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
|
@ -1,33 +0,0 @@
|
||||
// LocalFree.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_LOCALFREE_HPP
|
||||
#define BOOST_DETAIL_WINAPI_LOCALFREE_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef HANDLE_ HLOCAL_;
|
||||
|
||||
using ::LocalFree;
|
||||
#else
|
||||
extern "C" typedef HANDLE_ HLOCAL_;
|
||||
extern "C" __declspec(dllimport) HLOCAL_ WINAPI
|
||||
LocalFree(HLOCAL_ hMem);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WINAPI_LOCALFREE_HPP
|
@ -1,134 +0,0 @@
|
||||
// basic_types.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
||||
|
||||
#include <cstdarg>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/detail/winapi/config.hpp>
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
# include <windows.h>
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
||||
# include <winerror.h>
|
||||
// @FIXME Which condition must be tested
|
||||
# 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
|
||||
# else
|
||||
# ifndef WINAPI
|
||||
# define WINAPI __stdcall
|
||||
# endif
|
||||
# endif
|
||||
# ifndef NTAPI
|
||||
# define NTAPI __stdcall
|
||||
# endif
|
||||
#else
|
||||
# error "Win32 functions not available"
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::BOOL BOOL_;
|
||||
typedef ::BOOLEAN BOOLEAN_;
|
||||
typedef ::PBOOLEAN PBOOLEAN_;
|
||||
typedef ::BYTE BYTE_;
|
||||
typedef ::WORD WORD_;
|
||||
typedef ::DWORD DWORD_;
|
||||
typedef ::HANDLE HANDLE_;
|
||||
typedef ::HMODULE HMODULE_;
|
||||
typedef ::LONG LONG_;
|
||||
typedef ::ULONG ULONG_;
|
||||
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 ::LARGE_INTEGER LARGE_INTEGER_;
|
||||
typedef ::PLARGE_INTEGER PLARGE_INTEGER_;
|
||||
typedef ::PVOID PVOID_;
|
||||
typedef ::LPVOID LPVOID_;
|
||||
typedef ::CHAR CHAR_;
|
||||
typedef ::LPSTR LPSTR_;
|
||||
typedef ::LPCSTR LPCSTR_;
|
||||
typedef ::WCHAR WCHAR_;
|
||||
typedef ::LPWSTR LPWSTR_;
|
||||
typedef ::LPCWSTR LPCWSTR_;
|
||||
#else
|
||||
extern "C" {
|
||||
typedef int BOOL_;
|
||||
typedef unsigned char BYTE_;
|
||||
typedef BYTE_ BOOLEAN_;
|
||||
typedef BOOLEAN_* PBOOLEAN_;
|
||||
typedef unsigned short WORD_;
|
||||
typedef unsigned long DWORD_;
|
||||
typedef void* HANDLE_;
|
||||
typedef void* HMODULE_;
|
||||
|
||||
typedef long LONG_;
|
||||
typedef unsigned long ULONG_;
|
||||
|
||||
typedef boost::int64_t LONGLONG_;
|
||||
typedef boost::uint64_t ULONGLONG_;
|
||||
|
||||
// @FIXME Which condition must be tested
|
||||
# ifdef _WIN64
|
||||
#if defined(__CYGWIN__)
|
||||
typedef long INT_PTR_;
|
||||
typedef unsigned long UINT_PTR_;
|
||||
typedef long LONG_PTR_;
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
#else
|
||||
typedef __int64 INT_PTR_;
|
||||
typedef unsigned __int64 UINT_PTR_;
|
||||
typedef __int64 LONG_PTR_;
|
||||
typedef unsigned __int64 ULONG_PTR_;
|
||||
#endif
|
||||
# else
|
||||
typedef int INT_PTR_;
|
||||
typedef unsigned int UINT_PTR_;
|
||||
typedef long LONG_PTR_;
|
||||
typedef unsigned long ULONG_PTR_;
|
||||
# endif
|
||||
|
||||
typedef struct _LARGE_INTEGER {
|
||||
LONGLONG_ QuadPart;
|
||||
} LARGE_INTEGER_;
|
||||
typedef LARGE_INTEGER_ *PLARGE_INTEGER_;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
|
@ -1,53 +0,0 @@
|
||||
// config.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
#define BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#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
|
||||
|
||||
#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 XP API
|
||||
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_USE_WINDOWS_H)
|
||||
// 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
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
|
@ -1,46 +0,0 @@
|
||||
// directory_management.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/security.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CreateDirectory;
|
||||
using ::CreateDirectoryA;
|
||||
using ::GetTempPathA;
|
||||
using ::RemoveDirectoryA;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) int __stdcall
|
||||
CreateDirectory(LPCTSTR_, LPSECURITY_ATTRIBUTES_*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
CreateDirectoryA(LPCTSTR_, interprocess_security_attributes*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
GetTempPathA(unsigned long length, char *buffer);
|
||||
__declspec(dllimport) int __stdcall
|
||||
RemoveDirectoryA(LPCTSTR_);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -1,86 +0,0 @@
|
||||
// dll.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_DLL_HPP
|
||||
#define BOOST_DETAIL_WINAPI_DLL_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/security.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::FARPROC FARPROC_;
|
||||
typedef ::NEARPROC NEARPROC_;
|
||||
typedef ::PROC PROC_;
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
using ::LoadLibraryW;
|
||||
using ::GetModuleHandleW;
|
||||
# else
|
||||
using ::LoadLibraryA;
|
||||
using ::GetModuleHandleA;
|
||||
# endif
|
||||
using ::FreeLibrary;
|
||||
using ::GetProcAddress;
|
||||
#else
|
||||
extern "C" {
|
||||
# ifdef _WIN64
|
||||
typedef INT_PTR_ (WINAPI *FARPROC_)();
|
||||
typedef INT_PTR_ (WINAPI *NEARPROC_)();
|
||||
typedef INT_PTR_ (WINAPI *PROC_)();
|
||||
# else
|
||||
typedef int (WINAPI *FARPROC_)();
|
||||
typedef int (WINAPI *NEARPROC_)();
|
||||
typedef int (WINAPI *PROC_)();
|
||||
# endif // _WIN64
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
__declspec(dllimport) HMODULE_ WINAPI
|
||||
LoadLibraryW(
|
||||
LPCWSTR_ lpFileName
|
||||
);
|
||||
__declspec(dllimport) HMODULE_ WINAPI
|
||||
GetModuleHandleW(
|
||||
LPCWSTR_ lpFileName
|
||||
);
|
||||
# else
|
||||
__declspec(dllimport) HMODULE_ WINAPI
|
||||
LoadLibraryA(
|
||||
LPCSTR_ lpFileName
|
||||
);
|
||||
__declspec(dllimport) HMODULE_ WINAPI
|
||||
GetModuleHandleA(
|
||||
LPCSTR_ lpFileName
|
||||
);
|
||||
# endif
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
FreeLibrary(
|
||||
HMODULE_ hModule
|
||||
);
|
||||
__declspec(dllimport) FARPROC_ WINAPI
|
||||
GetProcAddress(
|
||||
HMODULE_ hModule,
|
||||
LPCSTR_ lpProcName
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_DLL_HPP
|
@ -1,93 +0,0 @@
|
||||
// error_handling.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||
#define BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/GetCurrentThread.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::FormatMessageA;
|
||||
using ::FormatMessageW;
|
||||
|
||||
const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER;
|
||||
const int FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS;
|
||||
const int FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING;
|
||||
const int FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE;
|
||||
const int FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM;
|
||||
const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY;
|
||||
const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK;
|
||||
|
||||
const char LANG_NEUTRAL_= LANG_NEUTRAL;
|
||||
const char LANG_INVARIANT_= LANG_INVARIANT;
|
||||
|
||||
const char SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default
|
||||
inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) {
|
||||
return MAKELANGID(p,s);
|
||||
}
|
||||
#else
|
||||
extern "C" {
|
||||
// using ::FormatMessageA;
|
||||
__declspec(dllimport)
|
||||
DWORD_
|
||||
WINAPI
|
||||
FormatMessageA(
|
||||
DWORD_ dwFlags,
|
||||
LPCVOID_ lpSource,
|
||||
DWORD_ dwMessageId,
|
||||
DWORD_ dwLanguageId,
|
||||
LPSTR_ lpBuffer,
|
||||
DWORD_ nSize,
|
||||
va_list *Arguments
|
||||
);
|
||||
|
||||
// using ::FormatMessageW;
|
||||
__declspec(dllimport)
|
||||
DWORD_
|
||||
WINAPI
|
||||
FormatMessageW(
|
||||
DWORD_ dwFlags,
|
||||
LPCVOID_ lpSource,
|
||||
DWORD_ dwMessageId,
|
||||
DWORD_ dwLanguageId,
|
||||
LPWSTR_ lpBuffer,
|
||||
DWORD_ nSize,
|
||||
va_list *Arguments
|
||||
);
|
||||
|
||||
const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100;
|
||||
const int FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200;
|
||||
const int FORMAT_MESSAGE_FROM_STRING_= 0x00000400;
|
||||
const int FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800;
|
||||
const int FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000;
|
||||
const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000;
|
||||
const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF;
|
||||
|
||||
const char LANG_NEUTRAL_= 0x00;
|
||||
const char LANG_INVARIANT_= 0x7f;
|
||||
|
||||
const char SUBLANG_DEFAULT_= 0x01; // user default
|
||||
inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) {
|
||||
return ((((WORD_ )(s)) << 10) | (WORD_ )(p));
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
|
@ -1,130 +0,0 @@
|
||||
// thread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||
#define BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/security.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CreateFileA;
|
||||
using ::DeleteFileA;
|
||||
using ::FindFirstFileA;
|
||||
using ::FindNextFileA;
|
||||
using ::FindClose;
|
||||
using ::GetFileSizeEx;
|
||||
using ::MoveFileExA;
|
||||
using ::SetFileValidData;
|
||||
#else
|
||||
extern "C" {
|
||||
typedef struct _OVERLAPPED {
|
||||
ULONG_PTR Internal;
|
||||
ULONG_PTR InternalHigh;
|
||||
union {
|
||||
struct {
|
||||
DWORD Offset;
|
||||
DWORD OffsetHigh;
|
||||
} ;
|
||||
PVOID Pointer;
|
||||
} ;
|
||||
HANDLE hEvent;
|
||||
} OVERLAPPED, *LPOVERLAPPED;
|
||||
|
||||
|
||||
__declspec(dllimport) void * __stdcall
|
||||
CreateFileA (const char *, unsigned long, unsigned long, struct SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, void *);
|
||||
__declspec(dllimport) int __stdcall
|
||||
DeleteFileA (const char *);
|
||||
__declspec(dllimport) void *__stdcall
|
||||
FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData);
|
||||
__declspec(dllimport) int __stdcall
|
||||
FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData);
|
||||
__declspec(dllimport) int __stdcall
|
||||
FindClose(void *hFindFile);
|
||||
__declspec(dllimport) BOOL __stdcall
|
||||
GetFileSizeEx(
|
||||
HANDLE_ hFile,
|
||||
PLARGE_INTEGER_ lpFileSize
|
||||
);
|
||||
__declspec(dllimport) int __stdcall
|
||||
MoveFileExA (const char *, const char *, unsigned long);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetFileValidData(
|
||||
HANDLE_ hFile,
|
||||
LONGLONG_ ValidDataLength
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetEndOfFile(
|
||||
HANDLE_ hFile
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetFilePointerEx(
|
||||
HANDLE_ hFile,
|
||||
LARGE_INTEGER_ liDistanceToMove,
|
||||
PLARGE_INTEGER_ lpNewFilePointer,
|
||||
DWORD_ dwMoveMethod
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
LockFile(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFileOffsetLow,
|
||||
DWORD_ dwFileOffsetHigh,
|
||||
DWORD_ nNumberOfBytesToLockLow,
|
||||
DWORD_ nNumberOfBytesToLockHigh
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
UnlockFile(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFileOffsetLow,
|
||||
DWORD_ dwFileOffsetHigh,
|
||||
DWORD_ nNumberOfBytesToUnlockLow,
|
||||
DWORD_ nNumberOfBytesToUnlockHigh
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
LockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwFlags,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToLockLow,
|
||||
DWORD_ nNumberOfBytesToLockHigh,
|
||||
LPOVERLAPPED_ lpOverlapped
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
UnlockFileEx(
|
||||
HANDLE_ hFile,
|
||||
DWORD_ dwReserved,
|
||||
DWORD_ nNumberOfBytesToUnlockLow,
|
||||
DWORD_ nNumberOfBytesToUnlockHigh,
|
||||
LPOVERLAPPED_ lpOverlapped
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
WriteFile(
|
||||
HANDLE_ hFile,
|
||||
LPCVOID_ lpBuffer,
|
||||
DWORD_ nNumberOfBytesToWrite,
|
||||
LPDWORD_ lpNumberOfBytesWritten,
|
||||
LPOVERLAPPED_ lpOverlapped
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -1,46 +0,0 @@
|
||||
// memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||
#define BOOST_DETAIL_WINAPI_HANDLES_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CloseHandle;
|
||||
using ::DuplicateHandle;
|
||||
|
||||
const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE;
|
||||
const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS;
|
||||
const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) int __stdcall
|
||||
CloseHandle(void*);
|
||||
__declspec(dllimport) int __stdcall
|
||||
DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long);
|
||||
}
|
||||
const DWORD_ duplicate_close_source = 1;
|
||||
const DWORD_ duplicate_same_access = 2;
|
||||
const HANDLE_ invalid_handle_value = (HANDLE_)(-1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_HANDLES_HPP
|
@ -1,60 +0,0 @@
|
||||
// memory.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||
#define BOOST_DETAIL_WINAPI_MEMORY_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/security.hpp>
|
||||
#include <boost/detail/winapi/LocalFree.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::CreateFileMappingA;
|
||||
using ::FlushViewOfFile;
|
||||
using ::GetProcessHeap;
|
||||
using ::HeapAlloc;
|
||||
using ::HeapFree;
|
||||
using ::MapViewOfFileEx;
|
||||
using ::OpenFileMappingA;
|
||||
using ::UnmapViewOfFile;
|
||||
#else
|
||||
#undef HeapAlloc
|
||||
extern "C" {
|
||||
__declspec(dllimport) void * __stdcall
|
||||
CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *);
|
||||
__declspec(dllimport) int __stdcall
|
||||
FlushViewOfFile (void *, std::size_t);
|
||||
__declspec(dllimport) HANDLE_ __stdcall
|
||||
GetProcessHeap();
|
||||
__declspec(dllimport) void* __stdcall
|
||||
HeapAlloc(HANDLE_,DWORD_,SIZE_T_);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
HeapFree(HANDLE_,DWORD_,LPVOID_);
|
||||
__declspec(dllimport) void * __stdcall
|
||||
MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*);
|
||||
__declspec(dllimport) void * __stdcall
|
||||
OpenFileMappingA (unsigned long, int, const char *);
|
||||
__declspec(dllimport) int __stdcall
|
||||
UnmapViewOfFile(void *);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_MEMORY_HPP
|
@ -1,36 +0,0 @@
|
||||
// process.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_PROCESS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/GetCurrentProcess.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentProcessId;
|
||||
#else
|
||||
# ifndef UNDER_CE
|
||||
extern "C" {
|
||||
__declspec(dllimport) DWORD_ WINAPI GetCurrentProcessId(void);
|
||||
}
|
||||
# else
|
||||
using ::GetCurrentProcessId;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP
|
@ -1,65 +0,0 @@
|
||||
// security.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SECURITY_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_;
|
||||
typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_;
|
||||
typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_;
|
||||
|
||||
#else
|
||||
extern "C" {
|
||||
struct SECURITY_DESCRIPTOR_;
|
||||
typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_;
|
||||
typedef struct _ACL {
|
||||
BYTE_ AclRevision;
|
||||
BYTE_ Sbz1;
|
||||
WORD_ AclSize;
|
||||
WORD_ AceCount;
|
||||
WORD_ Sbz2;
|
||||
} ACL_, *PACL_;
|
||||
|
||||
typedef struct _SECURITY_ATTRIBUTES {
|
||||
DWORD_ nLength;
|
||||
LPVOID_ lpSecurityDescriptor;
|
||||
BOOL_ bInheritHandle;
|
||||
} SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
|
||||
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
InitializeSecurityDescriptor(
|
||||
PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
|
||||
DWORD_ dwRevision
|
||||
);
|
||||
__declspec(dllimport) BOOL_ __stdcall
|
||||
SetSecurityDescriptorDacl(
|
||||
PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
|
||||
BOOL_ bDaclPresent,
|
||||
PACL_ pDacl,
|
||||
BOOL_ bDaclDefaulted
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SECURITY_HPP
|
@ -1,293 +0,0 @@
|
||||
// synchronizaion.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
|
||||
typedef ::PAPCFUNC PAPCFUNC_;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
typedef ::INIT_ONCE INIT_ONCE_;
|
||||
typedef ::PINIT_ONCE PINIT_ONCE_;
|
||||
typedef ::LPINIT_ONCE LPINIT_ONCE_;
|
||||
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT
|
||||
typedef ::PINIT_ONCE_FN PINIT_ONCE_FN_;
|
||||
|
||||
typedef ::SRWLOCK SRWLOCK_;
|
||||
typedef ::PSRWLOCK PSRWLOCK_;
|
||||
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT SRWLOCK_INIT
|
||||
|
||||
typedef ::CONDITION_VARIABLE CONDITION_VARIABLE_;
|
||||
typedef ::PCONDITION_VARIABLE PCONDITION_VARIABLE_;
|
||||
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT CONDITION_VARIABLE_INIT
|
||||
#endif
|
||||
|
||||
using ::InitializeCriticalSection;
|
||||
#if BOOST_USE_WINAPI_VERSION >= 0x0403
|
||||
using ::InitializeCriticalSectionAndSpinCount;
|
||||
#endif
|
||||
using ::EnterCriticalSection;
|
||||
using ::TryEnterCriticalSection;
|
||||
using ::LeaveCriticalSection;
|
||||
using ::DeleteCriticalSection;
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
using ::CreateMutexW;
|
||||
using ::OpenMutexW;
|
||||
using ::CreateEventW;
|
||||
using ::OpenEventW;
|
||||
using ::CreateSemaphoreW;
|
||||
using ::OpenSemaphoreW;
|
||||
# else
|
||||
using ::CreateMutexA;
|
||||
using ::OpenMutexA;
|
||||
using ::CreateEventA;
|
||||
using ::OpenEventA;
|
||||
using ::CreateSemaphoreA;
|
||||
using ::OpenSemaphoreA;
|
||||
# endif
|
||||
using ::ReleaseMutex;
|
||||
using ::ReleaseSemaphore;
|
||||
using ::SetEvent;
|
||||
using ::ResetEvent;
|
||||
using ::WaitForMultipleObjects;
|
||||
using ::WaitForSingleObject;
|
||||
using ::QueueUserAPC;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
using ::InitOnceInitialize;
|
||||
using ::InitOnceExecuteOnce;
|
||||
using ::InitOnceBeginInitialize;
|
||||
using ::InitOnceComplete;
|
||||
|
||||
using ::InitializeSRWLock;
|
||||
using ::AcquireSRWLockExclusive;
|
||||
using ::TryAcquireSRWLockExclusive;
|
||||
using ::ReleaseSRWLockExclusive;
|
||||
using ::AcquireSRWLockShared;
|
||||
using ::TryAcquireSRWLockShared;
|
||||
using ::ReleaseSRWLockShared;
|
||||
|
||||
using ::InitializeConditionVariable;
|
||||
using ::WakeConditionVariable;
|
||||
using ::WakeAllConditionVariable;
|
||||
using ::SleepConditionVariableCS;
|
||||
using ::SleepConditionVariableSRW;
|
||||
#endif
|
||||
|
||||
const DWORD_ infinite = INFINITE;
|
||||
const DWORD_ wait_abandoned = WAIT_ABANDONED;
|
||||
const DWORD_ wait_object_0 = WAIT_OBJECT_0;
|
||||
const DWORD_ wait_timeout = WAIT_TIMEOUT;
|
||||
const DWORD_ wait_failed = WAIT_FAILED;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ init_once_async = INIT_ONCE_ASYNC;
|
||||
const DWORD_ init_once_check_only = INIT_ONCE_CHECK_ONLY;
|
||||
const DWORD_ init_once_init_failed = INIT_ONCE_INIT_FAILED;
|
||||
const DWORD_ init_once_ctx_reserved_bits = INIT_ONCE_CTX_RESERVED_BITS;
|
||||
|
||||
const ULONG_ condition_variable_lockmode_shared = CONDITION_VARIABLE_LOCKMODE_SHARED;
|
||||
#endif
|
||||
|
||||
#else // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
extern "C" {
|
||||
|
||||
typedef struct CRITICAL_SECTION_
|
||||
{
|
||||
struct critical_section_debug * DebugInfo;
|
||||
long LockCount;
|
||||
long RecursionCount;
|
||||
void * OwningThread;
|
||||
void * LockSemaphore;
|
||||
#if defined(_WIN64)
|
||||
unsigned __int64 SpinCount;
|
||||
#else
|
||||
unsigned long SpinCount;
|
||||
#endif
|
||||
}
|
||||
*PCRITICAL_SECTION_;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
typedef union INIT_ONCE_
|
||||
{
|
||||
PVOID_ Ptr;
|
||||
}
|
||||
*PINIT_ONCE_, *LPINIT_ONCE_;
|
||||
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT {0}
|
||||
typedef BOOL_ (WINAPI *PINIT_ONCE_FN_)(PINIT_ONCE_ InitOnce, PVOID_ Parameter, PVOID_ *Context);
|
||||
|
||||
typedef struct SRWLOCK_
|
||||
{
|
||||
PVOID_ Ptr;
|
||||
}
|
||||
* PSRWLOCK_;
|
||||
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT {0}
|
||||
|
||||
typedef struct CONDITION_VARIABLE_
|
||||
{
|
||||
PVOID_ Ptr;
|
||||
}
|
||||
* PCONDITION_VARIABLE_;
|
||||
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT {0}
|
||||
|
||||
#endif
|
||||
|
||||
__declspec(dllimport) void WINAPI
|
||||
InitializeCriticalSection(PCRITICAL_SECTION_);
|
||||
#if BOOST_USE_WINAPI_VERSION >= 0x0403
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION_* lpCS, DWORD_ dwSpinCount);
|
||||
#endif
|
||||
__declspec(dllimport) void WINAPI
|
||||
EnterCriticalSection(PCRITICAL_SECTION_);
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
TryEnterCriticalSection(PCRITICAL_SECTION_);
|
||||
__declspec(dllimport) void WINAPI
|
||||
LeaveCriticalSection(PCRITICAL_SECTION_);
|
||||
__declspec(dllimport) void WINAPI
|
||||
DeleteCriticalSection(PCRITICAL_SECTION_);
|
||||
|
||||
struct _SECURITY_ATTRIBUTES;
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
CreateMutexW(_SECURITY_ATTRIBUTES*, BOOL_, LPCWSTR_);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
OpenMutexW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
CreateSemaphoreW(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCWSTR_);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
OpenSemaphoreW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
CreateEventW(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCWSTR_);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
OpenEventW(DWORD_, BOOL_, LPCWSTR_);
|
||||
# else
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
CreateMutexA(_SECURITY_ATTRIBUTES*, BOOL_, LPCSTR_);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
OpenMutexA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
CreateSemaphoreA(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCSTR_);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
OpenSemaphoreA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
CreateEventA(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCSTR_);
|
||||
__declspec(dllimport) HANDLE_ WINAPI
|
||||
OpenEventA(DWORD_, BOOL_, LPCSTR_);
|
||||
# endif
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
ReleaseMutex(HANDLE_);
|
||||
__declspec(dllimport) DWORD_ WINAPI
|
||||
WaitForSingleObject(HANDLE_, DWORD_);
|
||||
__declspec(dllimport) DWORD_ WINAPI
|
||||
WaitForMultipleObjects(DWORD_ nCount,
|
||||
HANDLE_ const * lpHandles,
|
||||
BOOL_ bWaitAll,
|
||||
DWORD_ dwMilliseconds);
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
ReleaseSemaphore(HANDLE_, LONG_, LONG_*);
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
SetEvent(HANDLE_);
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
ResetEvent(HANDLE_);
|
||||
|
||||
typedef void (__stdcall *PAPCFUNC_)(ULONG_PTR_);
|
||||
__declspec(dllimport) DWORD_ WINAPI
|
||||
QueueUserAPC(PAPCFUNC_, HANDLE_, ULONG_PTR_);
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
__declspec(dllimport) void WINAPI InitOnceInitialize(PINIT_ONCE_);
|
||||
__declspec(dllimport) BOOL_ WINAPI InitOnceExecuteOnce(PINIT_ONCE_ InitOnce, PINIT_ONCE_FN_ InitFn, PVOID_ Parameter, LPVOID_* Context);
|
||||
__declspec(dllimport) BOOL_ WINAPI InitOnceBeginInitialize(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, BOOL_* fPending, LPVOID_* lpContext);
|
||||
__declspec(dllimport) BOOL_ WINAPI InitOnceComplete(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, LPVOID_* lpContext);
|
||||
|
||||
|
||||
__declspec(dllimport) void WINAPI InitializeSRWLock(PSRWLOCK_ SRWLock);
|
||||
__declspec(dllimport) void WINAPI AcquireSRWLockExclusive(PSRWLOCK_ SRWLock);
|
||||
__declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockExclusive(PSRWLOCK_ SRWLock);
|
||||
__declspec(dllimport) void WINAPI ReleaseSRWLockExclusive(PSRWLOCK_ SRWLock);
|
||||
__declspec(dllimport) void WINAPI AcquireSRWLockShared(PSRWLOCK_ SRWLock);
|
||||
__declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockShared(PSRWLOCK_ SRWLock);
|
||||
__declspec(dllimport) void WINAPI ReleaseSRWLockShared(PSRWLOCK_ SRWLock);
|
||||
|
||||
__declspec(dllimport) void WINAPI InitializeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable);
|
||||
__declspec(dllimport) void WINAPI WakeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable);
|
||||
__declspec(dllimport) void WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE_ ConditionVariable);
|
||||
__declspec(dllimport) BOOL_ WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE_ ConditionVariable, PCRITICAL_SECTION_ CriticalSection, DWORD_ dwMilliseconds);
|
||||
__declspec(dllimport) BOOL_ WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE_ ConditionVariable, PSRWLOCK_ SRWLock, DWORD_ dwMilliseconds, ULONG_ Flags);
|
||||
#endif
|
||||
|
||||
} // extern "C"
|
||||
|
||||
const DWORD_ infinite = (DWORD_)0xFFFFFFFF;
|
||||
const DWORD_ wait_abandoned = 0x00000080L;
|
||||
const DWORD_ wait_object_0 = 0x00000000L;
|
||||
const DWORD_ wait_timeout = 0x00000102L;
|
||||
const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF;
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
const DWORD_ init_once_async = 0x00000002UL;
|
||||
const DWORD_ init_once_check_only = 0x00000001UL;
|
||||
const DWORD_ init_once_init_failed = 0x00000004UL;
|
||||
const DWORD_ init_once_ctx_reserved_bits = 2;
|
||||
|
||||
const ULONG_ condition_variable_lockmode_shared = 0x00000001;
|
||||
#endif
|
||||
|
||||
#endif // defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bInitialOwner)
|
||||
{
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
return CreateMutexW(lpAttributes, bInitialOwner, 0);
|
||||
#else
|
||||
return CreateMutexA(lpAttributes, bInitialOwner, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_semaphore(_SECURITY_ATTRIBUTES* lpAttributes, LONG_ lInitialCount, LONG_ lMaximumCount)
|
||||
{
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
return CreateSemaphoreW(lpAttributes, lInitialCount, lMaximumCount, 0);
|
||||
#else
|
||||
return CreateSemaphoreA(lpAttributes, lInitialCount, lMaximumCount, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_event(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bManualReset, BOOL_ bInitialState)
|
||||
{
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
return CreateEventW(lpAttributes, bManualReset, bInitialState, 0);
|
||||
#else
|
||||
return CreateEventA(lpAttributes, bManualReset, bInitialState, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
|
@ -1,52 +0,0 @@
|
||||
// system.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||
#define BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
typedef ::SYSTEM_INFO SYSTEM_INFO_;
|
||||
extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *);
|
||||
#else
|
||||
extern "C" {
|
||||
typedef struct _SYSTEM_INFO {
|
||||
union {
|
||||
DWORD_ dwOemId;
|
||||
struct {
|
||||
WORD_ wProcessorArchitecture;
|
||||
WORD_ wReserved;
|
||||
} dummy;
|
||||
} ;
|
||||
DWORD_ dwPageSize;
|
||||
LPVOID_ lpMinimumApplicationAddress;
|
||||
LPVOID_ lpMaximumApplicationAddress;
|
||||
DWORD_PTR_ dwActiveProcessorMask;
|
||||
DWORD_ dwNumberOfProcessors;
|
||||
DWORD_ dwProcessorType;
|
||||
DWORD_ dwAllocationGranularity;
|
||||
WORD_ wProcessorLevel;
|
||||
WORD_ wProcessorRevision;
|
||||
} SYSTEM_INFO_;
|
||||
|
||||
__declspec(dllimport) void __stdcall
|
||||
GetSystemInfo (struct system_info *);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP
|
@ -1,49 +0,0 @@
|
||||
// thread.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||
#define BOOST_DETAIL_WINAPI_THREAD_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/GetCurrentThread.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::GetCurrentThreadId;
|
||||
using ::SleepEx;
|
||||
using ::Sleep;
|
||||
using ::SwitchToThread;
|
||||
#else
|
||||
extern "C" {
|
||||
# ifndef UNDER_CE
|
||||
__declspec(dllimport) DWORD_ WINAPI GetCurrentThreadId(void);
|
||||
__declspec(dllimport) DWORD_ WINAPI SleepEx(DWORD_, BOOL_);
|
||||
__declspec(dllimport) void WINAPI Sleep(DWORD_);
|
||||
__declspec(dllimport) BOOL_ WINAPI SwitchToThread(void);
|
||||
#else
|
||||
using ::GetCurrentThreadId;
|
||||
using ::SleepEx;
|
||||
using ::Sleep;
|
||||
using ::SwitchToThread;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
|
@ -1,96 +0,0 @@
|
||||
// thread_pool.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
|
||||
#define BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_;
|
||||
typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_;
|
||||
|
||||
using ::RegisterWaitForSingleObject;
|
||||
using ::UnregisterWait;
|
||||
using ::UnregisterWaitEx;
|
||||
|
||||
const ULONG_ wt_execute_default = WT_EXECUTEDEFAULT;
|
||||
const ULONG_ wt_execute_in_io_thread = WT_EXECUTEINIOTHREAD;
|
||||
const ULONG_ wt_execute_in_ui_thread = WT_EXECUTEINUITHREAD;
|
||||
const ULONG_ wt_execute_in_wait_thread = WT_EXECUTEINWAITTHREAD;
|
||||
const ULONG_ wt_execute_only_once = WT_EXECUTEONLYONCE;
|
||||
const ULONG_ wt_execute_in_timer_thread = WT_EXECUTEINTIMERTHREAD;
|
||||
const ULONG_ wt_execute_long_function = WT_EXECUTELONGFUNCTION;
|
||||
const ULONG_ wt_execute_in_persistent_io_thread = WT_EXECUTEINPERSISTENTIOTHREAD;
|
||||
const ULONG_ wt_execute_in_persistent_thread = WT_EXECUTEINPERSISTENTTHREAD;
|
||||
const ULONG_ wt_transfer_impersonation = WT_TRANSFER_IMPERSONATION;
|
||||
|
||||
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
|
||||
{
|
||||
return WT_SET_MAX_THREADPOOL_THREADS(flags, limit);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
extern "C" {
|
||||
|
||||
typedef void (NTAPI* WAITORTIMERCALLBACKFUNC_) (PVOID_, BOOLEAN_);
|
||||
typedef WAITORTIMERCALLBACKFUNC_ WAITORTIMERCALLBACK_;
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI RegisterWaitForSingleObject
|
||||
(
|
||||
HANDLE_* phNewWaitObject,
|
||||
HANDLE_ hObject,
|
||||
WAITORTIMERCALLBACK_ Callback,
|
||||
PVOID_ Context,
|
||||
ULONG_ dwMilliseconds,
|
||||
ULONG_ dwFlags
|
||||
);
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI UnregisterWait(HANDLE_ WaitHandle);
|
||||
__declspec(dllimport) BOOL_ WINAPI UnregisterWaitEx(HANDLE_ WaitHandle, HANDLE_ CompletionEvent);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
const ULONG_ wt_execute_default = 0x00000000;
|
||||
const ULONG_ wt_execute_in_io_thread = 0x00000001;
|
||||
const ULONG_ wt_execute_in_ui_thread = 0x00000002;
|
||||
const ULONG_ wt_execute_in_wait_thread = 0x00000004;
|
||||
const ULONG_ wt_execute_only_once = 0x00000008;
|
||||
const ULONG_ wt_execute_in_timer_thread = 0x00000020;
|
||||
const ULONG_ wt_execute_long_function = 0x00000010;
|
||||
const ULONG_ wt_execute_in_persistent_io_thread = 0x00000040;
|
||||
const ULONG_ wt_execute_in_persistent_thread = 0x00000080;
|
||||
const ULONG_ wt_transfer_impersonation = 0x00000100;
|
||||
|
||||
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
|
||||
{
|
||||
return flags | (limit << 16);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
|
@ -1,96 +0,0 @@
|
||||
// time.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TIME_HPP
|
||||
#define BOOST_DETAIL_WINAPI_TIME_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace winapi {
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef FILETIME FILETIME_;
|
||||
typedef PFILETIME PFILETIME_;
|
||||
typedef LPFILETIME LPFILETIME_;
|
||||
|
||||
typedef SYSTEMTIME SYSTEMTIME_;
|
||||
typedef SYSTEMTIME* PSYSTEMTIME_;
|
||||
|
||||
#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
|
||||
using ::GetSystemTimeAsFileTime;
|
||||
#endif
|
||||
using ::FileTimeToLocalFileTime;
|
||||
using ::GetSystemTime;
|
||||
using ::SystemTimeToFileTime;
|
||||
using ::GetTickCount;
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
using ::GetTickCount64;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
extern "C" {
|
||||
typedef struct _FILETIME {
|
||||
DWORD_ dwLowDateTime;
|
||||
DWORD_ dwHighDateTime;
|
||||
} FILETIME_, *PFILETIME_, *LPFILETIME_;
|
||||
|
||||
typedef struct _SYSTEMTIME {
|
||||
WORD_ wYear;
|
||||
WORD_ wMonth;
|
||||
WORD_ wDayOfWeek;
|
||||
WORD_ wDay;
|
||||
WORD_ wHour;
|
||||
WORD_ wMinute;
|
||||
WORD_ wSecond;
|
||||
WORD_ wMilliseconds;
|
||||
} SYSTEMTIME_, *PSYSTEMTIME_;
|
||||
|
||||
#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
|
||||
__declspec(dllimport) void WINAPI
|
||||
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
||||
#endif
|
||||
__declspec(dllimport) int WINAPI
|
||||
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
||||
FILETIME_* lpLocalFileTime);
|
||||
__declspec(dllimport) void WINAPI
|
||||
GetSystemTime(SYSTEMTIME_* lpSystemTime);
|
||||
__declspec(dllimport) int WINAPI
|
||||
SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime,
|
||||
FILETIME_* lpFileTime);
|
||||
__declspec(dllimport) DWORD_ WINAPI
|
||||
GetTickCount();
|
||||
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
|
||||
__declspec(dllimport) ULONGLONG_ WINAPI
|
||||
GetTickCount64();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_GETSYSTEMTIMEASFILETIME
|
||||
inline void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
|
||||
{
|
||||
SYSTEMTIME_ st;
|
||||
GetSystemTime(&st);
|
||||
SystemTimeToFileTime(&st, lpFileTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_TIME_HPP
|
@ -1,44 +0,0 @@
|
||||
// timers.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_TIMERS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
using ::QueryPerformanceCounter;
|
||||
using ::QueryPerformanceFrequency;
|
||||
#else
|
||||
extern "C" {
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
QueryPerformanceCounter(
|
||||
LARGE_INTEGER_ *lpPerformanceCount
|
||||
);
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI
|
||||
QueryPerformanceFrequency(
|
||||
LARGE_INTEGER_ *lpFrequency
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_TIMERS_HPP
|
@ -1,49 +0,0 @@
|
||||
// tls.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_TLS_HPP
|
||||
#define BOOST_DETAIL_WINAPI_TLS_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
using ::TlsAlloc;
|
||||
using ::TlsGetValue;
|
||||
using ::TlsSetValue;
|
||||
using ::TlsFree;
|
||||
|
||||
const DWORD_ tls_out_of_indexes = TLS_OUT_OF_INDEXES;
|
||||
|
||||
#else
|
||||
|
||||
extern "C" {
|
||||
__declspec(dllimport) DWORD_ WINAPI TlsAlloc(void);
|
||||
__declspec(dllimport) LPVOID_ WINAPI TlsGetValue(DWORD_ dwTlsIndex);
|
||||
__declspec(dllimport) BOOL_ WINAPI TlsSetValue(DWORD_ dwTlsIndex, LPVOID_ lpTlsValue);
|
||||
__declspec(dllimport) BOOL_ WINAPI TlsFree(DWORD_ dwTlsIndex);
|
||||
}
|
||||
|
||||
const DWORD_ tls_out_of_indexes = 0xFFFFFFFF;
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_TLS_HPP
|
@ -1,110 +0,0 @@
|
||||
// waitable_timer.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright 2013 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#ifndef BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
|
||||
#define BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
|
||||
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
namespace winapi
|
||||
{
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_;
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
using ::CreateWaitableTimerW;
|
||||
using ::OpenWaitableTimerW;
|
||||
# else
|
||||
using ::CreateWaitableTimerA;
|
||||
using ::OpenWaitableTimerA;
|
||||
# endif
|
||||
using ::SetWaitableTimer;
|
||||
using ::CancelWaitableTimer;
|
||||
|
||||
#else
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct _SECURITY_ATTRIBUTES;
|
||||
|
||||
typedef void (WINAPI* PTIMERAPCROUTINE_)
|
||||
(
|
||||
LPVOID_ lpArgToCompletionRoutine,
|
||||
DWORD_ dwTimerLowValue,
|
||||
DWORD_ dwTimerHighValue
|
||||
);
|
||||
|
||||
# ifdef BOOST_NO_ANSI_APIS
|
||||
__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerW
|
||||
(
|
||||
_SECURITY_ATTRIBUTES* lpTimerAttributes,
|
||||
BOOL_ bManualReset,
|
||||
LPCWSTR_ lpTimerName
|
||||
);
|
||||
|
||||
__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerW
|
||||
(
|
||||
DWORD_ dwDesiredAccess,
|
||||
BOOL_ bInheritHandle,
|
||||
LPCWSTR_ lpTimerName
|
||||
);
|
||||
# else
|
||||
__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerA
|
||||
(
|
||||
_SECURITY_ATTRIBUTES* lpTimerAttributes,
|
||||
BOOL_ bManualReset,
|
||||
LPCSTR_ lpTimerName
|
||||
);
|
||||
|
||||
__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerA
|
||||
(
|
||||
DWORD_ dwDesiredAccess,
|
||||
BOOL_ bInheritHandle,
|
||||
LPCSTR_ lpTimerName
|
||||
);
|
||||
# endif
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI SetWaitableTimer
|
||||
(
|
||||
HANDLE_ hTimer,
|
||||
const LARGE_INTEGER_ *lpDueTime,
|
||||
LONG_ lPeriod,
|
||||
PTIMERAPCROUTINE_ pfnCompletionRoutine,
|
||||
LPVOID_ lpArgToCompletionRoutine,
|
||||
BOOL_ fResume
|
||||
);
|
||||
|
||||
__declspec(dllimport) BOOL_ WINAPI CancelWaitableTimer(HANDLE_ hTimer);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(_SECURITY_ATTRIBUTES* lpTimerAttributes, BOOL_ bManualReset)
|
||||
{
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
return CreateWaitableTimerW(lpTimerAttributes, bManualReset, 0);
|
||||
#else
|
||||
return CreateWaitableTimerA(lpTimerAttributes, bManualReset, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
|
Reference in New Issue
Block a user