ReactOS  0.4.15-dev-3173-g40ee59d
wdfdpc.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  wdfdpc.h
10 
11 Abstract:
12 
13  This is the C header for driver frameworks DPC 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 _WDFDPC_H_
27 #define _WDFDPC_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 // This is the function that gets called back into the driver
51 // when the DPC fires.
52 //
53 typedef
54 _Function_class_(EVT_WDF_DPC)
57 VOID
58 STDCALL
59 EVT_WDF_DPC(
60  _In_
61  WDFDPC Dpc
62  );
63 
64 typedef EVT_WDF_DPC *PFN_WDF_DPC;
65 
66 typedef struct _WDF_DPC_CONFIG {
69 
70  //
71  // If this is TRUE, the DPC will automatically serialize
72  // with the event callback handlers of its Parent Object.
73  //
74  // Parent Object's callback constraints should be compatible
75  // with the DPC (DISPATCH_LEVEL), or the request will fail.
76  //
78 
80 
82 VOID
85  _In_ PFN_WDF_DPC EvtDpcFunc
86  )
87 {
89  Config->Size = sizeof(WDF_DPC_CONFIG);
90  Config->EvtDpcFunc = EvtDpcFunc;
91 
92  Config->AutomaticSerialization = TRUE;
93 }
94 
95 //
96 // WDF Function: WdfDpcCreate
97 //
98 typedef
101 WDFAPI
102 NTSTATUS
103 (STDCALL *PFN_WDFDPCCREATE)(
104  _In_
106  _In_
108  _In_
110  _Out_
111  WDFDPC* Dpc
112  );
113 
117 NTSTATUS
118 WdfDpcCreate(
119  _In_
121  _In_
123  _Out_
124  WDFDPC* Dpc
125  )
126 {
127  return ((PFN_WDFDPCCREATE) WdfFunctions[WdfDpcCreateTableIndex])(WdfDriverGlobals, Config, Attributes, Dpc);
128 }
129 
130 //
131 // WDF Function: WdfDpcEnqueue
132 //
133 typedef
135 WDFAPI
136 BOOLEAN
137 (STDCALL *PFN_WDFDPCENQUEUE)(
138  _In_
140  _In_
141  WDFDPC Dpc
142  );
143 
146 BOOLEAN
147 WdfDpcEnqueue(
148  _In_
149  WDFDPC Dpc
150  )
151 {
152  return ((PFN_WDFDPCENQUEUE) WdfFunctions[WdfDpcEnqueueTableIndex])(WdfDriverGlobals, Dpc);
153 }
154 
155 //
156 // WDF Function: WdfDpcCancel
157 //
158 typedef
161 WDFAPI
162 BOOLEAN
163 (STDCALL *PFN_WDFDPCCANCEL)(
164  _In_
166  _In_
167  WDFDPC Dpc,
168  _In_
169  BOOLEAN Wait
170  );
171 
175 BOOLEAN
176 WdfDpcCancel(
177  _In_
178  WDFDPC Dpc,
179  _In_
180  BOOLEAN Wait
181  )
182 {
183  return ((PFN_WDFDPCCANCEL) WdfFunctions[WdfDpcCancelTableIndex])(WdfDriverGlobals, Dpc, Wait);
184 }
185 
186 //
187 // WDF Function: WdfDpcGetParentObject
188 //
189 typedef
191 WDFAPI
192 WDFOBJECT
193 (STDCALL *PFN_WDFDPCGETPARENTOBJECT)(
194  _In_
196  _In_
197  WDFDPC Dpc
198  );
199 
202 WDFOBJECT
203 WdfDpcGetParentObject(
204  _In_
205  WDFDPC Dpc
206  )
207 {
208  return ((PFN_WDFDPCGETPARENTOBJECT) WdfFunctions[WdfDpcGetParentObjectTableIndex])(WdfDriverGlobals, Dpc);
209 }
210 
211 //
212 // WDF Function: WdfDpcWdmGetDpc
213 //
214 typedef
216 WDFAPI
217 PKDPC
218 (STDCALL *PFN_WDFDPCWDMGETDPC)(
219  _In_
221  _In_
222  WDFDPC Dpc
223  );
224 
227 PKDPC
228 WdfDpcWdmGetDpc(
229  _In_
230  WDFDPC Dpc
231  )
232 {
233  return ((PFN_WDFDPCWDMGETDPC) WdfFunctions[WdfDpcWdmGetDpcTableIndex])(WdfDriverGlobals, Dpc);
234 }
235 
236 
237 
238 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
239 
240 
242 
243 #endif // _WDFDPC_H_
244 
struct _WDF_DPC_CONFIG * PWDF_DPC_CONFIG
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:107
ULONG Size
Definition: wdfdpc.h:67
#define _Out_
Definition: ms_sal.h:345
#define TRUE
Definition: types.h:120
PFN_WDF_DPC EvtDpcFunc
Definition: wdfdpc.h:68
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
LONG NTSTATUS
Definition: precomp.h:26
FORCEINLINE VOID WDF_DPC_CONFIG_INIT(_Out_ PWDF_DPC_CONFIG Config, _In_ PFN_WDF_DPC EvtDpcFunc)
Definition: wdfdpc.h:83
DriverGlobals
struct _WDF_DPC_CONFIG WDF_DPC_CONFIG
#define WdfFunctions
Definition: wdf.h:66
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdfdpc.h:107
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG Config
Definition: wdfdpc.h:107
#define WDFAPI
Definition: wdftypes.h:53
_Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFDPCCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
Definition: wdfdpc.h:100
unsigned char BOOLEAN
#define _In_
Definition: ms_sal.h:308
#define _IRQL_requires_same_
Definition: driverspecs.h:232
#define _IRQL_requires_(irql)
Definition: driverspecs.h:229
PWDF_DRIVER_GLOBALS WdfDriverGlobals
#define WDF_EXTERN_C_END
Definition: wdfdpc.h:37
#define STDCALL
Definition: wdf.h:45
Definition: ketypes.h:687
#define NTSTATUS
Definition: precomp.h:20
WDF_EXTERN_C_START typedef _Function_class_(EVT_WDF_DPC) _IRQL_requires_same_ _IRQL_requires_(DISPATCH_LEVEL) VOID STDCALL EVT_WDF_DPC(_In_ WDFDPC Dpc)
EVT_WDF_DPC * PFN_WDF_DPC
Definition: wdfdpc.h:64
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
struct _KDPC * PKDPC
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
#define WDF_EXTERN_C_START
Definition: wdfdpc.h:36
#define FORCEINLINE
Definition: wdftypes.h:67
HANDLE WDFOBJECT
Definition: wdftypes.h:114
#define BOOLEAN
Definition: pedump.c:73
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
BOOLEAN AutomaticSerialization
Definition: wdfdpc.h:77
typedef _When_(Wait==__true, _IRQL_requires_max_(PASSIVE_LEVEL)) _When_(Wait
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes