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
8 #ifndef BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
9 #define BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
10
11 #include <boost/winapi/config.hpp>
12
13 #ifdef BOOST_HAS_PRAGMA_ONCE
14 #pragma once
15 #endif
16
17 // Windows CE does not define GetProcessTimes
18 #if !defined( UNDER_CE )
19
20 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
21
22 #include <boost/winapi/basic_types.hpp>
23 #include <boost/winapi/time.hpp>
24 #include <boost/winapi/detail/header.hpp>
25
26 #if !defined( BOOST_USE_WINDOWS_H )
27 extern "C" {
28 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
29 GetProcessTimes(
30 boost::winapi::HANDLE_ hProcess,
31 ::_FILETIME* lpCreationTime,
32 ::_FILETIME* lpExitTime,
33 ::_FILETIME* lpKernelTime,
34 ::_FILETIME* lpUserTime);
35 }
36 #endif
37
38 namespace boost {
39 namespace winapi {
40
GetProcessTimes(HANDLE_ hProcess,LPFILETIME_ lpCreationTime,LPFILETIME_ lpExitTime,LPFILETIME_ lpKernelTime,LPFILETIME_ lpUserTime)41 BOOST_FORCEINLINE BOOL_ GetProcessTimes(
42 HANDLE_ hProcess,
43 LPFILETIME_ lpCreationTime,
44 LPFILETIME_ lpExitTime,
45 LPFILETIME_ lpKernelTime,
46 LPFILETIME_ lpUserTime)
47 {
48 return ::GetProcessTimes(
49 hProcess,
50 reinterpret_cast< ::_FILETIME* >(lpCreationTime),
51 reinterpret_cast< ::_FILETIME* >(lpExitTime),
52 reinterpret_cast< ::_FILETIME* >(lpKernelTime),
53 reinterpret_cast< ::_FILETIME* >(lpUserTime));
54 }
55
56 }
57 }
58
59 #include <boost/winapi/detail/footer.hpp>
60
61 #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
62 #endif // !defined( UNDER_CE )
63 #endif // BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
64