ReactOS  0.4.15-dev-1632-g4e289ce
wdftimer.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 
5 _WdfVersionBuild_
6 
7 Module Name:
8 
9  wdftimer.h
10 
11 Abstract:
12 
13  This is the C header for driver framework TIMER object
14 
15 Revision 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 //
56 typedef
57 _Function_class_(EVT_WDF_TIMER)
60 VOID
61 STDCALL
62 EVT_WDF_TIMER(
63  _In_
64  WDFTIMER Timer
65  );
66 
67 typedef 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 
77 typedef 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 
110 VOID
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 
125 VOID
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 //
144 typedef
147 WDFAPI
148 NTSTATUS
149 (STDCALL *PFN_WDFTIMERCREATE)(
150  _In_
152  _In_
154  _In_
156  _Out_
157  WDFTIMER* Timer
158  );
159 
163 NTSTATUS
164 WdfTimerCreate(
165  _In_
167  _In_
169  _Out_
170  WDFTIMER* Timer
171  )
172 {
174 }
175 
176 //
177 // WDF Function: WdfTimerStart
178 //
179 typedef
181 WDFAPI
182 BOOLEAN
183 (STDCALL *PFN_WDFTIMERSTART)(
184  _In_
186  _In_
187  WDFTIMER Timer,
188  _In_
190  );
191 
194 BOOLEAN
195 WdfTimerStart(
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 //
208 typedef
211 WDFAPI
212 BOOLEAN
213 (STDCALL *PFN_WDFTIMERSTOP)(
214  _In_
216  _In_
217  WDFTIMER Timer,
218  _In_
219  BOOLEAN Wait
220  );
221 
225 BOOLEAN
226 WdfTimerStop(
227  _In_
228  WDFTIMER Timer,
229  _In_
230  BOOLEAN Wait
231  )
232 {
233  return ((PFN_WDFTIMERSTOP) WdfFunctions[WdfTimerStopTableIndex])(WdfDriverGlobals, Timer, Wait);
234 }
235 
236 //
237 // WDF Function: WdfTimerGetParentObject
238 //
239 typedef
241 WDFAPI
242 WDFOBJECT
243 (STDCALL *PFN_WDFTIMERGETPARENTOBJECT)(
244  _In_
246  _In_
247  WDFTIMER Timer
248  );
249 
252 WDFOBJECT
253 WdfTimerGetParentObject(
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 
BOOLEAN AutomaticSerialization
Definition: wdftimer.h:90
DECLSPEC_ALIGN(8) BOOLEAN UseHighResolutionTimer
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define TRUE
Definition: types.h:120
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
LONG NTSTATUS
Definition: precomp.h:26
typedef _Function_class_(EVT_WDF_TIMER) _IRQL_requires_same_ _IRQL_requires_max_(DISPATCH_LEVEL) VOID STDCALL EVT_WDF_TIMER(_In_ WDFTIMER Timer)
DriverGlobals
EVT_WDF_TIMER * PFN_WDF_TIMER
Definition: wdftimer.h:67
#define WdfFunctions
Definition: wdf.h:66
long LONG
Definition: pedump.c:60
#define WDFAPI
Definition: wdftypes.h:53
FORCEINLINE VOID WDF_TIMER_CONFIG_INIT(_Out_ PWDF_TIMER_CONFIG Config, _In_ PFN_WDF_TIMER EvtTimerFunc)
Definition: wdftimer.h:111
_Must_inspect_result_ _In_ PWDF_TIMER_CONFIG Config
Definition: wdftimer.h:153
unsigned char BOOLEAN
#define _Out_
Definition: no_sal2.h:160
#define _IRQL_requires_same_
Definition: driverspecs.h:215
#define WDF_EXTERN_C_START
Definition: wdftimer.h:36
ULONG TolerableDelay
Definition: wdftimer.h:95
int64_t LONGLONG
Definition: typedefs.h:68
PWDF_DRIVER_GLOBALS WdfDriverGlobals
#define STDCALL
Definition: wdf.h:45
#define NTSTATUS
Definition: precomp.h:20
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define WDF_EXTERN_C_END
Definition: wdftimer.h:37
_Must_inspect_result_ _In_ PWDF_TIMER_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFTIMER * Timer
Definition: wdftimer.h:153
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define _In_
Definition: no_sal2.h:158
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 _In_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdftimer.h:153
#define FORCEINLINE
Definition: wdftypes.h:67
_In_ WDFTIMER _In_ LONGLONG DueTime
Definition: wdftimer.h:187
HANDLE WDFOBJECT
Definition: wdftypes.h:114
#define BOOLEAN
Definition: pedump.c:73
PFN_WDF_TIMER EvtTimerFunc
Definition: wdftimer.h:79
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_In_ WDFTIMER _In_ BOOLEAN Wait
Definition: wdftimer.h:217
_Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFTIMERCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
Definition: wdftimer.h:146
struct _WDF_TIMER_CONFIG WDF_TIMER_CONFIG
typedef _When_(Wait==__true, _IRQL_requires_max_(PASSIVE_LEVEL)) _When_(Wait
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes