get_process_times.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2010 Vicente J. Botet Escriba
  3. *
  4. * Distributed under the Boost Software License, Version 1.0.
  5. * See http://www.boost.org/LICENSE_1_0.txt
  6. */
  7. #ifndef BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
  8. #define BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
  9. #include <boost/winapi/config.hpp>
  10. #ifdef BOOST_HAS_PRAGMA_ONCE
  11. #pragma once
  12. #endif
  13. // Windows CE does not define GetProcessTimes
  14. #if !defined( UNDER_CE )
  15. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  16. #include <boost/winapi/basic_types.hpp>
  17. #include <boost/winapi/time.hpp>
  18. #include <boost/winapi/detail/header.hpp>
  19. #if !defined( BOOST_USE_WINDOWS_H )
  20. extern "C" {
  21. BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  22. GetProcessTimes(
  23. boost::winapi::HANDLE_ hProcess,
  24. ::_FILETIME* lpCreationTime,
  25. ::_FILETIME* lpExitTime,
  26. ::_FILETIME* lpKernelTime,
  27. ::_FILETIME* lpUserTime);
  28. }
  29. #endif
  30. namespace boost {
  31. namespace winapi {
  32. BOOST_FORCEINLINE BOOL_ GetProcessTimes(
  33. HANDLE_ hProcess,
  34. LPFILETIME_ lpCreationTime,
  35. LPFILETIME_ lpExitTime,
  36. LPFILETIME_ lpKernelTime,
  37. LPFILETIME_ lpUserTime)
  38. {
  39. return ::GetProcessTimes(
  40. hProcess,
  41. reinterpret_cast< ::_FILETIME* >(lpCreationTime),
  42. reinterpret_cast< ::_FILETIME* >(lpExitTime),
  43. reinterpret_cast< ::_FILETIME* >(lpKernelTime),
  44. reinterpret_cast< ::_FILETIME* >(lpUserTime));
  45. }
  46. }
  47. }
  48. #include <boost/winapi/detail/footer.hpp>
  49. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  50. #endif // !defined( UNDER_CE )
  51. #endif // BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_