handle_info.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // handle_info.hpp --------------------------------------------------------------//
  2. // Copyright 2016 Klemens D. Morgenstern
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. #ifndef BOOST_DETAIL_HANDLE_INFO_HPP_
  6. #define BOOST_DETAIL_HANDLE_INFO_HPP_
  7. #include <boost/detail/winapi/basic_types.hpp>
  8. #include <boost/predef/platform.h>
  9. #ifdef BOOST_HAS_PRAGMA_ONCE
  10. #pragma once
  11. #endif
  12. #if BOOST_PLAT_WINDOWS_DESKTOP
  13. #if !defined( BOOST_USE_WINDOWS_H )
  14. extern "C" {
  15. BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
  16. GetHandleInformation(
  17. boost::detail::winapi::HANDLE_ hObject,
  18. boost::detail::winapi::LPDWORD_ lpdwFlags);
  19. BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
  20. SetHandleInformation(
  21. boost::detail::winapi::HANDLE_ hObject,
  22. boost::detail::winapi::DWORD_ dwMask,
  23. boost::detail::winapi::DWORD_ dwFlags);
  24. } // extern "C"
  25. #endif
  26. namespace boost {
  27. namespace detail {
  28. namespace winapi {
  29. using ::GetHandleInformation;
  30. using ::SetHandleInformation;
  31. #if defined( BOOST_USE_WINDOWS_H )
  32. const DWORD_ HANDLE_FLAG_INHERIT_ = HANDLE_FLAG_INHERIT;
  33. const DWORD_ HANDLE_FLAG_PROTECT_FROM_CLOSE_ = HANDLE_FLAG_PROTECT_FROM_CLOSE;
  34. #else
  35. const DWORD_ HANDLE_FLAG_INHERIT_ = 0x1;
  36. const DWORD_ HANDLE_FLAG_PROTECT_FROM_CLOSE_ = 0x2;
  37. #endif
  38. }
  39. }
  40. }
  41. #endif // BOOST_PLAT_WINDOWS_DESKTOP
  42. #endif // BOOST_DETAIL_HANDLE_INFO_HPP_