1 /*
2  * Copyright 2010 Vicente J. Botet Escriba
3  * Copyright (c) Microsoft Corporation 2014
4  * Copyright 2015 Andrey Semashev
5  *
6  * Distributed under the Boost Software License, Version 1.0.
7  * See http://www.boost.org/LICENSE_1_0.txt
8  */
9 
10 #ifndef BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
11 #define BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
12 
13 #include <boost/winapi/basic_types.hpp>
14 
15 #ifdef BOOST_HAS_PRAGMA_ONCE
16 #pragma once
17 #endif
18 
19 #if defined(BOOST_MSVC)
20 #pragma warning(push)
21 // nonstandard extension used : nameless struct/union
22 #pragma warning(disable: 4201)
23 #endif
24 
25 #if !defined( BOOST_USE_WINDOWS_H )
26 extern "C" {
27 struct _SYSTEM_INFO;
28 
29 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
30 BOOST_SYMBOL_IMPORT boost::winapi::VOID_ WINAPI
31 GetSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
32 #endif
33 
34 #if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
35 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
36 BOOST_SYMBOL_IMPORT boost::winapi::VOID_ WINAPI
37 GetNativeSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
38 #endif
39 #endif
40 }
41 #endif
42 
43 namespace boost {
44 namespace winapi {
45 
46 typedef struct BOOST_MAY_ALIAS _SYSTEM_INFO {
47     BOOST_WINAPI_DETAIL_EXTENSION union {
48         DWORD_ dwOemId;
49         BOOST_WINAPI_DETAIL_EXTENSION struct {
50             WORD_ wProcessorArchitecture;
51             WORD_ wReserved;
52         };
53     };
54     DWORD_ dwPageSize;
55     LPVOID_ lpMinimumApplicationAddress;
56     LPVOID_ lpMaximumApplicationAddress;
57     DWORD_PTR_ dwActiveProcessorMask;
58     DWORD_ dwNumberOfProcessors;
59     DWORD_ dwProcessorType;
60     DWORD_ dwAllocationGranularity;
61     WORD_ wProcessorLevel;
62     WORD_ wProcessorRevision;
63 } SYSTEM_INFO_, *LPSYSTEM_INFO_;
64 
65 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)66 BOOST_FORCEINLINE VOID_ GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
67 {
68     ::GetSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
69 }
70 #endif
71 
72 #if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
73 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)74 BOOST_FORCEINLINE VOID_ GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
75 {
76     ::GetNativeSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
77 }
78 #endif
79 #endif
80 }
81 }
82 
83 #if defined(BOOST_MSVC)
84 #pragma warning(pop)
85 #endif
86 
87 #endif // BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
88