ReactOS  0.4.15-dev-1647-g91fceab
wdfdriver.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  wdfdriver.h
10 
11 Abstract:
12 
13  This is the interfaces for the Windows Driver Framework Driver object
14 
15 Environment:
16 
17  kernel mode only
18 
19 Revision History:
20 
21 --*/
22 
23 //
24 // NOTE: This header is generated by stubwork. Please make any
25 // modifications to the corresponding template files
26 // (.x or .y) and use stubwork to regenerate the header
27 //
28 
29 #ifndef _WDFDRIVER_H_
30 #define _WDFDRIVER_H_
31 
32 #ifndef WDF_EXTERN_C
33  #ifdef __cplusplus
34  #define WDF_EXTERN_C extern "C"
35  #define WDF_EXTERN_C_START extern "C" {
36  #define WDF_EXTERN_C_END }
37  #else
38  #define WDF_EXTERN_C
39  #define WDF_EXTERN_C_START
40  #define WDF_EXTERN_C_END
41  #endif
42 #endif
43 
45 
46 
47 
48 #if (NTDDI_VERSION >= NTDDI_WIN2K)
49 
50 typedef enum _WDF_DRIVER_INIT_FLAGS {
51  WdfDriverInitNonPnpDriver = 0x00000001, // If set, no Add Device routine is assigned.
52  WdfDriverInitNoDispatchOverride = 0x00000002, // Useful for miniports.
53  WdfVerifyOn = 0x00000004, // Controls whether WDFVERIFY macros are live.
54  WdfVerifierOn = 0x00000008, // Top level verififer flag.
56 
57 
58 
59 #define WDF_TRACE_ID ('TRAC')
60 
61 //
62 // Callbacks for FxDriver
63 //
64 
65 typedef
66 _Function_class_(EVT_WDF_DRIVER_DEVICE_ADD)
70 STDCALL
71 EVT_WDF_DRIVER_DEVICE_ADD(
72  _In_
73  WDFDRIVER Driver,
74  _Inout_
76  );
77 
78 typedef EVT_WDF_DRIVER_DEVICE_ADD *PFN_WDF_DRIVER_DEVICE_ADD;
79 
80 typedef
81 _Function_class_(EVT_WDF_DRIVER_UNLOAD)
84 VOID
85 STDCALL
86 EVT_WDF_DRIVER_UNLOAD(
87  _In_
88  WDFDRIVER Driver
89  );
90 
91 typedef EVT_WDF_DRIVER_UNLOAD *PFN_WDF_DRIVER_UNLOAD;
92 
93 
94 //
95 // Used by WPP Tracing (modeled after WPP's WppTraceCallback (in km-init.tpl))
96 //
97 typedef
98 _Function_class_(EVT_WDF_TRACE_CALLBACK)
101 NTSTATUS
102 STDCALL
103 EVT_WDF_TRACE_CALLBACK(
104  _In_
105  UCHAR minorFunction,
106  _In_opt_
108  _In_
111  PVOID buffer,
112  _In_
114  _Out_
115  PULONG size
116  );
117 
118 typedef EVT_WDF_TRACE_CALLBACK *PFN_WDF_TRACE_CALLBACK;
119 
120 typedef struct _WDF_DRIVER_CONFIG {
121  //
122  // Size of this structure in bytes
123  //
125 
126  //
127  // Event callbacks
128  //
130 
132 
133  //
134  // Combination of WDF_DRIVER_INIT_FLAGS values
135  //
137 
138  //
139  // Pool tag to use for all allocations made by the framework on behalf of
140  // the client driver.
141  //
143 
145 
147 VOID
150  _In_opt_ PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd
151  )
152 {
154 
155  Config->Size = sizeof(WDF_DRIVER_CONFIG);
156  Config->EvtDriverDeviceAdd = EvtDriverDeviceAdd;
157 }
158 
160  //
161  // Size of the structure in bytes
162  //
164 
165  //
166  // Major Version requested
167  //
169 
170  //
171  // Minor Version requested
172  //
174 
176 
178 VOID
183  )
184 {
186 
188  Params->MajorVersion = MajorVersion;
189  Params->MinorVersion = MinorVersion;
190 }
191 
193 WDFDRIVER
195  VOID
196  )
197 {
198  return WdfDriverGlobals->Driver;
199 }
200 
201 //
202 // WDF Function: WdfDriverCreate
203 //
204 typedef
207 WDFAPI
208 NTSTATUS
209 (STDCALL *PFN_WDFDRIVERCREATE)(
210  _In_
212  _In_
214  _In_
216  _In_opt_
218  _In_
220  _Out_opt_
221  WDFDRIVER* Driver
222  );
223 
227 NTSTATUS
228 WdfDriverCreate(
229  _In_
231  _In_
233  _In_opt_
235  _In_
237  _Out_opt_
238  WDFDRIVER* Driver
239  )
240 {
242 }
243 
244 //
245 // WDF Function: WdfDriverGetRegistryPath
246 //
247 typedef
249 WDFAPI
250 PWSTR
251 (STDCALL *PFN_WDFDRIVERGETREGISTRYPATH)(
252  _In_
254  _In_
255  WDFDRIVER Driver
256  );
257 
260 PWSTR
261 WdfDriverGetRegistryPath(
262  _In_
263  WDFDRIVER Driver
264  )
265 {
266  return ((PFN_WDFDRIVERGETREGISTRYPATH) WdfFunctions[WdfDriverGetRegistryPathTableIndex])(WdfDriverGlobals, Driver);
267 }
268 
269 //
270 // WDF Function: WdfDriverWdmGetDriverObject
271 //
272 typedef
274 WDFAPI
276 (STDCALL *PFN_WDFDRIVERWDMGETDRIVEROBJECT)(
277  _In_
279  _In_
280  WDFDRIVER Driver
281  );
282 
286 WdfDriverWdmGetDriverObject(
287  _In_
288  WDFDRIVER Driver
289  )
290 {
291  return ((PFN_WDFDRIVERWDMGETDRIVEROBJECT) WdfFunctions[WdfDriverWdmGetDriverObjectTableIndex])(WdfDriverGlobals, Driver);
292 }
293 
294 //
295 // WDF Function: WdfDriverOpenParametersRegistryKey
296 //
297 typedef
300 WDFAPI
301 NTSTATUS
302 (STDCALL *PFN_WDFDRIVEROPENPARAMETERSREGISTRYKEY)(
303  _In_
305  _In_
306  WDFDRIVER Driver,
307  _In_
309  _In_opt_
311  _Out_
312  WDFKEY* Key
313  );
314 
318 NTSTATUS
319 WdfDriverOpenParametersRegistryKey(
320  _In_
321  WDFDRIVER Driver,
322  _In_
324  _In_opt_
326  _Out_
327  WDFKEY* Key
328  )
329 {
331 }
332 
333 //
334 // WDF Function: WdfWdmDriverGetWdfDriverHandle
335 //
336 typedef
338 WDFAPI
339 WDFDRIVER
340 (STDCALL *PFN_WDFWDMDRIVERGETWDFDRIVERHANDLE)(
341  _In_
343  _In_
345  );
346 
349 WDFDRIVER
350 WdfWdmDriverGetWdfDriverHandle(
351  _In_
353  )
354 {
355  return ((PFN_WDFWDMDRIVERGETWDFDRIVERHANDLE) WdfFunctions[WdfWdmDriverGetWdfDriverHandleTableIndex])(WdfDriverGlobals, DriverObject);
356 }
357 
358 //
359 // WDF Function: WdfDriverRegisterTraceInfo
360 //
361 typedef
364 WDFAPI
365 NTSTATUS
366 (STDCALL *PFN_WDFDRIVERREGISTERTRACEINFO)(
367  _In_
369  _In_
371  _In_
373  _In_
375  );
376 
380 NTSTATUS
381 WdfDriverRegisterTraceInfo(
382  _In_
384  _In_
386  _In_
388  )
389 {
391 }
392 
393 //
394 // WDF Function: WdfDriverRetrieveVersionString
395 //
396 typedef
399 WDFAPI
400 NTSTATUS
401 (STDCALL *PFN_WDFDRIVERRETRIEVEVERSIONSTRING)(
402  _In_
404  _In_
405  WDFDRIVER Driver,
406  _In_
407  WDFSTRING String
408  );
409 
413 NTSTATUS
414 WdfDriverRetrieveVersionString(
415  _In_
416  WDFDRIVER Driver,
417  _In_
418  WDFSTRING String
419  )
420 {
421  return ((PFN_WDFDRIVERRETRIEVEVERSIONSTRING) WdfFunctions[WdfDriverRetrieveVersionStringTableIndex])(WdfDriverGlobals, Driver, String);
422 }
423 
424 //
425 // WDF Function: WdfDriverIsVersionAvailable
426 //
427 typedef
430 WDFAPI
431 BOOLEAN
432 (STDCALL *PFN_WDFDRIVERISVERSIONAVAILABLE)(
433  _In_
435  _In_
436  WDFDRIVER Driver,
437  _In_
439  );
440 
444 BOOLEAN
445 WdfDriverIsVersionAvailable(
446  _In_
447  WDFDRIVER Driver,
448  _In_
450  )
451 {
453 }
454 
455 
456 
457 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
458 
459 
461 
462 #endif // _WDFDRIVER_H_
463 
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG _Out_opt_ WDFDRIVER * Driver
Definition: wdfdriver.h:213
#define _Must_inspect_result_
Definition: no_sal2.h:62
ULONG MinorVersion
Definition: ros_glue.cpp:5
_Must_inspect_result_ _In_ WDFDRIVER _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES KeyAttributes
Definition: wdfdriver.h:306
ULONG MajorVersion
Definition: ros_glue.cpp:4
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
Definition: http.c:7251
uint16_t * PWSTR
Definition: typedefs.h:56
EVT_WDF_DRIVER_DEVICE_ADD * PFN_WDF_DRIVER_DEVICE_ADD
Definition: wdfdriver.h:78
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
PFN_WDF_DRIVER_UNLOAD EvtDriverUnload
Definition: wdfdriver.h:131
#define WDF_EXTERN_C_START
Definition: wdfdriver.h:39
GLuint buffer
Definition: glext.h:5915
_Must_inspect_result_ _In_ WDFDRIVER _In_ PWDF_DRIVER_VERSION_AVAILABLE_PARAMS VersionAvailableParams
Definition: wdfdriver.h:436
_In_opt_ PVOID _In_ ULONG bufferLength
Definition: wdfdriver.h:107
DriverGlobals
struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS * PWDF_DRIVER_VERSION_AVAILABLE_PARAMS
#define _In_opt_
Definition: no_sal2.h:212
#define WdfFunctions
Definition: wdf.h:66
FORCEINLINE WDFDRIVER WdfGetDriver(VOID)
Definition: wdfdriver.h:194
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
FORCEINLINE VOID WDF_DRIVER_CONFIG_INIT(_Out_ PWDF_DRIVER_CONFIG Config, _In_opt_ PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd)
Definition: wdfdriver.h:148
_In_opt_ PVOID _In_ ULONG _Inout_updates_bytes_(bufferLength) PVOID buffer
Definition: wdfdriver.h:110
#define WDF_EXTERN_C_END
Definition: wdfdriver.h:40
#define WDFAPI
Definition: wdftypes.h:53
EVT_WDF_DRIVER_UNLOAD * PFN_WDF_DRIVER_UNLOAD
Definition: wdfdriver.h:91
PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd
Definition: wdfdriver.h:129
unsigned char BOOLEAN
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PFN_WDF_TRACE_CALLBACK _In_ PVOID ControlBlock
Definition: wdfdriver.h:370
#define _Out_
Definition: no_sal2.h:160
_Must_inspect_result_ _In_ WDFDRIVER _In_ ACCESS_MASK DesiredAccess
Definition: wdfdriver.h:306
#define _IRQL_requires_same_
Definition: driverspecs.h:215
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES KeyAttributes
Definition: wdfdevice.h:2654
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define _Out_opt_
Definition: no_sal2.h:214
PWDF_DRIVER_GLOBALS WdfDriverGlobals
GLsizeiptr size
Definition: glext.h:5919
#define STDCALL
Definition: wdf.h:45
struct _WDF_DRIVER_CONFIG * PWDF_DRIVER_CONFIG
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES DriverAttributes
Definition: wdfdriver.h:213
#define _Inout_
Definition: no_sal2.h:162
WDF_EXTERN_C_START enum _WDF_DRIVER_INIT_FLAGS WDF_DRIVER_INIT_FLAGS
_Must_inspect_result_ _In_ WDFDRIVER _In_ WDFSTRING String
Definition: wdfdriver.h:405
unsigned char UCHAR
Definition: xmlstorage.h:181
_WDF_DRIVER_INIT_FLAGS
Definition: wdfdriver.h:50
#define NTSTATUS
Definition: precomp.h:20
#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
_In_opt_ PVOID dataPath
Definition: wdfdriver.h:107
#define FORCEINLINE
Definition: wdftypes.h:67
unsigned int * PULONG
Definition: retypes.h:1
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PFN_WDF_TRACE_CALLBACK EvtTraceCallback
Definition: wdfdriver.h:370
struct _WDF_DRIVER_CONFIG WDF_DRIVER_CONFIG
EVT_WDF_TRACE_CALLBACK * PFN_WDF_TRACE_CALLBACK
Definition: wdfdriver.h:118
typedef _Function_class_(EVT_WDF_DRIVER_DEVICE_ADD) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS STDCALL EVT_WDF_DRIVER_DEVICE_ADD(_In_ WDFDRIVER Driver
#define BOOLEAN
Definition: pedump.c:73
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
FORCEINLINE VOID WDF_DRIVER_VERSION_AVAILABLE_PARAMS_INIT(_Out_ PWDF_DRIVER_VERSION_AVAILABLE_PARAMS Params, _In_ ULONG MajorVersion, _In_ ULONG MinorVersion)
Definition: wdfdriver.h:179
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
WDFDRIVER Driver
Definition: wdfglobals.h:56
struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS WDF_DRIVER_VERSION_AVAILABLE_PARAMS
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
ULONG ACCESS_MASK
Definition: nt_native.h:40
struct _DRIVER_OBJECT * PDRIVER_OBJECT
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG DriverConfig
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDRIVER _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFKEY * Key
Definition: wdfdriver.h:306
_Must_inspect_result_ _IRQL_requires_max_(PASSIVE_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFDRIVERCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
Definition: wdfdriver.h:206