Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Copyright 2015 Klemens Morgenstern
0003  * Copyright 2016 Jorge Lodos
0004  * Copyright 2016 Andrey Semashev
0005  *
0006  * Distributed under the Boost Software License, Version 1.0.
0007  * See http://www.boost.org/LICENSE_1_0.txt
0008  */
0009 
0010 #ifndef BOOST_WINAPI_DBGHELP_HPP_INCLUDED_
0011 #define BOOST_WINAPI_DBGHELP_HPP_INCLUDED_
0012 
0013 #include <boost/winapi/basic_types.hpp>
0014 
0015 #if defined( BOOST_USE_WINDOWS_H )
0016 #if !defined( BOOST_WINAPI_IS_MINGW )
0017 #include <dbghelp.h>
0018 #else
0019 // In MinGW there is no dbghelp.h but an older imagehlp.h header defines some of the symbols from it.
0020 // Note that the user has to link with libimagehlp.a instead of libdbghelp.a for it to work.
0021 #include <imagehlp.h>
0022 #endif
0023 #endif
0024 
0025 #ifdef BOOST_HAS_PRAGMA_ONCE
0026 #pragma once
0027 #endif
0028 
0029 #if BOOST_WINAPI_PARTITION_DESKTOP
0030 
0031 #include <boost/winapi/detail/header.hpp>
0032 
0033 // Some symbols declared below are not present in all versions of Windows SDK, MinGW and MinGW-w64.
0034 // dbghelp.h/imagehlp.h define the API_VERSION_NUMBER macro which we use to detect its version.
0035 // When the macro is not available we can only guess based on the compiler version or SDK type.
0036 #if defined(API_VERSION_NUMBER)
0037 #if API_VERSION_NUMBER >= 11
0038 // UnDecorateSymbolNameW available since Windows SDK 6.0A and MinGW-w64 (as of 2016-02-14)
0039 #define BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW
0040 #endif
0041 #elif defined(_MSC_VER) && _MSC_VER >= 1500
0042 // Until MSVC 9.0 Windows SDK was bundled in Visual Studio and didn't have UnDecorateSymbolNameW.
0043 // Supposedly, Windows SDK 6.0A was the first standalone one and it is used with MSVC 9.0.
0044 #define BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW
0045 #elif !defined(BOOST_WINAPI_IS_MINGW)
0046 // MinGW does not provide UnDecorateSymbolNameW (as of 2016-02-14)
0047 #define BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW
0048 #endif
0049 
0050 #if !defined( BOOST_USE_WINDOWS_H )
0051 extern "C" {
0052 
0053 struct API_VERSION;
0054 
0055 BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
0056 UnDecorateSymbolName(
0057     boost::winapi::LPCSTR_ DecoratedName,
0058     boost::winapi::LPSTR_ UnDecoratedName,
0059     boost::winapi::DWORD_ UndecoratedLength,
0060     boost::winapi::DWORD_ Flags);
0061 
0062 #if defined( BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW )
0063 BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
0064 UnDecorateSymbolNameW(
0065     boost::winapi::LPCWSTR_ DecoratedName,
0066     boost::winapi::LPWSTR_ UnDecoratedName,
0067     boost::winapi::DWORD_ UndecoratedLength,
0068     boost::winapi::DWORD_ Flags);
0069 #endif
0070 
0071 BOOST_WINAPI_IMPORT API_VERSION* BOOST_WINAPI_WINAPI_CC
0072 ImagehlpApiVersion(BOOST_WINAPI_DETAIL_VOID);
0073 
0074 } // extern "C"
0075 #endif
0076 
0077 namespace boost {
0078 namespace winapi {
0079 
0080 #if defined( BOOST_USE_WINDOWS_H )
0081 
0082 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_COMPLETE_ = UNDNAME_COMPLETE;
0083 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = UNDNAME_NO_LEADING_UNDERSCORES;
0084 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_MS_KEYWORDS_ = UNDNAME_NO_MS_KEYWORDS;
0085 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = UNDNAME_NO_FUNCTION_RETURNS;
0086 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = UNDNAME_NO_ALLOCATION_MODEL;
0087 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = UNDNAME_NO_ALLOCATION_LANGUAGE;
0088 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_MS_THISTYPE_ = UNDNAME_NO_MS_THISTYPE;
0089 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_CV_THISTYPE_ = UNDNAME_NO_CV_THISTYPE;
0090 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_THISTYPE_ = UNDNAME_NO_THISTYPE;
0091 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = UNDNAME_NO_ACCESS_SPECIFIERS;
0092 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = UNDNAME_NO_THROW_SIGNATURES;
0093 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_MEMBER_TYPE_ = UNDNAME_NO_MEMBER_TYPE;
0094 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = UNDNAME_NO_RETURN_UDT_MODEL;
0095 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_32_BIT_DECODE_ = UNDNAME_32_BIT_DECODE;
0096 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NAME_ONLY_ = UNDNAME_NAME_ONLY;
0097 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ARGUMENTS_ = UNDNAME_NO_ARGUMENTS;
0098 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = UNDNAME_NO_SPECIAL_SYMS;
0099 
0100 #else // defined( BOOST_USE_WINDOWS_H )
0101 
0102 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_COMPLETE_ = 0x00000000;
0103 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = 0x00000001;
0104 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_MS_KEYWORDS_ = 0x00000002;
0105 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = 0x00000004;
0106 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = 0x00000008;
0107 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = 0x00000010;
0108 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_MS_THISTYPE_ = 0x00000020;
0109 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_CV_THISTYPE_ = 0x00000040;
0110 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_THISTYPE_ = 0x00000060;
0111 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = 0x00000080;
0112 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = 0x00000100;
0113 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_MEMBER_TYPE_ = 0x00000200;
0114 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = 0x00000400;
0115 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_32_BIT_DECODE_ = 0x00000800;
0116 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NAME_ONLY_ = 0x00001000;
0117 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_ARGUMENTS_ = 0x00002000;
0118 BOOST_CONSTEXPR_OR_CONST DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = 0x00004000;
0119 
0120 #endif // defined( BOOST_USE_WINDOWS_H )
0121 
0122 using ::UnDecorateSymbolName;
0123 #if defined( BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW )
0124 using ::UnDecorateSymbolNameW;
0125 #endif
0126 
0127 typedef struct BOOST_MAY_ALIAS API_VERSION {
0128     USHORT_  MajorVersion;
0129     USHORT_  MinorVersion;
0130     USHORT_  Revision;
0131     USHORT_  Reserved;
0132 } API_VERSION_, *LPAPI_VERSION_;
0133 
0134 BOOST_FORCEINLINE LPAPI_VERSION_ ImagehlpApiVersion()
0135 {
0136     return reinterpret_cast<LPAPI_VERSION_>(::ImagehlpApiVersion());
0137 }
0138 
0139 BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
0140     LPCSTR_ DecoratedName,
0141     LPSTR_ UnDecoratedName,
0142     DWORD_ UndecoratedLength,
0143     DWORD_ Flags)
0144 {
0145     return ::UnDecorateSymbolName(
0146         DecoratedName,
0147         UnDecoratedName,
0148         UndecoratedLength,
0149         Flags);
0150 }
0151 
0152 #if defined( BOOST_WINAPI_DETAIL_HAS_UNDECORATESYMBOLNAMEW )
0153 
0154 BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
0155     LPCWSTR_ DecoratedName,
0156     LPWSTR_ UnDecoratedName,
0157     DWORD_ UndecoratedLength,
0158     DWORD_ Flags)
0159 {
0160     return ::UnDecorateSymbolNameW(
0161         DecoratedName,
0162         UnDecoratedName,
0163         UndecoratedLength,
0164         Flags);
0165 }
0166 
0167 #endif
0168 
0169 }
0170 }
0171 
0172 #include <boost/winapi/detail/footer.hpp>
0173 
0174 #endif // BOOST_WINAPI_PARTITION_DESKTOP
0175 #endif // BOOST_WINAPI_DBGHELP_HPP_INCLUDED_