system.hpp 2.1 KB

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