ReactOS 0.4.15-dev-7924-g5949c20
wdftimer.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation. All rights reserved.
4
5_WdfVersionBuild_
6
7Module Name:
8
9 wdftimer.h
10
11Abstract:
12
13 This is the C header for driver framework TIMER object
14
15Revision History:
16
17
18--*/
19
20//
21// NOTE: This header is generated by stubwork. Please make any
22// modifications to the corresponding template files
23// (.x or .y) and use stubwork to regenerate the header
24//
25
26#ifndef _WDFTIMER_H_
27#define _WDFTIMER_H_
28
29#ifndef WDF_EXTERN_C
30 #ifdef __cplusplus
31 #define WDF_EXTERN_C extern "C"
32 #define WDF_EXTERN_C_START extern "C" {
33 #define WDF_EXTERN_C_END }
34 #else
35 #define WDF_EXTERN_C
36 #define WDF_EXTERN_C_START
37 #define WDF_EXTERN_C_END
38 #endif
39#endif
40
42
43
44
45#if (NTDDI_VERSION >= NTDDI_WIN2K)
46
47
48
49
50#define TolerableDelayUnlimited ((ULONG)-1)
51
52//
53// This is the function that gets called back into the driver
54// when the TIMER fires.
55//
56typedef
57_Function_class_(EVT_WDF_TIMER)
60VOID
62EVT_WDF_TIMER(
63 _In_
64 WDFTIMER Timer
65 );
66
67typedef EVT_WDF_TIMER *PFN_WDF_TIMER;
68
69//
70// Disable warning C4324: structure was padded due to DECLSPEC_ALIGN
71// This padding is intentional and necessary.
72#ifdef _MSC_VER
73#pragma warning(push)
74#pragma warning(disable: 4324)
75#endif
76
77typedef struct _WDF_TIMER_CONFIG {
80
82
83 //
84 // If this is TRUE, the Timer will automatically serialize
85 // with the event callback handlers of its Parent Object.
86 //
87 // Parent Object's callback constraints should be compatible
88 // with the Timer DPC (DISPATCH_LEVEL), or the request will fail.
89 //
91
92 //
93 // Optional tolerance for the timer in milliseconds.
94 //
96
97 //
98 // If this is TRUE, high resolution timers will be used. The default
99 // value is FALSE
100 //
101 DECLSPEC_ALIGN(8) BOOLEAN UseHighResolutionTimer;
102
104
105#ifdef _MSC_VER
106#pragma warning(pop)
107#endif
108
110VOID
114 )
115{
117 Config->Size = sizeof(WDF_TIMER_CONFIG);
118 Config->EvtTimerFunc = EvtTimerFunc;
119 Config->Period = 0;
120 Config->AutomaticSerialization = TRUE;
121 Config->TolerableDelay = 0;
122}
123
125VOID
130 )
131{
133 Config->Size = sizeof(WDF_TIMER_CONFIG);
134 Config->EvtTimerFunc = EvtTimerFunc;
135 Config->Period = Period;
136 Config->AutomaticSerialization = TRUE;
137 Config->TolerableDelay = 0;
138}
139
140
141//
142// WDF Function: WdfTimerCreate
143//
144typedef
147WDFAPI
149(STDCALL *PFN_WDFTIMERCREATE)(
150 _In_
152 _In_
154 _In_
156 _Out_
157 WDFTIMER* Timer
158 );
159
164WdfTimerCreate(
165 _In_
167 _In_
169 _Out_
170 WDFTIMER* Timer
171 )
172{
174}
175
176//
177// WDF Function: WdfTimerStart
178//
179typedef
181WDFAPI
183(STDCALL *PFN_WDFTIMERSTART)(
184 _In_
186 _In_
187 WDFTIMER Timer,
188 _In_
190 );
191
195WdfTimerStart(
196 _In_
197 WDFTIMER Timer,
198 _In_
200 )
201{
202 return ((PFN_WDFTIMERSTART) WdfFunctions[WdfTimerStartTableIndex])(WdfDriverGlobals, Timer, DueTime);
203}
204
205//
206// WDF Function: WdfTimerStop
207//
208typedef
211WDFAPI
213(STDCALL *PFN_WDFTIMERSTOP)(
214 _In_
216 _In_
217 WDFTIMER Timer,
218 _In_
220 );
221
226WdfTimerStop(
227 _In_
228 WDFTIMER Timer,
229 _In_
231 )
232{
233 return ((PFN_WDFTIMERSTOP) WdfFunctions[WdfTimerStopTableIndex])(WdfDriverGlobals, Timer, Wait);
234}
235
236//
237// WDF Function: WdfTimerGetParentObject
238//
239typedef
241WDFAPI
243(STDCALL *PFN_WDFTIMERGETPARENTOBJECT)(
244 _In_
246 _In_
247 WDFTIMER Timer
248 );
249
253WdfTimerGetParentObject(
254 _In_
255 WDFTIMER Timer
256 )
257{
258 return ((PFN_WDFTIMERGETPARENTOBJECT) WdfFunctions[WdfTimerGetParentObjectTableIndex])(WdfDriverGlobals, Timer);
259}
260
261
262
263#endif // (NTDDI_VERSION >= NTDDI_WIN2K)
264
265
267
268#endif // _WDFTIMER_H_
269
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define NTSTATUS
Definition: precomp.h:21
#define _IRQL_requires_same_
Definition: driverspecs.h:232
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
DriverGlobals
#define _Function_class_(x)
Definition: ms_sal.h:2946
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_
Definition: ms_sal.h:345
#define _When_(expr, annos)
Definition: ms_sal.h:254
#define _In_
Definition: ms_sal.h:308
#define BOOLEAN
Definition: pedump.c:73
long LONG
Definition: pedump.c:60
DECLSPEC_ALIGN(8) BOOLEAN UseHighResolutionTimer
ULONG TolerableDelay
Definition: wdftimer.h:95
PFN_WDF_TIMER EvtTimerFunc
Definition: wdftimer.h:79
BOOLEAN AutomaticSerialization
Definition: wdftimer.h:90
int64_t LONGLONG
Definition: typedefs.h:68
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define STDCALL
Definition: wdf.h:45
#define WdfFunctions
Definition: wdf.h:66
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
PWDF_DRIVER_GLOBALS WdfDriverGlobals
@ WdfTimerCreateTableIndex
Definition: wdffuncenum.h:343
@ WdfTimerStartTableIndex
Definition: wdffuncenum.h:344
@ WdfTimerStopTableIndex
Definition: wdffuncenum.h:345
@ WdfTimerGetParentObjectTableIndex
Definition: wdffuncenum.h:346
struct _WDF_TIMER_CONFIG WDF_TIMER_CONFIG
#define WDF_EXTERN_C_END
Definition: wdftimer.h:37
EVT_WDF_TIMER * PFN_WDF_TIMER
Definition: wdftimer.h:67
_Must_inspect_result_ _In_ PWDF_TIMER_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFTIMER * Timer
Definition: wdftimer.h:158
_Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFTIMERCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
Definition: wdftimer.h:146
#define WDF_EXTERN_C_START
Definition: wdftimer.h:36
_Must_inspect_result_ _In_ PWDF_TIMER_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdftimer.h:155
FORCEINLINE VOID WDF_TIMER_CONFIG_INIT_PERIODIC(_Out_ PWDF_TIMER_CONFIG Config, _In_ PFN_WDF_TIMER EvtTimerFunc, _In_ LONG Period)
Definition: wdftimer.h:126
_Must_inspect_result_ _In_ PWDF_TIMER_CONFIG Config
Definition: wdftimer.h:153
_In_ WDFTIMER _In_ LONGLONG DueTime
Definition: wdftimer.h:190
FORCEINLINE VOID WDF_TIMER_CONFIG_INIT(_Out_ PWDF_TIMER_CONFIG Config, _In_ PFN_WDF_TIMER EvtTimerFunc)
Definition: wdftimer.h:111
_In_ WDFTIMER _In_ BOOLEAN Wait
Definition: wdftimer.h:220
#define WDFAPI
Definition: wdftypes.h:53
#define FORCEINLINE
Definition: wdftypes.h:67
HANDLE WDFOBJECT
Definition: wdftypes.h:114