]>
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 FG |
19 | |
20 | #if !defined( BOOST_USE_WINDOWS_H ) | |
21 | extern "C" { | |
22 | ||
92f5a8d4 | 23 | BOOST_SYMBOL_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC |
b32b8144 | 24 | GetPriorityClass(boost::winapi::HANDLE_ hProcess); |
7c673cae | 25 | |
92f5a8d4 | 26 | BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC |
7c673cae | 27 | SetPriorityClass( |
b32b8144 FG |
28 | boost::winapi::HANDLE_ hProcess, |
29 | boost::winapi::DWORD_ dwPriorityClass); | |
7c673cae FG |
30 | |
31 | } // extern "C" | |
32 | #endif //defined BOOST_WINDOWS_H | |
33 | ||
34 | namespace boost { | |
7c673cae FG |
35 | namespace winapi { |
36 | ||
37 | #if defined(BOOST_USE_WINDOWS_H) | |
38 | ||
92f5a8d4 TL |
39 | BOOST_CONSTEXPR_OR_CONST DWORD_ NORMAL_PRIORITY_CLASS_ = NORMAL_PRIORITY_CLASS; |
40 | BOOST_CONSTEXPR_OR_CONST DWORD_ IDLE_PRIORITY_CLASS_ = IDLE_PRIORITY_CLASS; | |
41 | BOOST_CONSTEXPR_OR_CONST DWORD_ HIGH_PRIORITY_CLASS_ = HIGH_PRIORITY_CLASS; | |
42 | BOOST_CONSTEXPR_OR_CONST DWORD_ REALTIME_PRIORITY_CLASS_ = REALTIME_PRIORITY_CLASS; | |
43 | BOOST_CONSTEXPR_OR_CONST DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = BELOW_NORMAL_PRIORITY_CLASS; | |
44 | BOOST_CONSTEXPR_OR_CONST DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = ABOVE_NORMAL_PRIORITY_CLASS; | |
7c673cae FG |
45 | |
46 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 | |
92f5a8d4 TL |
47 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = PROCESS_MODE_BACKGROUND_BEGIN; |
48 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_END_ = PROCESS_MODE_BACKGROUND_END; | |
7c673cae FG |
49 | #endif |
50 | ||
51 | #else // defined( BOOST_USE_WINDOWS_H ) | |
52 | ||
92f5a8d4 TL |
53 | BOOST_CONSTEXPR_OR_CONST DWORD_ NORMAL_PRIORITY_CLASS_ = 0x20; |
54 | BOOST_CONSTEXPR_OR_CONST DWORD_ IDLE_PRIORITY_CLASS_ = 0x40; | |
55 | BOOST_CONSTEXPR_OR_CONST DWORD_ HIGH_PRIORITY_CLASS_ = 0x80; | |
56 | BOOST_CONSTEXPR_OR_CONST DWORD_ REALTIME_PRIORITY_CLASS_ = 0x100; | |
57 | BOOST_CONSTEXPR_OR_CONST DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = 0x4000; | |
58 | BOOST_CONSTEXPR_OR_CONST DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = 0x8000; | |
7c673cae FG |
59 | |
60 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 | |
92f5a8d4 TL |
61 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = 0x100000; |
62 | BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_MODE_BACKGROUND_END_ = 0x200000; | |
7c673cae FG |
63 | #endif |
64 | ||
65 | #endif // defined( BOOST_USE_WINDOWS_H ) | |
66 | ||
67 | using ::GetPriorityClass; | |
68 | using ::SetPriorityClass; | |
69 | ||
7c673cae FG |
70 | } |
71 | } | |
72 | ||
b32b8144 | 73 | #endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM |
7c673cae | 74 | |
b32b8144 | 75 | #endif // BOOST_WINAPI_PRIORITY_CLASS_HPP_INCLUDED_ |