ReactOS  0.4.15-dev-2355-gaf9df93
wdfworkitem.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  wdfworkitem.h
10 
11 Abstract:
12 
13  This is the Windows Driver Framework work item DDIs
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 _WDFWORKITEM_H_
27 #define _WDFWORKITEM_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 WorkItem fires.
52 //
53 typedef
54 _Function_class_(EVT_WDF_WORKITEM)
57 VOID
58 STDCALL
59 EVT_WDF_WORKITEM(
60  _In_
61  WDFWORKITEM WorkItem
62  );
63 
64 typedef EVT_WDF_WORKITEM *PFN_WDF_WORKITEM;
65 
66 typedef struct _WDF_WORKITEM_CONFIG {
67 
69 
71 
72  //
73  // If this is TRUE, the workitem will automatically serialize
74  // with the event callback handlers of its Parent Object.
75  //
76  // Parent Object's callback constraints should be compatible
77  // with the work item (PASSIVE_LEVEL), or the request will fail.
78  //
80 
82 
84 VOID
87  _In_ PFN_WDF_WORKITEM EvtWorkItemFunc
88  )
89 {
91  Config->Size = sizeof(WDF_WORKITEM_CONFIG);
92  Config->EvtWorkItemFunc = EvtWorkItemFunc;
93 
94  Config->AutomaticSerialization = TRUE;
95 }
96 
97 
98 //
99 // WDF Function: WdfWorkItemCreate
100 //
101 typedef
104 WDFAPI
105 NTSTATUS
106 (STDCALL *PFN_WDFWORKITEMCREATE)(
107  _In_
109  _In_
111  _In_
113  _Out_
114  WDFWORKITEM* WorkItem
115  );
116 
120 NTSTATUS
121 WdfWorkItemCreate(
122  _In_
124  _In_
126  _Out_
127  WDFWORKITEM* WorkItem
128  )
129 {
131 }
132 
133 //
134 // WDF Function: WdfWorkItemEnqueue
135 //
136 typedef
138 WDFAPI
139 VOID
140 (STDCALL *PFN_WDFWORKITEMENQUEUE)(
141  _In_
143  _In_
144  WDFWORKITEM WorkItem
145  );
146 
149 VOID
150 WdfWorkItemEnqueue(
151  _In_
152  WDFWORKITEM WorkItem
153  )
154 {
156 }
157 
158 //
159 // WDF Function: WdfWorkItemGetParentObject
160 //
161 typedef
163 WDFAPI
164 WDFOBJECT
165 (STDCALL *PFN_WDFWORKITEMGETPARENTOBJECT)(
166  _In_
168  _In_
169  WDFWORKITEM WorkItem
170  );
171 
174 WDFOBJECT
175 WdfWorkItemGetParentObject(
176  _In_
177  WDFWORKITEM WorkItem
178  )
179 {
180  return ((PFN_WDFWORKITEMGETPARENTOBJECT) WdfFunctions[WdfWorkItemGetParentObjectTableIndex])(WdfDriverGlobals, WorkItem);
181 }
182 
183 //
184 // WDF Function: WdfWorkItemFlush
185 //
186 typedef
188 WDFAPI
189 VOID
190 (STDCALL *PFN_WDFWORKITEMFLUSH)(
191  _In_
193  _In_
194  WDFWORKITEM WorkItem
195  );
196 
199 VOID
200 WdfWorkItemFlush(
201  _In_
202  WDFWORKITEM WorkItem
203  )
204 {
206 }
207 
208 
209 
210 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
211 
212 
214 
215 #endif // _WDFWORKITEM_H_
216 
#define _Must_inspect_result_
Definition: no_sal2.h:62
FORCEINLINE VOID WDF_WORKITEM_CONFIG_INIT(_Out_ PWDF_WORKITEM_CONFIG Config, _In_ PFN_WDF_WORKITEM EvtWorkItemFunc)
Definition: wdfworkitem.h:85
struct _WDF_WORKITEM_CONFIG WDF_WORKITEM_CONFIG
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
EVT_WDF_WORKITEM * PFN_WDF_WORKITEM
Definition: wdfworkitem.h:64
DriverGlobals
#define WDF_EXTERN_C_END
Definition: wdfworkitem.h:37
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdfworkitem.h:110
#define WdfFunctions
Definition: wdf.h:66
#define WDFAPI
Definition: wdftypes.h:53
unsigned char BOOLEAN
#define _Out_
Definition: no_sal2.h:160
#define _IRQL_requires_same_
Definition: driverspecs.h:215
BOOLEAN AutomaticSerialization
Definition: wdfworkitem.h:79
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG Config
Definition: wdfworkitem.h:110
#define STDCALL
Definition: wdf.h:45
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
WDF_EXTERN_C_START typedef _Function_class_(EVT_WDF_WORKITEM) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) VOID STDCALL EVT_WDF_WORKITEM(_In_ WDFWORKITEM WorkItem)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_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
#define WDF_EXTERN_C_START
Definition: wdfworkitem.h:36
_Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFWORKITEMCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
Definition: wdfworkitem.h:103
#define FORCEINLINE
Definition: wdftypes.h:67
HANDLE WDFOBJECT
Definition: wdftypes.h:114
struct _WDF_WORKITEM_CONFIG * PWDF_WORKITEM_CONFIG
PFN_WDF_WORKITEM EvtWorkItemFunc
Definition: wdfworkitem.h:70
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:110
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes