ReactOS 0.4.16-dev-91-g764881a
wdfdriver.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 wdfdriver.h
10
11Abstract:
12
13 This is the interfaces for the Windows Driver Framework Driver object
14
15Environment:
16
17 kernel mode only
18
19Revision 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
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
65typedef
66_Function_class_(EVT_WDF_DRIVER_DEVICE_ADD)
71EVT_WDF_DRIVER_DEVICE_ADD(
72 _In_
73 WDFDRIVER Driver,
76 );
77
78typedef EVT_WDF_DRIVER_DEVICE_ADD *PFN_WDF_DRIVER_DEVICE_ADD;
79
80typedef
81_Function_class_(EVT_WDF_DRIVER_UNLOAD)
84VOID
86EVT_WDF_DRIVER_UNLOAD(
87 _In_
88 WDFDRIVER Driver
89 );
90
91typedef 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//
97typedef
98_Function_class_(EVT_WDF_TRACE_CALLBACK)
103EVT_WDF_TRACE_CALLBACK(
104 _In_
105 UCHAR minorFunction,
108 _In_
112 _In_
114 _Out_
116 );
117
118typedef EVT_WDF_TRACE_CALLBACK *PFN_WDF_TRACE_CALLBACK;
119
120typedef 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
147VOID
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
178VOID
183 )
184{
186
188 Params->MajorVersion = MajorVersion;
189 Params->MinorVersion = MinorVersion;
190}
191
193WDFDRIVER
195 VOID
196 )
197{
198 return WdfDriverGlobals->Driver;
199}
200
201//
202// WDF Function: WdfDriverCreate
203//
204typedef
207WDFAPI
209(STDCALL *PFN_WDFDRIVERCREATE)(
210 _In_
212 _In_
214 _In_
218 _In_
221 WDFDRIVER* Driver
222 );
223
228WdfDriverCreate(
229 _In_
231 _In_
235 _In_
238 WDFDRIVER* Driver
239 )
240{
242}
243
244//
245// WDF Function: WdfDriverGetRegistryPath
246//
247typedef
249WDFAPI
250PWSTR
251(STDCALL *PFN_WDFDRIVERGETREGISTRYPATH)(
252 _In_
254 _In_
255 WDFDRIVER Driver
256 );
257
260PWSTR
261WdfDriverGetRegistryPath(
262 _In_
263 WDFDRIVER Driver
264 )
265{
266 return ((PFN_WDFDRIVERGETREGISTRYPATH) WdfFunctions[WdfDriverGetRegistryPathTableIndex])(WdfDriverGlobals, Driver);
267}
268
269//
270// WDF Function: WdfDriverWdmGetDriverObject
271//
272typedef
274WDFAPI
276(STDCALL *PFN_WDFDRIVERWDMGETDRIVEROBJECT)(
277 _In_
279 _In_
280 WDFDRIVER Driver
281 );
282
286WdfDriverWdmGetDriverObject(
287 _In_
288 WDFDRIVER Driver
289 )
290{
291 return ((PFN_WDFDRIVERWDMGETDRIVEROBJECT) WdfFunctions[WdfDriverWdmGetDriverObjectTableIndex])(WdfDriverGlobals, Driver);
292}
293
294//
295// WDF Function: WdfDriverOpenParametersRegistryKey
296//
297typedef
300WDFAPI
302(STDCALL *PFN_WDFDRIVEROPENPARAMETERSREGISTRYKEY)(
303 _In_
305 _In_
306 WDFDRIVER Driver,
307 _In_
311 _Out_
312 WDFKEY* Key
313 );
314
319WdfDriverOpenParametersRegistryKey(
320 _In_
321 WDFDRIVER Driver,
322 _In_
326 _Out_
327 WDFKEY* Key
328 )
329{
331}
332
333//
334// WDF Function: WdfWdmDriverGetWdfDriverHandle
335//
336typedef
338WDFAPI
339WDFDRIVER
340(STDCALL *PFN_WDFWDMDRIVERGETWDFDRIVERHANDLE)(
341 _In_
343 _In_
345 );
346
349WDFDRIVER
350WdfWdmDriverGetWdfDriverHandle(
351 _In_
353 )
354{
355 return ((PFN_WDFWDMDRIVERGETWDFDRIVERHANDLE) WdfFunctions[WdfWdmDriverGetWdfDriverHandleTableIndex])(WdfDriverGlobals, DriverObject);
356}
357
358//
359// WDF Function: WdfDriverRegisterTraceInfo
360//
361typedef
364WDFAPI
366(STDCALL *PFN_WDFDRIVERREGISTERTRACEINFO)(
367 _In_
369 _In_
371 _In_
373 _In_
375 );
376
381WdfDriverRegisterTraceInfo(
382 _In_
384 _In_
386 _In_
388 )
389{
391}
392
393//
394// WDF Function: WdfDriverRetrieveVersionString
395//
396typedef
399WDFAPI
401(STDCALL *PFN_WDFDRIVERRETRIEVEVERSIONSTRING)(
402 _In_
404 _In_
405 WDFDRIVER Driver,
406 _In_
407 WDFSTRING String
408 );
409
414WdfDriverRetrieveVersionString(
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//
427typedef
430WDFAPI
432(STDCALL *PFN_WDFDRIVERISVERSIONAVAILABLE)(
433 _In_
435 _In_
436 WDFDRIVER Driver,
437 _In_
439 );
440
445WdfDriverIsVersionAvailable(
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
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#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
ULONG MajorVersion
Definition: ros_glue.cpp:4
ULONG MinorVersion
Definition: ros_glue.cpp:5
DriverGlobals
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
#define _Function_class_(x)
Definition: ms_sal.h:2946
#define _Out_opt_
Definition: ms_sal.h:346
#define _Inout_
Definition: ms_sal.h:378
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define BOOLEAN
Definition: pedump.c:73
PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd
Definition: wdfdriver.h:129
PFN_WDF_DRIVER_UNLOAD EvtDriverUnload
Definition: wdfdriver.h:131
WDFDRIVER Driver
Definition: wdfglobals.h:56
Definition: http.c:7252
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
#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_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES KeyAttributes
Definition: wdfdevice.h:2660
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES DriverAttributes
Definition: wdfdriver.h:217
_In_opt_ PVOID _In_ ULONG _Inout_updates_bytes_(bufferLength) PVOID buffer
Definition: wdfdriver.h:110
struct _WDF_DRIVER_CONFIG * PWDF_DRIVER_CONFIG
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PFN_WDF_TRACE_CALLBACK _In_ PVOID ControlBlock
Definition: wdfdriver.h:375
struct _WDF_DRIVER_CONFIG WDF_DRIVER_CONFIG
WDF_EXTERN_C_START enum _WDF_DRIVER_INIT_FLAGS WDF_DRIVER_INIT_FLAGS
EVT_WDF_DRIVER_DEVICE_ADD * PFN_WDF_DRIVER_DEVICE_ADD
Definition: wdfdriver.h:78
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
#define WDF_EXTERN_C_END
Definition: wdfdriver.h:40
struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS * PWDF_DRIVER_VERSION_AVAILABLE_PARAMS
_Must_inspect_result_ _In_ WDFDRIVER _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES KeyAttributes
Definition: wdfdriver.h:310
struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS WDF_DRIVER_VERSION_AVAILABLE_PARAMS
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PWDF_DRIVER_CONFIG DriverConfig
Definition: wdfdriver.h:219
FORCEINLINE WDFDRIVER WdfGetDriver(VOID)
Definition: wdfdriver.h:194
_Must_inspect_result_ _In_ WDFDRIVER _In_ PWDF_DRIVER_VERSION_AVAILABLE_PARAMS VersionAvailableParams
Definition: wdfdriver.h:439
_Must_inspect_result_ _IRQL_requires_max_(PASSIVE_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFDRIVERCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
Definition: wdfdriver.h:206
EVT_WDF_TRACE_CALLBACK * PFN_WDF_TRACE_CALLBACK
Definition: wdfdriver.h:118
#define WDF_EXTERN_C_START
Definition: wdfdriver.h:39
EVT_WDF_DRIVER_UNLOAD * PFN_WDF_DRIVER_UNLOAD
Definition: wdfdriver.h:91
_Must_inspect_result_ _In_ WDFDRIVER _In_ ACCESS_MASK DesiredAccess
Definition: wdfdriver.h:308
_WDF_DRIVER_INIT_FLAGS
Definition: wdfdriver.h:50
@ WdfDriverInitNonPnpDriver
Definition: wdfdriver.h:51
@ WdfVerifierOn
Definition: wdfdriver.h:54
@ WdfDriverInitNoDispatchOverride
Definition: wdfdriver.h:52
@ WdfVerifyOn
Definition: wdfdriver.h:53
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_opt_ PVOID dataPath
Definition: wdfdriver.h:107
_Must_inspect_result_ _In_ WDFDRIVER _In_ WDFSTRING String
Definition: wdfdriver.h:408
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PFN_WDF_TRACE_CALLBACK EvtTraceCallback
Definition: wdfdriver.h:372
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDRIVER _In_ ACCESS_MASK _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFKEY * Key
Definition: wdfdriver.h:313
_In_opt_ PVOID _In_ ULONG bufferLength
Definition: wdfdriver.h:109
_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:222
FORCEINLINE VOID WDF_DRIVER_CONFIG_INIT(_Out_ PWDF_DRIVER_CONFIG Config, _In_opt_ PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd)
Definition: wdfdriver.h:148
PWDF_DRIVER_GLOBALS WdfDriverGlobals
@ WdfDriverGetRegistryPathTableIndex
Definition: wdffuncenum.h:142
@ WdfDriverOpenParametersRegistryKeyTableIndex
Definition: wdffuncenum.h:144
@ WdfDriverIsVersionAvailableTableIndex
Definition: wdffuncenum.h:148
@ WdfWdmDriverGetWdfDriverHandleTableIndex
Definition: wdffuncenum.h:145
@ WdfDriverWdmGetDriverObjectTableIndex
Definition: wdffuncenum.h:143
@ WdfDriverRetrieveVersionStringTableIndex
Definition: wdffuncenum.h:147
@ WdfDriverCreateTableIndex
Definition: wdffuncenum.h:141
@ WdfDriverRegisterTraceInfoTableIndex
Definition: wdffuncenum.h:146
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
#define WDFAPI
Definition: wdftypes.h:53
#define FORCEINLINE
Definition: wdftypes.h:67
struct _DRIVER_OBJECT * PDRIVER_OBJECT
unsigned char UCHAR
Definition: xmlstorage.h:181