comparison DEPENDENCIES/generic/include/boost/detail/winapi/waitable_timer.hpp @ 102:f46d142149f5

Whoops, finish that update
author Chris Cannam
date Mon, 07 Sep 2015 11:13:41 +0100
parents
children
comparison
equal deleted inserted replaced
101:c530137014c0 102:f46d142149f5
1 // waitable_timer.hpp --------------------------------------------------------------//
2
3 // Copyright 2013 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_DETAIL_WINAPI_WAITABLE_TIMER_HPP
10 #define BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
11
12 #include <boost/detail/winapi/basic_types.hpp>
13
14 #ifdef BOOST_HAS_PRAGMA_ONCE
15 #pragma once
16 #endif
17
18 namespace boost
19 {
20 namespace detail
21 {
22 namespace winapi
23 {
24 #if defined( BOOST_USE_WINDOWS_H )
25
26 typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_;
27
28 # ifdef BOOST_NO_ANSI_APIS
29 using ::CreateWaitableTimerW;
30 using ::OpenWaitableTimerW;
31 # else
32 using ::CreateWaitableTimerA;
33 using ::OpenWaitableTimerA;
34 # endif
35 using ::SetWaitableTimer;
36 using ::CancelWaitableTimer;
37
38 #else
39
40 extern "C" {
41
42 struct _SECURITY_ATTRIBUTES;
43
44 typedef void (WINAPI* PTIMERAPCROUTINE_)
45 (
46 LPVOID_ lpArgToCompletionRoutine,
47 DWORD_ dwTimerLowValue,
48 DWORD_ dwTimerHighValue
49 );
50
51 # ifdef BOOST_NO_ANSI_APIS
52 __declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerW
53 (
54 _SECURITY_ATTRIBUTES* lpTimerAttributes,
55 BOOL_ bManualReset,
56 LPCWSTR_ lpTimerName
57 );
58
59 __declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerW
60 (
61 DWORD_ dwDesiredAccess,
62 BOOL_ bInheritHandle,
63 LPCWSTR_ lpTimerName
64 );
65 # else
66 __declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerA
67 (
68 _SECURITY_ATTRIBUTES* lpTimerAttributes,
69 BOOL_ bManualReset,
70 LPCSTR_ lpTimerName
71 );
72
73 __declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerA
74 (
75 DWORD_ dwDesiredAccess,
76 BOOL_ bInheritHandle,
77 LPCSTR_ lpTimerName
78 );
79 # endif
80
81 __declspec(dllimport) BOOL_ WINAPI SetWaitableTimer
82 (
83 HANDLE_ hTimer,
84 const LARGE_INTEGER_ *lpDueTime,
85 LONG_ lPeriod,
86 PTIMERAPCROUTINE_ pfnCompletionRoutine,
87 LPVOID_ lpArgToCompletionRoutine,
88 BOOL_ fResume
89 );
90
91 __declspec(dllimport) BOOL_ WINAPI CancelWaitableTimer(HANDLE_ hTimer);
92
93 }
94
95 #endif
96
97 BOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(_SECURITY_ATTRIBUTES* lpTimerAttributes, BOOL_ bManualReset)
98 {
99 #ifdef BOOST_NO_ANSI_APIS
100 return CreateWaitableTimerW(lpTimerAttributes, bManualReset, 0);
101 #else
102 return CreateWaitableTimerA(lpTimerAttributes, bManualReset, 0);
103 #endif
104 }
105
106 }
107 }
108 }
109
110 #endif // BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP