get_process_times.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #if !defined( BOOST_USE_WINDOWS_H )
  19. extern "C" {
  20. BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  21. GetProcessTimes(
  22. boost::winapi::HANDLE_ hProcess,
  23. ::_FILETIME* lpCreationTime,
  24. ::_FILETIME* lpExitTime,
  25. ::_FILETIME* lpKernelTime,
  26. ::_FILETIME* lpUserTime);
  27. }
  28. #endif
  29. namespace boost {
  30. namespace winapi {
  31. BOOST_FORCEINLINE BOOL_ GetProcessTimes(
  32. HANDLE_ hProcess,
  33. LPFILETIME_ lpCreationTime,
  34. LPFILETIME_ lpExitTime,
  35. LPFILETIME_ lpKernelTime,
  36. LPFILETIME_ lpUserTime)
  37. {
  38. return ::GetProcessTimes(
  39. hProcess,
  40. reinterpret_cast< ::_FILETIME* >(lpCreationTime),
  41. reinterpret_cast< ::_FILETIME* >(lpExitTime),
  42. reinterpret_cast< ::_FILETIME* >(lpKernelTime),
  43. reinterpret_cast< ::_FILETIME* >(lpUserTime));
  44. }
  45. }
  46. }
  47. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  48. #endif // !defined( UNDER_CE )
  49. #endif // BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_