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