get_thread_times.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <boost/winapi/detail/header.hpp>
  17. #if !defined( BOOST_USE_WINDOWS_H )
  18. extern "C" {
  19. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  20. GetThreadTimes(
  21. boost::winapi::HANDLE_ hThread,
  22. ::_FILETIME* lpCreationTime,
  23. ::_FILETIME* lpExitTime,
  24. ::_FILETIME* lpKernelTime,
  25. ::_FILETIME* lpUserTime);
  26. }
  27. #endif
  28. namespace boost {
  29. namespace winapi {
  30. BOOST_FORCEINLINE BOOL_ GetThreadTimes(
  31. HANDLE_ hThread,
  32. LPFILETIME_ lpCreationTime,
  33. LPFILETIME_ lpExitTime,
  34. LPFILETIME_ lpKernelTime,
  35. LPFILETIME_ lpUserTime)
  36. {
  37. return ::GetThreadTimes(
  38. hThread,
  39. reinterpret_cast< ::_FILETIME* >(lpCreationTime),
  40. reinterpret_cast< ::_FILETIME* >(lpExitTime),
  41. reinterpret_cast< ::_FILETIME* >(lpKernelTime),
  42. reinterpret_cast< ::_FILETIME* >(lpUserTime));
  43. }
  44. }
  45. }
  46. #include <boost/winapi/detail/footer.hpp>
  47. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  48. #endif // BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_