1 /* 2 * Copyright 2016 Andrey Semashev 3 * 4 * Distributed under the Boost Software License, Version 1.0. 5 * See http://www.boost.org/LICENSE_1_0.txt 6 */ 7 8 #ifndef BOOST_WINAPI_PAGE_PROTECTION_FLAGS_HPP_INCLUDED_ 9 #define BOOST_WINAPI_PAGE_PROTECTION_FLAGS_HPP_INCLUDED_ 10 11 #include <boost/winapi/basic_types.hpp> 12 #include <boost/winapi/detail/header.hpp> 13 14 #ifdef BOOST_HAS_PRAGMA_ONCE 15 #pragma once 16 #endif 17 18 namespace boost { 19 namespace winapi { 20 21 #if defined( BOOST_USE_WINDOWS_H ) 22 23 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_NOACCESS_ = PAGE_NOACCESS; 24 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_READONLY_ = PAGE_READONLY; 25 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_READWRITE_ = PAGE_READWRITE; 26 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_WRITECOPY_ = PAGE_WRITECOPY; 27 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_GUARD_ = PAGE_GUARD; 28 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_NOCACHE_ = PAGE_NOCACHE; 29 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_WRITECOMBINE_ = PAGE_WRITECOMBINE; 30 31 #else // defined( BOOST_USE_WINDOWS_H ) 32 33 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_NOACCESS_ = 0x01; 34 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_READONLY_ = 0x02; 35 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_READWRITE_ = 0x04; 36 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_WRITECOPY_ = 0x08; 37 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_GUARD_ = 0x100; 38 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_NOCACHE_ = 0x200; 39 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_WRITECOMBINE_ = 0x400; 40 41 #endif // defined( BOOST_USE_WINDOWS_H ) 42 43 // The PAGE_EXECUTE flags were put into the DESKTOP UWP partition in Windows SDK 8.0 and 8.1 44 // and then moved to be globally available again in SDK 10.0. Due to this, we simply define 45 // them unconditionally to work around the issue and consider the 8.x SDKs in error. 46 47 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_EXECUTE_ = 0x10; 48 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_EXECUTE_READ_ = 0x20; 49 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_EXECUTE_READWRITE_ = 0x40; 50 BOOST_CONSTEXPR_OR_CONST DWORD_ PAGE_EXECUTE_WRITECOPY_ = 0x80; 51 52 } 53 } 54 55 #include <boost/winapi/detail/footer.hpp> 56 57 #endif // BOOST_WINAPI_PAGE_PROTECTION_FLAGS_HPP_INCLUDED_ 58