]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // handles.hpp --------------------------------------------------------------// |
2 | ||
3 | // Copyright 2010 Vicente J. Botet Escriba | |
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 | ||
10 | #ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP | |
11 | #define BOOST_DETAIL_WINAPI_HANDLES_HPP | |
12 | ||
13 | #include <boost/detail/winapi/basic_types.hpp> | |
14 | ||
15 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
16 | #pragma once | |
17 | #endif | |
18 | ||
19 | #if !defined( BOOST_USE_WINDOWS_H ) | |
20 | extern "C" { | |
21 | BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI | |
22 | CloseHandle(boost::detail::winapi::HANDLE_ handle); | |
23 | ||
24 | BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI | |
25 | DuplicateHandle( | |
26 | boost::detail::winapi::HANDLE_ hSourceProcessHandle, | |
27 | boost::detail::winapi::HANDLE_ hSourceHandle, | |
28 | boost::detail::winapi::HANDLE_ hTargetProcessHandle, | |
29 | boost::detail::winapi::HANDLE_* lpTargetHandle, | |
30 | boost::detail::winapi::DWORD_ dwDesiredAccess, | |
31 | boost::detail::winapi::BOOL_ bInheritHandle, | |
32 | boost::detail::winapi::DWORD_ dwOptions); | |
33 | } | |
34 | ||
35 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 | |
36 | BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI | |
37 | CompareObjectHandles( | |
38 | boost::detail::winapi::HANDLE_ hFirstObjectHandle, | |
39 | boost::detail::winapi::HANDLE_ hSecondObjectHandle); | |
40 | #endif | |
41 | ||
42 | #endif | |
43 | ||
44 | namespace boost { | |
45 | namespace detail { | |
46 | namespace winapi { | |
47 | ||
48 | using ::CloseHandle; | |
49 | using ::DuplicateHandle; | |
50 | ||
51 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 | |
52 | using ::CompareObjectHandles; | |
53 | #endif | |
54 | ||
55 | #if defined( BOOST_USE_WINDOWS_H ) | |
56 | const DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE; | |
57 | const DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS; | |
58 | const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE; | |
59 | #else | |
60 | const DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1; | |
61 | const DWORD_ DUPLICATE_SAME_ACCESS_ = 2; | |
62 | const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1); | |
63 | #endif | |
64 | ||
65 | const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_; | |
66 | const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_; | |
67 | const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE_; | |
68 | ||
69 | } | |
70 | } | |
71 | } | |
72 | ||
73 | #endif // BOOST_DETAIL_WINAPI_HANDLES_HPP |