]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
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 | */ | |
7c673cae | 8 | |
b32b8144 FG |
9 | #ifndef BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_ |
10 | #define BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_ | |
7c673cae | 11 | |
b32b8144 | 12 | #include <boost/winapi/basic_types.hpp> |
7c673cae FG |
13 | |
14 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
15 | #pragma once | |
16 | #endif | |
17 | ||
b32b8144 | 18 | #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM |
7c673cae | 19 | |
20effc67 TL |
20 | #include <boost/winapi/detail/header.hpp> |
21 | ||
7c673cae FG |
22 | #if !defined( BOOST_USE_WINDOWS_H ) |
23 | extern "C" { | |
24 | ||
20effc67 | 25 | BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC |
b32b8144 | 26 | GetPriorityClass(boost::winapi::HANDLE_ hProcess); |
7c673cae | 27 | |
20effc67 | 28 | BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC |
7c673cae | 29 | SetPriorityClass( |
b32b8144 FG |
30 | boost::winapi::HANDLE_ hProcess, |
31 | boost::winapi::DWORD_ dwPriorityClass); | |
7c673cae FG |
32 | |
33 | } // extern "C" | |
34 | #endif //defined BOOST_WINDOWS_H | |
35 | ||
36 | namespace boost { | |
7c673cae FG |
37 | namespace winapi { |
38 | ||
39 | #if defined(BOOST_USE_WINDOWS_H) | |
40 | ||
92f5a8d4 TL |
41 | BOOST_CONSTEXPR_OR_CONST DWORD_ NORMAL_PRIORITY_CLASS_ = NORMAL_PRIORITY_CLASS; |
42 | BOOST_CONSTEXPR_OR_CONST DWORD_ IDLE_PRIORITY_CLASS_ = IDLE_PRIORITY_CLASS; | |
43 | BOOST_CONSTEXPR_OR_CONST DWORD_ HIGH_PRIORITY_CLASS_ = HIGH_PRIORITY_CLASS; | |
44 | BOOST_CONSTEXPR_OR_CONST DWORD_ REALTIME_PRIORITY_CLASS_ = REALTIME_PRIORITY_CLASS; | |
45 | BOOST_CONSTEXPR_OR_CONST DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = BELOW_NORMAL_PRIORITY_CLASS; | |
46 | BOOST_CONSTEXPR_OR_CONST DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = ABOVE_NORMAL_PRIORITY_CLASS; | |
7c673cae FG |
47 | |
48 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 | |
92f5a8d4 TL |
49 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = PROCESS_MODE_BACKGROUND_BEGIN; |
50 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_END_ = PROCESS_MODE_BACKGROUND_END; | |
7c673cae FG |
51 | #endif |
52 | ||
53 | #else // defined( BOOST_USE_WINDOWS_H ) | |
54 | ||
92f5a8d4 TL |
55 | BOOST_CONSTEXPR_OR_CONST DWORD_ NORMAL_PRIORITY_CLASS_ = 0x20; |
56 | BOOST_CONSTEXPR_OR_CONST DWORD_ IDLE_PRIORITY_CLASS_ = 0x40; | |
57 | BOOST_CONSTEXPR_OR_CONST DWORD_ HIGH_PRIORITY_CLASS_ = 0x80; | |
58 | BOOST_CONSTEXPR_OR_CONST DWORD_ REALTIME_PRIORITY_CLASS_ = 0x100; | |
59 | BOOST_CONSTEXPR_OR_CONST DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = 0x4000; | |
60 | BOOST_CONSTEXPR_OR_CONST DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = 0x8000; | |
7c673cae FG |
61 | |
62 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 | |
92f5a8d4 TL |
63 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = 0x100000; |
64 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_END_ = 0x200000; | |
7c673cae FG |
65 | #endif |
66 | ||
67 | #endif // defined( BOOST_USE_WINDOWS_H ) | |
68 | ||
69 | using ::GetPriorityClass; | |
70 | using ::SetPriorityClass; | |
71 | ||
7c673cae FG |
72 | } |
73 | } | |
74 | ||
20effc67 TL |
75 | #include <boost/winapi/detail/footer.hpp> |
76 | ||
b32b8144 | 77 | #endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM |
7c673cae | 78 | |
b32b8144 | 79 | #endif // BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_ |