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