handle_info.hpp 1.4 KB

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