get_thread_times.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_
  9. #define BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_
  10. #include <boost/winapi/basic_types.hpp>
  11. #include <boost/winapi/time.hpp>
  12. #ifdef BOOST_HAS_PRAGMA_ONCE
  13. #pragma once
  14. #endif
  15. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  16. #if !defined( BOOST_USE_WINDOWS_H )
  17. extern "C" {
  18. BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  19. GetThreadTimes(
  20. boost::winapi::HANDLE_ hThread,
  21. ::_FILETIME* lpCreationTime,
  22. ::_FILETIME* lpExitTime,
  23. ::_FILETIME* lpKernelTime,
  24. ::_FILETIME* lpUserTime);
  25. }
  26. #endif
  27. namespace boost {
  28. namespace winapi {
  29. BOOST_FORCEINLINE BOOL_ GetThreadTimes(
  30. HANDLE_ hThread,
  31. LPFILETIME_ lpCreationTime,
  32. LPFILETIME_ lpExitTime,
  33. LPFILETIME_ lpKernelTime,
  34. LPFILETIME_ lpUserTime)
  35. {
  36. return ::GetThreadTimes(
  37. hThread,
  38. reinterpret_cast< ::_FILETIME* >(lpCreationTime),
  39. reinterpret_cast< ::_FILETIME* >(lpExitTime),
  40. reinterpret_cast< ::_FILETIME* >(lpKernelTime),
  41. reinterpret_cast< ::_FILETIME* >(lpUserTime));
  42. }
  43. }
  44. }
  45. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  46. #endif // BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_