github.com/searKing/golang/go@v1.2.117/os/signal/cgo/include/boost/winapi/handles.hpp (about)

     1  /*
     2   * Copyright 2010 Vicente J. Botet Escriba
     3   * Copyright 2015 Andrey Semashev
     4   *
     5   * Distributed under the Boost Software License, Version 1.0.
     6   * See http://www.boost.org/LICENSE_1_0.txt
     7   */
     8  
     9  #ifndef BOOST_WINAPI_HANDLES_HPP_INCLUDED_
    10  #define BOOST_WINAPI_HANDLES_HPP_INCLUDED_
    11  
    12  #include <boost/winapi/basic_types.hpp>
    13  #include <boost/winapi/detail/header.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_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
    22  CloseHandle(boost::winapi::HANDLE_ handle);
    23  
    24  BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
    25  DuplicateHandle(
    26      boost::winapi::HANDLE_ hSourceProcessHandle,
    27      boost::winapi::HANDLE_ hSourceHandle,
    28      boost::winapi::HANDLE_ hTargetProcessHandle,
    29      boost::winapi::HANDLE_* lpTargetHandle,
    30      boost::winapi::DWORD_ dwDesiredAccess,
    31      boost::winapi::BOOL_ bInheritHandle,
    32      boost::winapi::DWORD_ dwOptions);
    33  
    34  #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
    35  BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
    36  CompareObjectHandles(
    37      boost::winapi::HANDLE_ hFirstObjectHandle,
    38      boost::winapi::HANDLE_ hSecondObjectHandle);
    39  #endif
    40  } // extern "C"
    41  #endif
    42  
    43  namespace boost {
    44  namespace winapi {
    45  
    46  using ::CloseHandle;
    47  using ::DuplicateHandle;
    48  
    49  #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
    50  using ::CompareObjectHandles;
    51  #endif
    52  
    53  // Note: MSVC-14.1 does not interpret INVALID_HANDLE_VALUE_ initializer as a constant expression
    54  #if defined( BOOST_USE_WINDOWS_H )
    55  BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = DUPLICATE_CLOSE_SOURCE;
    56  BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = DUPLICATE_SAME_ACCESS;
    57  const HANDLE_ INVALID_HANDLE_VALUE_ = INVALID_HANDLE_VALUE;
    58  #else
    59  BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1;
    60  BOOST_CONSTEXPR_OR_CONST DWORD_ DUPLICATE_SAME_ACCESS_ = 2;
    61  const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1);
    62  #endif
    63  
    64  BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_;
    65  BOOST_CONSTEXPR_OR_CONST DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_;
    66  // Note: The "unused" attribute here should not be necessary because the variable is a constant.
    67  //       However, MinGW gcc 5.3 spams warnings about this particular constant.
    68  const HANDLE_ invalid_handle_value BOOST_ATTRIBUTE_UNUSED = INVALID_HANDLE_VALUE_;
    69  
    70  }
    71  }
    72  
    73  #include <boost/winapi/detail/footer.hpp>
    74  
    75  #endif // BOOST_WINAPI_HANDLES_HPP_INCLUDED_