Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:47

0001 /*
0002  * Copyright 2010 Vicente J. Botet Escriba
0003  * Copyright 2015 Andrey Semashev
0004  *
0005  * Distributed under the Boost Software License, Version 1.0.
0006  * See http://www.boost.org/LICENSE_1_0.txt
0007  */
0008 
0009 #ifndef BOOST_WINAPI_HANDLES_HPP_INCLUDED_
0010 #define BOOST_WINAPI_HANDLES_HPP_INCLUDED_
0011 
0012 #include <boost/winapi/basic_types.hpp>
0013 #include <boost/winapi/detail/header.hpp>
0014 
0015 #ifdef BOOST_HAS_PRAGMA_ONCE
0016 #pragma once
0017 #endif
0018 
0019 #if !defined( BOOST_USE_WINDOWS_H )
0020 extern "C" {
0021 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0022 CloseHandle(boost::winapi::HANDLE_ handle);
0023 
0024 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0025 DuplicateHandle(
0026     boost::winapi::HANDLE_ hSourceProcessHandle,
0027     boost::winapi::HANDLE_ hSourceHandle,
0028     boost::winapi::HANDLE_ hTargetProcessHandle,
0029     boost::winapi::HANDLE_* lpTargetHandle,
0030     boost::winapi::DWORD_ dwDesiredAccess,
0031     boost::winapi::BOOL_ bInheritHandle,
0032     boost::winapi::DWORD_ dwOptions);
0033 
0034 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
0035 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0036 CompareObjectHandles(
0037     boost::winapi::HANDLE_ hFirstObjectHandle,
0038     boost::winapi::HANDLE_ hSecondObjectHandle);
0039 #endif
0040 } // extern "C"
0041 #endif
0042 
0043 namespace boost {
0044 namespace winapi {
0045 
0046 using ::CloseHandle;
0047 using ::DuplicateHandle;
0048 
0049 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
0050 using ::CompareObjectHandles;
0051 #endif
0052 
0053 // Note: MSVC-14.1 does not interpret INVALID_HANDLE_VALUE_ initializer as a constant expression
0054 #if defined( BOOST_USE_WINDOWS_H )
0055 BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE;
0056 BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS;
0057 const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE;
0058 #else
0059 BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1;
0060 BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = 2;
0061 const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1);
0062 #endif
0063 
0064 BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_;
0065 BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_;
0066 // Note: The "unused" attribute here should not be necessary because the variable is a constant.
0067 //       However, MinGW gcc 5.3 spams warnings about this particular constant.
0068 const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_;
0069 
0070 }
0071 }
0072 
0073 #include <boost/winapi/detail/footer.hpp>
0074 
0075 #endif // BOOST_WINAPI_HANDLES_HPP_INCLUDED_