system.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. #ifndef BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
  10. #define BOOST_WINAPI_SYSTEM_HPP_INCLUDED_
  11. #include <boost/winapi/basic_types.hpp>
  12. #ifdef BOOST_HAS_PRAGMA_ONCE
  13. #pragma once
  14. #endif
  15. #if defined(BOOST_MSVC)
  16. #pragma warning(push)
  17. // nonstandard extension used : nameless struct/union
  18. #pragma warning(disable: 4201)
  19. #endif
  20. #if !defined( BOOST_USE_WINDOWS_H )
  21. extern "C" {
  22. struct _SYSTEM_INFO;
  23. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  24. BOOST_SYMBOL_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  25. GetSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
  26. #endif
  27. #if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
  28. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
  29. BOOST_SYMBOL_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  30. GetNativeSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
  31. #endif
  32. #endif
  33. }
  34. #endif
  35. namespace boost {
  36. namespace winapi {
  37. typedef struct BOOST_MAY_ALIAS _SYSTEM_INFO {
  38. BOOST_WINAPI_DETAIL_EXTENSION union {
  39. DWORD_ dwOemId;
  40. BOOST_WINAPI_DETAIL_EXTENSION struct {
  41. WORD_ wProcessorArchitecture;
  42. WORD_ wReserved;
  43. };
  44. };
  45. DWORD_ dwPageSize;
  46. LPVOID_ lpMinimumApplicationAddress;
  47. LPVOID_ lpMaximumApplicationAddress;
  48. DWORD_PTR_ dwActiveProcessorMask;
  49. DWORD_ dwNumberOfProcessors;
  50. DWORD_ dwProcessorType;
  51. DWORD_ dwAllocationGranularity;
  52. WORD_ wProcessorLevel;
  53. WORD_ wProcessorRevision;
  54. } SYSTEM_INFO_, *LPSYSTEM_INFO_;
  55. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  56. BOOST_FORCEINLINE VOID_ GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
  57. {
  58. ::GetSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
  59. }
  60. #endif
  61. #if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
  62. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
  63. BOOST_FORCEINLINE VOID_ GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
  64. {
  65. ::GetNativeSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
  66. }
  67. #endif
  68. #endif
  69. }
  70. }
  71. #if defined(BOOST_MSVC)
  72. #pragma warning(pop)
  73. #endif
  74. #endif // BOOST_WINAPI_SYSTEM_HPP_INCLUDED_