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 
9 #ifndef BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_
10 #define BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_
11 
12 #include <boost/winapi/basic_types.hpp>
13 #include <boost/winapi/time.hpp>
14 
15 #ifdef BOOST_HAS_PRAGMA_ONCE
16 #pragma once
17 #endif
18 
19 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
20 
21 #if !defined( BOOST_USE_WINDOWS_H )
22 extern "C" {
23 BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
24 GetThreadTimes(
25     boost::winapi::HANDLE_ hThread,
26     ::_FILETIME* lpCreationTime,
27     ::_FILETIME* lpExitTime,
28     ::_FILETIME* lpKernelTime,
29     ::_FILETIME* lpUserTime);
30 }
31 #endif
32 
33 namespace boost {
34 namespace winapi {
35 
GetThreadTimes(HANDLE_ hThread,LPFILETIME_ lpCreationTime,LPFILETIME_ lpExitTime,LPFILETIME_ lpKernelTime,LPFILETIME_ lpUserTime)36 BOOST_FORCEINLINE BOOL_ GetThreadTimes(
37     HANDLE_ hThread,
38     LPFILETIME_ lpCreationTime,
39     LPFILETIME_ lpExitTime,
40     LPFILETIME_ lpKernelTime,
41     LPFILETIME_ lpUserTime)
42 {
43     return ::GetThreadTimes(
44         hThread,
45         reinterpret_cast< ::_FILETIME* >(lpCreationTime),
46         reinterpret_cast< ::_FILETIME* >(lpExitTime),
47         reinterpret_cast< ::_FILETIME* >(lpKernelTime),
48         reinterpret_cast< ::_FILETIME* >(lpUserTime));
49 }
50 
51 }
52 }
53 
54 #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
55 #endif // BOOST_WINAPI_GET_THREAD_TIMES_HPP_INCLUDED_
56