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 
25 #if !defined( BOOST_USE_WINDOWS_H )
26 extern "C" {
27 BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
28 GetProcessTimes(
29     boost::winapi::HANDLE_ hProcess,
30     ::_FILETIME* lpCreationTime,
31     ::_FILETIME* lpExitTime,
32     ::_FILETIME* lpKernelTime,
33     ::_FILETIME* lpUserTime);
34 }
35 #endif
36 
37 namespace boost {
38 namespace winapi {
39 
GetProcessTimes(HANDLE_ hProcess,LPFILETIME_ lpCreationTime,LPFILETIME_ lpExitTime,LPFILETIME_ lpKernelTime,LPFILETIME_ lpUserTime)40 BOOST_FORCEINLINE BOOL_ GetProcessTimes(
41     HANDLE_ hProcess,
42     LPFILETIME_ lpCreationTime,
43     LPFILETIME_ lpExitTime,
44     LPFILETIME_ lpKernelTime,
45     LPFILETIME_ lpUserTime)
46 {
47     return ::GetProcessTimes(
48         hProcess,
49         reinterpret_cast< ::_FILETIME* >(lpCreationTime),
50         reinterpret_cast< ::_FILETIME* >(lpExitTime),
51         reinterpret_cast< ::_FILETIME* >(lpKernelTime),
52         reinterpret_cast< ::_FILETIME* >(lpUserTime));
53 }
54 
55 }
56 }
57 
58 #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
59 #endif // !defined( UNDER_CE )
60 #endif // BOOST_WINAPI_GET_PROCESS_TIMES_HPP_INCLUDED_
61