collect_msvc.ipp 998 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright Antony Polukhin, 2016-2019.
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_STACKTRACE_DETAIL_COLLECT_MSVC_IPP
  7. #define BOOST_STACKTRACE_DETAIL_COLLECT_MSVC_IPP
  8. #include <boost/config.hpp>
  9. #ifdef BOOST_HAS_PRAGMA_ONCE
  10. # pragma once
  11. #endif
  12. #include <boost/stacktrace/safe_dump_to.hpp>
  13. #include <boost/winapi/stack_backtrace.hpp>
  14. namespace boost { namespace stacktrace { namespace detail {
  15. std::size_t this_thread_frames::collect(native_frame_ptr_t* out_frames, std::size_t max_frames_count, std::size_t skip) BOOST_NOEXCEPT {
  16. return boost::winapi::RtlCaptureStackBackTrace(
  17. static_cast<boost::winapi::ULONG_>(skip),
  18. static_cast<boost::winapi::ULONG_>(max_frames_count),
  19. const_cast<boost::winapi::PVOID_*>(out_frames),
  20. 0
  21. );
  22. }
  23. }}} // namespace boost::stacktrace
  24. #endif // BOOST_STACKTRACE_DETAIL_COLLECT_MSVC_IPP