priority_class.hpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright 2016 Klemens D. Morgenstern
  3. * Copyright 2016 Andrey Semashev
  4. *
  5. * Distributed under the Boost Software License, Version 1.0.
  6. * See http://www.boost.org/LICENSE_1_0.txt
  7. */
  8. #ifndef BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_
  9. #define BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_
  10. #include <boost/winapi/basic_types.hpp>
  11. #ifdef BOOST_HAS_PRAGMA_ONCE
  12. #pragma once
  13. #endif
  14. #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
  15. #include <boost/winapi/detail/header.hpp>
  16. #if !defined( BOOST_USE_WINDOWS_H )
  17. extern "C" {
  18. BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  19. GetPriorityClass(boost::winapi::HANDLE_ hProcess);
  20. BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  21. SetPriorityClass(
  22. boost::winapi::HANDLE_ hProcess,
  23. boost::winapi::DWORD_ dwPriorityClass);
  24. } // extern "C"
  25. #endif //defined BOOST_WINDOWS_H
  26. namespace boost {
  27. namespace winapi {
  28. #if defined(BOOST_USE_WINDOWS_H)
  29. BOOST_CONSTEXPR_OR_CONST DWORD_ NORMAL_PRIORITY_CLASS_ = NORMAL_PRIORITY_CLASS;
  30. BOOST_CONSTEXPR_OR_CONST DWORD_ IDLE_PRIORITY_CLASS_ = IDLE_PRIORITY_CLASS;
  31. BOOST_CONSTEXPR_OR_CONST DWORD_ HIGH_PRIORITY_CLASS_ = HIGH_PRIORITY_CLASS;
  32. BOOST_CONSTEXPR_OR_CONST DWORD_ REALTIME_PRIORITY_CLASS_ = REALTIME_PRIORITY_CLASS;
  33. BOOST_CONSTEXPR_OR_CONST DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = BELOW_NORMAL_PRIORITY_CLASS;
  34. BOOST_CONSTEXPR_OR_CONST DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = ABOVE_NORMAL_PRIORITY_CLASS;
  35. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
  36. BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = PROCESS_MODE_BACKGROUND_BEGIN;
  37. BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_END_ = PROCESS_MODE_BACKGROUND_END;
  38. #endif
  39. #else // defined( BOOST_USE_WINDOWS_H )
  40. BOOST_CONSTEXPR_OR_CONST DWORD_ NORMAL_PRIORITY_CLASS_ = 0x20;
  41. BOOST_CONSTEXPR_OR_CONST DWORD_ IDLE_PRIORITY_CLASS_ = 0x40;
  42. BOOST_CONSTEXPR_OR_CONST DWORD_ HIGH_PRIORITY_CLASS_ = 0x80;
  43. BOOST_CONSTEXPR_OR_CONST DWORD_ REALTIME_PRIORITY_CLASS_ = 0x100;
  44. BOOST_CONSTEXPR_OR_CONST DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = 0x4000;
  45. BOOST_CONSTEXPR_OR_CONST DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = 0x8000;
  46. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
  47. BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = 0x100000;
  48. BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_END_ = 0x200000;
  49. #endif
  50. #endif // defined( BOOST_USE_WINDOWS_H )
  51. using ::GetPriorityClass;
  52. using ::SetPriorityClass;
  53. }
  54. }
  55. #include <boost/winapi/detail/footer.hpp>
  56. #endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
  57. #endif // BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_