xref: /reactos/sdk/lib/drivers/wdf/kmdf/inc/private/wdf19.h (revision 6b700c6a)
1 //
2 //    Copyright (C) Microsoft.  All rights reserved.
3 //
4 #ifndef _WDF_V1_9_TYPES_H_
5 #define _WDF_V1_9_TYPES_H_
6 
7 
8 typedef enum _WDFFUNCENUM_V1_9 {
9     WdfFunctionTableNumEntries_V1_9 = 396,
10 } WDFFUNCENUM_V1_9;
11 
12 typedef struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA_V1_9 *PWDF_POWER_ROUTINE_TIMED_OUT_DATA_V1_9;
13 typedef const struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA_V1_9 *PCWDF_POWER_ROUTINE_TIMED_OUT_DATA_V1_9;
14 typedef struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9 *PWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9;
15 typedef const struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9 *PCWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9;
16 typedef struct _WDF_QUEUE_FATAL_ERROR_DATA_V1_9 *PWDF_QUEUE_FATAL_ERROR_DATA_V1_9;
17 typedef const struct _WDF_QUEUE_FATAL_ERROR_DATA_V1_9 *PCWDF_QUEUE_FATAL_ERROR_DATA_V1_9;
18 typedef struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9 *PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9;
19 typedef const struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9 *PCWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9;
20 typedef struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9 *PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9;
21 typedef const struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9 *PCWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9;
22 typedef struct _WDF_CHILD_RETRIEVE_INFO_V1_9 *PWDF_CHILD_RETRIEVE_INFO_V1_9;
23 typedef const struct _WDF_CHILD_RETRIEVE_INFO_V1_9 *PCWDF_CHILD_RETRIEVE_INFO_V1_9;
24 typedef struct _WDF_CHILD_LIST_CONFIG_V1_9 *PWDF_CHILD_LIST_CONFIG_V1_9;
25 typedef const struct _WDF_CHILD_LIST_CONFIG_V1_9 *PCWDF_CHILD_LIST_CONFIG_V1_9;
26 typedef struct _WDF_CHILD_LIST_ITERATOR_V1_9 *PWDF_CHILD_LIST_ITERATOR_V1_9;
27 typedef const struct _WDF_CHILD_LIST_ITERATOR_V1_9 *PCWDF_CHILD_LIST_ITERATOR_V1_9;
28 typedef struct _WDF_CLASS_EXTENSION_DESCRIPTOR_V1_9 *PWDF_CLASS_EXTENSION_DESCRIPTOR_V1_9;
29 typedef const struct _WDF_CLASS_EXTENSION_DESCRIPTOR_V1_9 *PCWDF_CLASS_EXTENSION_DESCRIPTOR_V1_9;
30 typedef struct _WDF_CLASS_VERSION_V1_9 *PWDF_CLASS_VERSION_V1_9;
31 typedef const struct _WDF_CLASS_VERSION_V1_9 *PCWDF_CLASS_VERSION_V1_9;
32 typedef struct _WDF_CLASS_BIND_INFO_V1_9 *PWDF_CLASS_BIND_INFO_V1_9;
33 typedef const struct _WDF_CLASS_BIND_INFO_V1_9 *PCWDF_CLASS_BIND_INFO_V1_9;
34 typedef struct _WDF_CLASS_LIBRARY_INFO_V1_9 *PWDF_CLASS_LIBRARY_INFO_V1_9;
35 typedef const struct _WDF_CLASS_LIBRARY_INFO_V1_9 *PCWDF_CLASS_LIBRARY_INFO_V1_9;
36 typedef struct _WDF_COMMON_BUFFER_CONFIG_V1_9 *PWDF_COMMON_BUFFER_CONFIG_V1_9;
37 typedef const struct _WDF_COMMON_BUFFER_CONFIG_V1_9 *PCWDF_COMMON_BUFFER_CONFIG_V1_9;
38 typedef struct _WDF_FILEOBJECT_CONFIG_V1_9 *PWDF_FILEOBJECT_CONFIG_V1_9;
39 typedef const struct _WDF_FILEOBJECT_CONFIG_V1_9 *PCWDF_FILEOBJECT_CONFIG_V1_9;
40 typedef struct _WDF_DEVICE_PNP_NOTIFICATION_DATA_V1_9 *PWDF_DEVICE_PNP_NOTIFICATION_DATA_V1_9;
41 typedef const struct _WDF_DEVICE_PNP_NOTIFICATION_DATA_V1_9 *PCWDF_DEVICE_PNP_NOTIFICATION_DATA_V1_9;
42 typedef struct _WDF_DEVICE_POWER_NOTIFICATION_DATA_V1_9 *PWDF_DEVICE_POWER_NOTIFICATION_DATA_V1_9;
43 typedef const struct _WDF_DEVICE_POWER_NOTIFICATION_DATA_V1_9 *PCWDF_DEVICE_POWER_NOTIFICATION_DATA_V1_9;
44 typedef struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V1_9 *PWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V1_9;
45 typedef const struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V1_9 *PCWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V1_9;
46 typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9 *PWDF_PNPPOWER_EVENT_CALLBACKS_V1_9;
47 typedef const struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9 *PCWDF_PNPPOWER_EVENT_CALLBACKS_V1_9;
48 typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_9 *PWDF_POWER_POLICY_EVENT_CALLBACKS_V1_9;
49 typedef const struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_9 *PCWDF_POWER_POLICY_EVENT_CALLBACKS_V1_9;
50 typedef struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9 *PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9;
51 typedef const struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9 *PCWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9;
52 typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9 *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9;
53 typedef const struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9 *PCWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9;
54 typedef struct _WDF_DEVICE_STATE_V1_9 *PWDF_DEVICE_STATE_V1_9;
55 typedef const struct _WDF_DEVICE_STATE_V1_9 *PCWDF_DEVICE_STATE_V1_9;
56 typedef struct _WDF_DEVICE_PNP_CAPABILITIES_V1_9 *PWDF_DEVICE_PNP_CAPABILITIES_V1_9;
57 typedef const struct _WDF_DEVICE_PNP_CAPABILITIES_V1_9 *PCWDF_DEVICE_PNP_CAPABILITIES_V1_9;
58 typedef struct _WDF_DEVICE_POWER_CAPABILITIES_V1_9 *PWDF_DEVICE_POWER_CAPABILITIES_V1_9;
59 typedef const struct _WDF_DEVICE_POWER_CAPABILITIES_V1_9 *PCWDF_DEVICE_POWER_CAPABILITIES_V1_9;
60 typedef struct _WDF_DMA_ENABLER_CONFIG_V1_9 *PWDF_DMA_ENABLER_CONFIG_V1_9;
61 typedef const struct _WDF_DMA_ENABLER_CONFIG_V1_9 *PCWDF_DMA_ENABLER_CONFIG_V1_9;
62 typedef struct _WDF_DPC_CONFIG_V1_9 *PWDF_DPC_CONFIG_V1_9;
63 typedef const struct _WDF_DPC_CONFIG_V1_9 *PCWDF_DPC_CONFIG_V1_9;
64 typedef struct _WDF_DRIVER_CONFIG_V1_9 *PWDF_DRIVER_CONFIG_V1_9;
65 typedef const struct _WDF_DRIVER_CONFIG_V1_9 *PCWDF_DRIVER_CONFIG_V1_9;
66 typedef struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9 *PWDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9;
67 typedef const struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9 *PCWDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9;
68 typedef struct _WDF_FDO_EVENT_CALLBACKS_V1_9 *PWDF_FDO_EVENT_CALLBACKS_V1_9;
69 typedef const struct _WDF_FDO_EVENT_CALLBACKS_V1_9 *PCWDF_FDO_EVENT_CALLBACKS_V1_9;
70 typedef struct _WDF_DRIVER_GLOBALS_V1_9 *PWDF_DRIVER_GLOBALS_V1_9;
71 typedef const struct _WDF_DRIVER_GLOBALS_V1_9 *PCWDF_DRIVER_GLOBALS_V1_9;
72 typedef struct _WDF_INTERRUPT_CONFIG_V1_9 *PWDF_INTERRUPT_CONFIG_V1_9;
73 typedef const struct _WDF_INTERRUPT_CONFIG_V1_9 *PCWDF_INTERRUPT_CONFIG_V1_9;
74 typedef struct _WDF_INTERRUPT_INFO_V1_9 *PWDF_INTERRUPT_INFO_V1_9;
75 typedef const struct _WDF_INTERRUPT_INFO_V1_9 *PCWDF_INTERRUPT_INFO_V1_9;
76 typedef struct _WDF_INTERRUPT_EXTENDED_POLICY_V1_9 *PWDF_INTERRUPT_EXTENDED_POLICY_V1_9;
77 typedef const struct _WDF_INTERRUPT_EXTENDED_POLICY_V1_9 *PCWDF_INTERRUPT_EXTENDED_POLICY_V1_9;
78 typedef struct _WDF_IO_QUEUE_CONFIG_V1_9 *PWDF_IO_QUEUE_CONFIG_V1_9;
79 typedef const struct _WDF_IO_QUEUE_CONFIG_V1_9 *PCWDF_IO_QUEUE_CONFIG_V1_9;
80 typedef struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9 *PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9;
81 typedef const struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9 *PCWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9;
82 typedef struct _WDF_IO_TARGET_OPEN_PARAMS_V1_9 *PWDF_IO_TARGET_OPEN_PARAMS_V1_9;
83 typedef const struct _WDF_IO_TARGET_OPEN_PARAMS_V1_9 *PCWDF_IO_TARGET_OPEN_PARAMS_V1_9;
84 typedef struct _WDFMEMORY_OFFSET_V1_9 *PWDFMEMORY_OFFSET_V1_9;
85 typedef const struct _WDFMEMORY_OFFSET_V1_9 *PCWDFMEMORY_OFFSET_V1_9;
86 typedef struct _WDF_MEMORY_DESCRIPTOR_V1_9 *PWDF_MEMORY_DESCRIPTOR_V1_9;
87 typedef const struct _WDF_MEMORY_DESCRIPTOR_V1_9 *PCWDF_MEMORY_DESCRIPTOR_V1_9;
88 typedef struct _WDF_OBJECT_ATTRIBUTES_V1_9 *PWDF_OBJECT_ATTRIBUTES_V1_9;
89 typedef const struct _WDF_OBJECT_ATTRIBUTES_V1_9 *PCWDF_OBJECT_ATTRIBUTES_V1_9;
90 typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V1_9 *PWDF_OBJECT_CONTEXT_TYPE_INFO_V1_9;
91 typedef const struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V1_9 *PCWDF_OBJECT_CONTEXT_TYPE_INFO_V1_9;
92 typedef struct _WDF_PDO_EVENT_CALLBACKS_V1_9 *PWDF_PDO_EVENT_CALLBACKS_V1_9;
93 typedef const struct _WDF_PDO_EVENT_CALLBACKS_V1_9 *PCWDF_PDO_EVENT_CALLBACKS_V1_9;
94 typedef struct _WDF_QUERY_INTERFACE_CONFIG_V1_9 *PWDF_QUERY_INTERFACE_CONFIG_V1_9;
95 typedef const struct _WDF_QUERY_INTERFACE_CONFIG_V1_9 *PCWDF_QUERY_INTERFACE_CONFIG_V1_9;
96 typedef struct _WDF_REQUEST_PARAMETERS_V1_9 *PWDF_REQUEST_PARAMETERS_V1_9;
97 typedef const struct _WDF_REQUEST_PARAMETERS_V1_9 *PCWDF_REQUEST_PARAMETERS_V1_9;
98 typedef struct _WDF_REQUEST_COMPLETION_PARAMS_V1_9 *PWDF_REQUEST_COMPLETION_PARAMS_V1_9;
99 typedef const struct _WDF_REQUEST_COMPLETION_PARAMS_V1_9 *PCWDF_REQUEST_COMPLETION_PARAMS_V1_9;
100 typedef struct _WDF_REQUEST_REUSE_PARAMS_V1_9 *PWDF_REQUEST_REUSE_PARAMS_V1_9;
101 typedef const struct _WDF_REQUEST_REUSE_PARAMS_V1_9 *PCWDF_REQUEST_REUSE_PARAMS_V1_9;
102 typedef struct _WDF_REQUEST_SEND_OPTIONS_V1_9 *PWDF_REQUEST_SEND_OPTIONS_V1_9;
103 typedef const struct _WDF_REQUEST_SEND_OPTIONS_V1_9 *PCWDF_REQUEST_SEND_OPTIONS_V1_9;
104 typedef struct _WDF_REQUEST_FORWARD_OPTIONS_V1_9 *PWDF_REQUEST_FORWARD_OPTIONS_V1_9;
105 typedef const struct _WDF_REQUEST_FORWARD_OPTIONS_V1_9 *PCWDF_REQUEST_FORWARD_OPTIONS_V1_9;
106 typedef struct _WDF_TIMER_CONFIG_V1_9 *PWDF_TIMER_CONFIG_V1_9;
107 typedef const struct _WDF_TIMER_CONFIG_V1_9 *PCWDF_TIMER_CONFIG_V1_9;
108 typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS_V1_9 *PWDF_USB_REQUEST_COMPLETION_PARAMS_V1_9;
109 typedef const struct _WDF_USB_REQUEST_COMPLETION_PARAMS_V1_9 *PCWDF_USB_REQUEST_COMPLETION_PARAMS_V1_9;
110 typedef struct _WDF_USB_CONTINUOUS_READER_CONFIG_V1_9 *PWDF_USB_CONTINUOUS_READER_CONFIG_V1_9;
111 typedef const struct _WDF_USB_CONTINUOUS_READER_CONFIG_V1_9 *PCWDF_USB_CONTINUOUS_READER_CONFIG_V1_9;
112 typedef struct _WDF_USB_DEVICE_INFORMATION_V1_9 *PWDF_USB_DEVICE_INFORMATION_V1_9;
113 typedef const struct _WDF_USB_DEVICE_INFORMATION_V1_9 *PCWDF_USB_DEVICE_INFORMATION_V1_9;
114 typedef struct _WDF_USB_INTERFACE_SETTING_PAIR_V1_9 *PWDF_USB_INTERFACE_SETTING_PAIR_V1_9;
115 typedef const struct _WDF_USB_INTERFACE_SETTING_PAIR_V1_9 *PCWDF_USB_INTERFACE_SETTING_PAIR_V1_9;
116 typedef struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9 *PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9;
117 typedef const struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9 *PCWDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9;
118 typedef struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9 *PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9;
119 typedef const struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9 *PCWDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9;
120 typedef struct _WDF_USB_PIPE_INFORMATION_V1_9 *PWDF_USB_PIPE_INFORMATION_V1_9;
121 typedef const struct _WDF_USB_PIPE_INFORMATION_V1_9 *PCWDF_USB_PIPE_INFORMATION_V1_9;
122 typedef struct _WDF_WMI_PROVIDER_CONFIG_V1_9 *PWDF_WMI_PROVIDER_CONFIG_V1_9;
123 typedef const struct _WDF_WMI_PROVIDER_CONFIG_V1_9 *PCWDF_WMI_PROVIDER_CONFIG_V1_9;
124 typedef struct _WDF_WMI_INSTANCE_CONFIG_V1_9 *PWDF_WMI_INSTANCE_CONFIG_V1_9;
125 typedef const struct _WDF_WMI_INSTANCE_CONFIG_V1_9 *PCWDF_WMI_INSTANCE_CONFIG_V1_9;
126 typedef struct _WDF_WORKITEM_CONFIG_V1_9 *PWDF_WORKITEM_CONFIG_V1_9;
127 typedef const struct _WDF_WORKITEM_CONFIG_V1_9 *PCWDF_WORKITEM_CONFIG_V1_9;
128 
129 //
130 // Versioning of structures for wdf.h
131 //
132 // End of versioning of structures for wdf.h
133 
134 //
135 // Versioning of structures for wdfassert.h
136 //
137 // End of versioning of structures for wdfassert.h
138 
139 //
140 // Versioning of structures for wdfbugcodes.h
141 //
142 typedef struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA_V1_9 {
143     //
144     // Current power state associated with the timed out device
145     //
146     WDF_DEVICE_POWER_STATE PowerState;
147 
148     //
149     // Current power policy state associated with the timed out device
150     //
151     WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState;
152 
153     //
154     // The device object for the timed out device
155     //
156     PDEVICE_OBJECT DeviceObject;
157 
158     //
159     // The handle for the timed out device
160     //
161     WDFDEVICE Device;
162 
163     //
164     // The thread which is stuck
165     //
166     PKTHREAD TimedOutThread;
167 
168 } WDF_POWER_ROUTINE_TIMED_OUT_DATA_V1_9;
169 
170 typedef struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9 {
171     WDFREQUEST Request;
172 
173     PIRP Irp;
174 
175     ULONG OutputBufferLength;
176 
177     ULONG_PTR Information;
178 
179     UCHAR MajorFunction;
180 
181 } WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9, *PWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V1_9;
182 
183 typedef struct _WDF_QUEUE_FATAL_ERROR_DATA_V1_9 {
184     WDFQUEUE Queue;
185 
186     WDFREQUEST Request;
187 
188     NTSTATUS Status;
189 
190 } WDF_QUEUE_FATAL_ERROR_DATA_V1_9, *PWDF_QUEUE_FATAL_ERROR_DATA_V1_9;
191 
192 // End of versioning of structures for wdfbugcodes.h
193 
194 //
195 // Versioning of structures for wdfchildlist.h
196 //
197 typedef struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9 {
198     //
199     // Size in bytes of the entire description, including this header.
200     //
201     // Same value as WDF_CHILD_LIST_CONFIG::IdentificationDescriptionSize
202     // Used as a sanity check.
203     //
204     ULONG IdentificationDescriptionSize;
205 
206 } WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9, *PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9;
207 
208 typedef struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9 {
209     //
210     // Size in bytes of the entire description, including this header.
211     //
212     // Same value as WDF_CHILD_LIST_CONFIG::AddressDescriptionSize
213     // Used as a sanity check.
214     //
215     ULONG AddressDescriptionSize;
216 
217 } WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9, *PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9;
218 
219 typedef struct _WDF_CHILD_RETRIEVE_INFO_V1_9 {
220     //
221     // Size of the structure in bytes
222     //
223     ULONG Size;
224 
225     //
226     // Must be a valid pointer when passed in, copied into upon success
227     //
228     PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V1_9 IdentificationDescription;
229 
230     //
231     // Optional pointer when passed in, copied into upon success
232     //
233     PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V1_9 AddressDescription;
234 
235     //
236     // Status of the returned device
237     //
238     WDF_CHILD_LIST_RETRIEVE_DEVICE_STATUS Status;
239 
240     //
241     // If provided, will be used for searching through the list of devices
242     // instead of the default list ID compare function
243     //
244     PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE EvtChildListIdentificationDescriptionCompare;
245 
246 } WDF_CHILD_RETRIEVE_INFO_V1_9, *PWDF_CHILD_RETRIEVE_INFO_V1_9;
247 
248 typedef struct _WDF_CHILD_LIST_CONFIG_V1_9 {
249     //
250     // Size of this structure in bytes
251     //
252     ULONG Size;
253 
254     //
255     // The size in bytes of an identificaiton description to be used with the
256     // created WDFCHILDLIST handle
257     //
258     ULONG IdentificationDescriptionSize;
259 
260     //
261     // Optional size in bytes of an address description to be used with the
262     // created WDFCHILDLIST handle.
263     //
264     ULONG AddressDescriptionSize;
265 
266     //
267     // Required callback to be invoked when a description on the device list
268     // needs to be converted into a real WDFDEVICE handle.
269     //
270     PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice;
271 
272     //
273     // Optional callback to be invoked when the device list needs to be
274     // rescanned.  This function will be called after the device has entered D0
275     // and been fully initialized but before I/O has started.
276     //
277     PFN_WDF_CHILD_LIST_SCAN_FOR_CHILDREN EvtChildListScanForChildren;
278 
279     //
280     // Optional callback to be invoked when an identification description needs
281     // to be copied from one location to another.
282     //
283     // If left NULL, RtlCopyMemory will be used to copy the description.
284     //
285     PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY EvtChildListIdentificationDescriptionCopy;
286 
287     //
288     // Optional callback to be invoked when an identification description needs
289     // to be duplicated.  As opposed to EvtChildListIdentificationDescriptionCopy,
290     // EvtChildListIdentificationDescriptionDuplicate can fail.
291     //
292     PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE EvtChildListIdentificationDescriptionDuplicate;
293 
294     //
295     // Optional callback to be invoked when an identification description needs
296     // to be cleaned up.  This function should *NOT* free the description passed
297     // to it, just free any associated resources.
298     //
299     PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP EvtChildListIdentificationDescriptionCleanup;
300 
301     //
302     // Optional callback to be invoked when an identification description needs
303     // to be compared with another identificaiton description.
304     //
305     // If left NULL, RtlCompareMemory will be used to compare the two
306     // descriptions.
307     //
308     PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE EvtChildListIdentificationDescriptionCompare;
309 
310     //
311     // Optional callback to be invoked when an address description needs
312     // to be copied from one location to another.
313     //
314     // If left NULL, RtlCopyMemory will be used to copy the description.
315     //
316     PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY EvtChildListAddressDescriptionCopy;
317 
318     //
319     // Optional callback to be invoked when an address description needs to be
320     // duplicated.  As opposed to EvtChildListAddressDescriptionCopy,
321     // EvtChildListAddressDescriptionDuplicate can fail.
322     //
323     PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE EvtChildListAddressDescriptionDuplicate;
324 
325     //
326     // Optional callback to be invoked when an address description needs to be
327     // cleaned up.  This function should *NOT* free the description passed to
328     // it, just free any associated resources.
329     //
330     PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP EvtChildListAddressDescriptionCleanup;
331 
332     //
333     // If provided, will be called when the child's stack requests that the
334     // child be reenumerated.  Returning TRUE allows for the reenumeration to
335     // proceed.  FALSE will no reenumerate the stack.
336     //
337     PFN_WDF_CHILD_LIST_DEVICE_REENUMERATED EvtChildListDeviceReenumerated;
338 
339 } WDF_CHILD_LIST_CONFIG_V1_9, *PWDF_CHILD_LIST_CONFIG_V1_9;
340 
341 typedef struct _WDF_CHILD_LIST_ITERATOR_V1_9 {
342     //
343     // Size of this structure in bytes
344     //
345     ULONG Size;
346 
347     //
348     // What type of devices to return, see WDF_RETRIEVE_CHILD_FLAGS for
349     // flag values
350     //
351     //
352     ULONG Flags;
353 
354     //
355     // For internal use, treat this field as opaque
356     //
357     PVOID Reserved[4];
358 
359 } WDF_CHILD_LIST_ITERATOR_V1_9, *PWDF_CHILD_LIST_ITERATOR_V1_9;
360 
361 // End of versioning of structures for wdfchildlist.h
362 
363 //
364 // Versioning of structures for wdfClassExtension.h
365 //
366 typedef struct _WDF_CLASS_EXTENSION_DESCRIPTOR_V1_9 {
367     PCWDF_CLASS_EXTENSION_DESCRIPTOR_V1_9   Next;
368 
369     ULONG                             Size;
370 
371     PFN_WDF_CLASS_EXTENSIONIN_BIND    Bind;
372 
373     PFN_WDF_CLASS_EXTENSIONIN_UNBIND  Unbind;
374 
375 } WDF_CLASS_EXTENSION_DESCRIPTOR_V1_9, *PWDF_CLASS_EXTENSION_DESCRIPTOR_V1_9;
376 
377 typedef struct _WDF_CLASS_VERSION_V1_9 {
378     WDF_MAJOR_VERSION  Major;
379 
380     WDF_MINOR_VERSION  Minor;
381 
382     WDF_BUILD_NUMBER   Build;
383 
384 } WDF_CLASS_VERSION_V1_9;
385 
386 typedef struct _WDF_CLASS_BIND_INFO_V1_9 {
387     //
388     // Size of the structure in bytes
389     //
390     ULONG Size;
391 
392     //
393     // Name of the class to bind to
394     //
395     PWSTR ClassName;
396 
397     //
398     // Version information for the class
399     //
400     WDF_CLASS_VERSION_V1_9  Version;
401 
402     //
403     // Function export table from the class driver to resolve on bind
404     //
405     PFN_WDF_CLASS_EXPORT * FunctionTable;
406 
407     //
408     // Number of entries in FunctionTable
409     //
410     ULONG FunctionTableCount;
411 
412     //
413     // Optional field where the client specify additional information
414     // for the class driver to resolve
415     //
416     PVOID ClassBindInfo;
417 
418     //
419     // Optional bind callback.  If set, WdfVersionBindClass will not
420     // be called and it will be up to ClientClassBind to call this function
421     // if required.
422     //
423     PFN_WDF_CLIENT_BIND_CLASS ClientBindClass;
424 
425     //
426     // Optional unbind callback.  If set, WdfVersionUnbindClass will not be
427     // called and it will be up to ClientClassUnbind to call this function
428     // if required.
429     //
430     PFN_WDF_CLIENT_UNBIND_CLASS ClientUnbindClass;
431 
432     //
433     // Diagnostic cookie to use during debugging
434     //
435     PVOID ClassModule;
436 
437 } WDF_CLASS_BIND_INFO_V1_9, * PWDF_CLASS_BIND_INFO_V1_9;
438 
439 typedef struct _WDF_CLASS_LIBRARY_INFO_V1_9 {
440     //
441     // Size of this structure in bytes
442     //
443     ULONG Size;
444 
445     //
446     // Version of this class library
447     //
448     WDF_CLASS_VERSION_V1_9 Version;
449 
450     //
451     // Callback to be called by the loader to initialize the class library
452     //
453     PFN_WDF_CLASS_LIBRARY_INITIALIZE ClassLibraryInitialize;
454 
455     //
456     // Callback to be called by the loader to deinitialize the class library
457     // after succesful initialization (immediately before the class library will
458     // be unloaded).
459     //
460     PFN_WDF_CLASS_LIBRARY_DEINITIALIZE ClassLibraryDeinitialize;
461 
462     //
463     // Callback to be called by the loader when a client driver has request to
464     // be bound to this class library.
465     //
466     PFN_WDF_CLASS_LIBRARY_BIND_CLIENT ClassLibraryBindClient;
467 
468     //
469     // Callback to be called by the loader when a previously bound client driver
470     // is being unloaded.
471     //
472     PFN_WDF_CLASS_LIBRARY_UNBIND_CLIENT ClassLibraryUnbindClient;
473 
474 } WDF_CLASS_LIBRARY_INFO_V1_9, *PWDF_CLASS_LIBRARY_INFO_V1_9;
475 
476 // End of versioning of structures for wdfClassExtension.h
477 
478 //
479 // Versioning of structures for wdfClassExtensionList.h
480 //
481 // End of versioning of structures for wdfClassExtensionList.h
482 
483 //
484 // Versioning of structures for wdfcollection.h
485 //
486 // End of versioning of structures for wdfcollection.h
487 
488 //
489 // Versioning of structures for wdfCommonBuffer.h
490 //
491 typedef struct _WDF_COMMON_BUFFER_CONFIG_V1_9 {
492     //
493     // Size of this structure in bytes
494     //
495     ULONG   Size;
496 
497     //
498     // Alignment requirement of the buffer address
499     //
500     ULONG   AlignmentRequirement;
501 
502 } WDF_COMMON_BUFFER_CONFIG_V1_9, *PWDF_COMMON_BUFFER_CONFIG_V1_9;
503 
504 // End of versioning of structures for wdfCommonBuffer.h
505 
506 //
507 // Versioning of structures for wdfcontrol.h
508 //
509 // End of versioning of structures for wdfcontrol.h
510 
511 //
512 // Versioning of structures for wdfcore.h
513 //
514 // End of versioning of structures for wdfcore.h
515 
516 //
517 // Versioning of structures for wdfDevice.h
518 //
519 typedef struct _WDF_FILEOBJECT_CONFIG_V1_9 {
520     //
521     // Size of this structure in bytes
522     //
523     ULONG Size;
524 
525     //
526     // Event callback for create requests
527     //
528     PFN_WDF_DEVICE_FILE_CREATE  EvtDeviceFileCreate;
529 
530     //
531     // Event callback for close requests
532     //
533     PFN_WDF_FILE_CLOSE   EvtFileClose;
534 
535     //
536     // Event callback for cleanup requests
537     //
538     PFN_WDF_FILE_CLEANUP EvtFileCleanup;
539 
540     //
541     // If WdfTrue, create/cleanup/close file object related requests will be
542     // sent down the stack.
543     //
544     // If WdfFalse, create/cleanup/close will be completed at this location in
545     // the device stack.
546     //
547     // If WdfDefault, behavior depends on device type
548     // FDO, PDO, Control:  use the WdfFalse behavior
549     // Filter:  use the WdfTrue behavior
550     //
551     WDF_TRI_STATE AutoForwardCleanupClose;
552 
553     //
554     // Specify whether framework should create WDFFILEOBJECT and also
555     // whether it can FsContexts fields in the WDM fileobject to store
556     // WDFFILEOBJECT so that it can avoid table look up and improve perf.
557     //
558     WDF_FILEOBJECT_CLASS FileObjectClass;
559 
560 } WDF_FILEOBJECT_CONFIG_V1_9, *PWDF_FILEOBJECT_CONFIG_V1_9;
561 
562 typedef struct _WDF_DEVICE_PNP_NOTIFICATION_DATA_V1_9 {
563     //
564     // Type of data
565     //
566     WDF_STATE_NOTIFICATION_TYPE Type;
567 
568     union {
569         struct {
570             //
571             // The current state that is about to be exited
572             //
573             WDF_DEVICE_PNP_STATE CurrentState;
574 
575             //
576             // The new state that is about to be entered
577             //
578             WDF_DEVICE_PNP_STATE NewState;
579 
580         } EnterState;
581 
582         struct {
583             //
584             // The current state
585             //
586             WDF_DEVICE_PNP_STATE CurrentState;
587 
588         } PostProcessState;
589 
590         struct {
591             //
592             // The current state that is about to be exitted
593             //
594             WDF_DEVICE_PNP_STATE CurrentState;
595 
596             //
597             // The state that is about to be entered
598             //
599             WDF_DEVICE_PNP_STATE NewState;
600 
601         } LeaveState;
602 
603     } Data;
604 
605 } WDF_DEVICE_PNP_NOTIFICATION_DATA_V1_9;
606 
607 typedef struct _WDF_DEVICE_POWER_NOTIFICATION_DATA_V1_9 {
608     //
609     // Type of data
610     //
611     WDF_STATE_NOTIFICATION_TYPE Type;
612 
613     union {
614         struct {
615             //
616             // The current state that is about to be exitted
617             //
618             WDF_DEVICE_POWER_STATE CurrentState;
619 
620             //
621             // The new state that is about to be entered
622             //
623             WDF_DEVICE_POWER_STATE NewState;
624 
625         } EnterState;
626 
627         struct {
628             //
629             // The current state
630             //
631             WDF_DEVICE_POWER_STATE CurrentState;
632 
633         } PostProcessState;
634 
635         struct {
636             //
637             // The current state that is about to be exitted
638             //
639             WDF_DEVICE_POWER_STATE CurrentState;
640 
641             //
642             // The state that is about to be entered
643             //
644             WDF_DEVICE_POWER_STATE NewState;
645 
646         } LeaveState;
647 
648     } Data;
649 
650 } WDF_DEVICE_POWER_NOTIFICATION_DATA_V1_9;
651 
652 typedef struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V1_9 {
653     //
654     // Type of data
655     //
656     WDF_STATE_NOTIFICATION_TYPE Type;
657 
658     union {
659         struct {
660             //
661             // The current state that is about to be exitted
662             //
663             WDF_DEVICE_POWER_POLICY_STATE CurrentState;
664 
665             //
666             // The new state that is about to be entered
667             //
668             WDF_DEVICE_POWER_POLICY_STATE NewState;
669 
670         } EnterState;
671 
672         struct {
673             //
674             // The current state
675             //
676             WDF_DEVICE_POWER_POLICY_STATE CurrentState;
677 
678         } PostProcessState;
679 
680         struct {
681             //
682             // The current state that is about to be exitted
683             //
684             WDF_DEVICE_POWER_POLICY_STATE CurrentState;
685 
686             //
687             // The state that is about to be entered
688             //
689             WDF_DEVICE_POWER_POLICY_STATE NewState;
690 
691         } LeaveState;
692 
693     } Data;
694 
695 } WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V1_9;
696 
697 typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS_V1_9 {
698     //
699     // Size of this structure in bytes
700     //
701     ULONG Size;
702 
703     PFN_WDF_DEVICE_D0_ENTRY                 EvtDeviceD0Entry;
704 
705     PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled;
706 
707     PFN_WDF_DEVICE_D0_EXIT                  EvtDeviceD0Exit;
708 
709     PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED EvtDeviceD0ExitPreInterruptsDisabled;
710 
711     PFN_WDF_DEVICE_PREPARE_HARDWARE         EvtDevicePrepareHardware;
712 
713     PFN_WDF_DEVICE_RELEASE_HARDWARE         EvtDeviceReleaseHardware;
714 
715     PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP  EvtDeviceSelfManagedIoCleanup;
716 
717     PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH    EvtDeviceSelfManagedIoFlush;
718 
719     PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT     EvtDeviceSelfManagedIoInit;
720 
721     PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND  EvtDeviceSelfManagedIoSuspend;
722 
723     PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART  EvtDeviceSelfManagedIoRestart;
724 
725     PFN_WDF_DEVICE_SURPRISE_REMOVAL         EvtDeviceSurpriseRemoval;
726 
727     PFN_WDF_DEVICE_QUERY_REMOVE             EvtDeviceQueryRemove;
728 
729     PFN_WDF_DEVICE_QUERY_STOP               EvtDeviceQueryStop;
730 
731     PFN_WDF_DEVICE_USAGE_NOTIFICATION       EvtDeviceUsageNotification;
732 
733     PFN_WDF_DEVICE_RELATIONS_QUERY          EvtDeviceRelationsQuery;
734 
735 } WDF_PNPPOWER_EVENT_CALLBACKS_V1_9, *PWDF_PNPPOWER_EVENT_CALLBACKS_V1_9;
736 
737 typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V1_9 {
738     //
739     // Size of this structure in bytes
740     //
741     ULONG Size;
742 
743     PFN_WDF_DEVICE_ARM_WAKE_FROM_S0         EvtDeviceArmWakeFromS0;
744 
745     PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0      EvtDeviceDisarmWakeFromS0;
746 
747     PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED   EvtDeviceWakeFromS0Triggered;
748 
749     PFN_WDF_DEVICE_ARM_WAKE_FROM_SX         EvtDeviceArmWakeFromSx;
750 
751     PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX      EvtDeviceDisarmWakeFromSx;
752 
753     PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED   EvtDeviceWakeFromSxTriggered;
754 
755     PFN_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON EvtDeviceArmWakeFromSxWithReason;
756 
757 } WDF_POWER_POLICY_EVENT_CALLBACKS_V1_9, *PWDF_POWER_POLICY_EVENT_CALLBACKS_V1_9;
758 
759 typedef struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9 {
760     //
761     // Size of this structure in bytes
762     //
763     ULONG Size;
764 
765     //
766     // Indicates whether the device can wake itself up while the machine is in
767     // S0.
768     //
769     WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps;
770 
771     //
772     // The low power state in which the device will be placed when it is idled
773     // out while the machine is in S0.
774     //
775     DEVICE_POWER_STATE DxState;
776 
777     //
778     // Amount of time the device must be idle before idling out.  Timeout is in
779     // milliseconds.
780     //
781     ULONG IdleTimeout;
782 
783     //
784     // Inidcates whether a user can control the idle policy of the device.
785     // By default, a user is allowed to change the policy.
786     //
787     WDF_POWER_POLICY_S0_IDLE_USER_CONTROL UserControlOfIdleSettings;
788 
789     //
790     // If WdfTrue, idling out while the machine is in S0 will be enabled.
791     //
792     // If WdfFalse, idling out will be disabled.
793     //
794     // If WdfUseDefault, the idling out will be enabled.  If
795     // UserControlOfIdleSettings is set to IdleAllowUserControl, the user's
796     // settings will override the default.
797     //
798     WDF_TRI_STATE Enabled;
799 
800     //
801     // This field is applicable only when IdleCaps == IdleCannotWakeFromS0
802     // If WdfTrue,device is powered up on System Wake even if device is idle
803     // If WdfFalse, device is not powered up on system wake if it is idle
804     // If WdfUseDefault, the behavior is same as WdfFalse
805     //
806     WDF_TRI_STATE PowerUpIdleDeviceOnSystemWake;
807 
808 } WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9, *PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V1_9;
809 
810 typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9 {
811     //
812     // Size of this structure in bytes
813     //
814     ULONG Size;
815 
816     //
817     // The low power state in which the device will be placed when it is armed
818     // for wake from Sx.
819     //
820     DEVICE_POWER_STATE DxState;
821 
822     //
823     // Inidcates whether a user can control the idle policy of the device.
824     // By default, a user is allowed to change the policy.
825     //
826     WDF_POWER_POLICY_SX_WAKE_USER_CONTROL UserControlOfWakeSettings;
827 
828     //
829     // If WdfTrue, arming the device for wake while the machine is in Sx is
830     // enabled.
831     //
832     // If WdfFalse, arming the device for wake while the machine is in Sx is
833     // disabled.
834     //
835     // If WdfUseDefault, arming will be enabled.  If UserControlOfWakeSettings
836     // is set to WakeAllowUserControl, the user's settings will override the
837     // default.
838     //
839     WDF_TRI_STATE Enabled;
840 
841     //
842     // If set to TRUE, arming the parent device can depend on whether there
843     // is atleast one child device armed for wake.
844     //
845     // If set to FALSE, arming of the parent device will be independent of
846     // whether any of the child devices are armed for wake.
847     //
848     BOOLEAN ArmForWakeIfChildrenAreArmedForWake;
849 
850     //
851     // Indicates that whenever the parent device completes the wake irp
852     // successfully, the status needs to be also propagated to the child
853     // devices.  This helps in tracking which devices were responsible for
854     // waking the system.
855     //
856     BOOLEAN IndicateChildWakeOnParentWake;
857 
858 } WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9, *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V1_9;
859 
860 typedef struct _WDF_DEVICE_STATE_V1_9 {
861     //
862     // Size of this structure in bytes
863     //
864     ULONG Size;
865 
866     //
867     // If set to WdfTrue, the device will be disabled
868     //
869     WDF_TRI_STATE Disabled;
870 
871     //
872     // If set to WdfTrue, the device will not be displayed in device manager.
873     // Once hidden, the device cannot be unhidden.
874     //
875     WDF_TRI_STATE DontDisplayInUI;
876 
877     //
878     // If set to WdfTrue, the device is reporting itself as failed.  If set
879     // in conjuction with ResourcesChanged to WdfTrue, the device will receive
880     // a PnP stop and then a new PnP start device.
881     //
882     WDF_TRI_STATE Failed;
883 
884     //
885     // If set to WdfTrue, the device cannot be subsequently disabled.
886     //
887     WDF_TRI_STATE NotDisableable;
888 
889 
890 
891 
892     //
893     //
894     // If set to WdfTrue, the device stack will be torn down.
895     //
896     WDF_TRI_STATE Removed;
897 
898     //
899     // If set to WdfTrue, the device will be sent another PnP start.  If the
900     // Failed field is set to WdfTrue as well, a PnP stop will be sent before
901     // the start.
902     //
903     WDF_TRI_STATE ResourcesChanged;
904 
905 } WDF_DEVICE_STATE_V1_9, *PWDF_DEVICE_STATE_V1_9;
906 
907 typedef struct _WDF_DEVICE_PNP_CAPABILITIES_V1_9 {
908     //
909     // Size of the structure in bytes
910     //
911     ULONG Size;
912 
913     //
914     // NOTE: To mark a PDO as raw, call WdfPdoInitAssignRawDevice
915     //
916     //
917     WDF_TRI_STATE LockSupported;
918 
919     WDF_TRI_STATE EjectSupported;
920 
921     WDF_TRI_STATE Removable;
922 
923     WDF_TRI_STATE DockDevice;
924 
925     WDF_TRI_STATE UniqueID;
926 
927     WDF_TRI_STATE SilentInstall;
928 
929     WDF_TRI_STATE SurpriseRemovalOK;
930 
931     WDF_TRI_STATE HardwareDisabled;
932 
933     WDF_TRI_STATE NoDisplayInUI;
934 
935     //
936     // Default values of -1 indicate not to set this value
937     //
938     ULONG Address;
939 
940     ULONG UINumber;
941 
942 } WDF_DEVICE_PNP_CAPABILITIES_V1_9, *PWDF_DEVICE_PNP_CAPABILITIES_V1_9;
943 
944 typedef struct _WDF_DEVICE_POWER_CAPABILITIES_V1_9 {
945     //
946     // Size of the structure in bytes
947     //
948     ULONG Size;
949 
950     WDF_TRI_STATE DeviceD1;
951 
952     WDF_TRI_STATE DeviceD2;
953 
954     WDF_TRI_STATE WakeFromD0;
955 
956     WDF_TRI_STATE WakeFromD1;
957 
958     WDF_TRI_STATE WakeFromD2;
959 
960     WDF_TRI_STATE WakeFromD3;
961 
962     //
963     // Default value PowerDeviceMaximum indicates not to set this value
964     //
965     DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
966 
967     //
968     // Default value PowerDeviceMaximum, PowerSystemMaximum indicates not to
969     // set this value.
970     //
971     DEVICE_POWER_STATE DeviceWake;
972 
973     SYSTEM_POWER_STATE SystemWake;
974 
975     //
976     // Default values of -1 indicate not to set this value
977     //
978     ULONG D1Latency;
979 
980     ULONG D2Latency;
981 
982     ULONG D3Latency;
983 
984     //
985     // Ideal Dx state for the device to be put into when the machine moves into
986     // Sx and the device is not armed for wake.  By default, the default will be
987     // placed into D3.  If IdealDxStateForSx is lighter then
988     // DeviceState[Sx], then DeviceState[Sx] will be used as the Dx state.
989     //
990     DEVICE_POWER_STATE IdealDxStateForSx;
991 
992 } WDF_DEVICE_POWER_CAPABILITIES_V1_9, *PWDF_DEVICE_POWER_CAPABILITIES_V1_9;
993 
994 // End of versioning of structures for wdfDevice.h
995 
996 //
997 // Versioning of structures for wdfDmaEnabler.h
998 //
999 typedef struct _WDF_DMA_ENABLER_CONFIG_V1_9 {
1000     //
1001     // Size of this structure in bytes
1002     //
1003     ULONG                Size;
1004 
1005     //
1006     // One of the above WDF_DMA_PROFILES
1007     //
1008     WDF_DMA_PROFILE      Profile;
1009 
1010     //
1011     // Maximum DMA Transfer handled in bytes.
1012     //
1013     size_t               MaximumLength;
1014 
1015     //
1016     // The various DMA PnP/Power event callbacks
1017     //
1018     PFN_WDF_DMA_ENABLER_FILL                  EvtDmaEnablerFill;
1019 
1020     PFN_WDF_DMA_ENABLER_FLUSH                 EvtDmaEnablerFlush;
1021 
1022     PFN_WDF_DMA_ENABLER_DISABLE               EvtDmaEnablerDisable;
1023 
1024     PFN_WDF_DMA_ENABLER_ENABLE                EvtDmaEnablerEnable;
1025 
1026     PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_START  EvtDmaEnablerSelfManagedIoStart;
1027 
1028     PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_STOP   EvtDmaEnablerSelfManagedIoStop;
1029 
1030 } WDF_DMA_ENABLER_CONFIG_V1_9, *PWDF_DMA_ENABLER_CONFIG_V1_9;
1031 
1032 // End of versioning of structures for wdfDmaEnabler.h
1033 
1034 //
1035 // Versioning of structures for wdfDmaTransaction.h
1036 //
1037 // End of versioning of structures for wdfDmaTransaction.h
1038 
1039 //
1040 // Versioning of structures for wdfdpc.h
1041 //
1042 typedef struct _WDF_DPC_CONFIG_V1_9 {
1043     ULONG       Size;
1044 
1045     PFN_WDF_DPC EvtDpcFunc;
1046 
1047     //
1048     // If this is TRUE, the DPC will automatically serialize
1049     // with the event callback handlers of its Parent Object.
1050     //
1051     // Parent Object's callback constraints should be compatible
1052     // with the DPC (DISPATCH_LEVEL), or the request will fail.
1053     //
1054     BOOLEAN     AutomaticSerialization;
1055 
1056 } WDF_DPC_CONFIG_V1_9, *PWDF_DPC_CONFIG_V1_9;
1057 
1058 // End of versioning of structures for wdfdpc.h
1059 
1060 //
1061 // Versioning of structures for wdfdriver.h
1062 //
1063 typedef struct _WDF_DRIVER_CONFIG_V1_9 {
1064     //
1065     // Size of this structure in bytes
1066     //
1067     ULONG Size;
1068 
1069     //
1070     // Event callbacks
1071     //
1072     PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd;
1073 
1074     PFN_WDF_DRIVER_UNLOAD    EvtDriverUnload;
1075 
1076     //
1077     // Combination of WDF_DRIVER_INIT_FLAGS values
1078     //
1079     ULONG DriverInitFlags;
1080 
1081     //
1082     // Pool tag to use for all allocations made by the framework on behalf of
1083     // the client driver.
1084     //
1085     ULONG DriverPoolTag;
1086 
1087 } WDF_DRIVER_CONFIG_V1_9, *PWDF_DRIVER_CONFIG_V1_9;
1088 
1089 typedef struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9 {
1090     //
1091     // Size of the structure in bytes
1092     //
1093     ULONG Size;
1094 
1095     //
1096     // Major Version requested
1097     //
1098     ULONG MajorVersion;
1099 
1100     //
1101     // Minor Version requested
1102     //
1103     ULONG MinorVersion;
1104 
1105 } WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9, *PWDF_DRIVER_VERSION_AVAILABLE_PARAMS_V1_9;
1106 
1107 // End of versioning of structures for wdfdriver.h
1108 
1109 //
1110 // Versioning of structures for wdffdo.h
1111 //
1112 typedef struct _WDF_FDO_EVENT_CALLBACKS_V1_9 {
1113     //
1114     // Size of this structure in bytes
1115     //
1116     ULONG Size;
1117 
1118     PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS EvtDeviceFilterAddResourceRequirements;
1119 
1120     PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS EvtDeviceFilterRemoveResourceRequirements;
1121 
1122     PFN_WDF_DEVICE_REMOVE_ADDED_RESOURCES EvtDeviceRemoveAddedResources;
1123 
1124 } WDF_FDO_EVENT_CALLBACKS_V1_9, *PWDF_FDO_EVENT_CALLBACKS_V1_9;
1125 
1126 // End of versioning of structures for wdffdo.h
1127 
1128 //
1129 // Versioning of structures for wdffileobject.h
1130 //
1131 // End of versioning of structures for wdffileobject.h
1132 
1133 //
1134 // Versioning of structures for wdfGlobals.h
1135 //
1136 typedef struct _WDF_DRIVER_GLOBALS_V1_9 {
1137     // backpointer to the handle for this driver
1138     WDFDRIVER Driver;
1139 
1140     // Flags indicated by the driver during create
1141     ULONG DriverFlags;
1142 
1143     // Tag generated by WDF for the driver.  Tag used by allocations made on
1144     // behalf of the driver by WDF.
1145     ULONG DriverTag;
1146 
1147     CHAR DriverName[WDF_DRIVER_GLOBALS_NAME_LEN];
1148 
1149     // If TRUE, the stub code will capture DriverObject->DriverUnload and insert
1150     // itself first in the unload chain.  If FALSE, DriverUnload is left alone
1151     // (but WDF will not be notified of unload and there will be no auto cleanup).
1152     BOOLEAN DisplaceDriverUnload;
1153 
1154 } WDF_DRIVER_GLOBALS_V1_9, *PWDF_DRIVER_GLOBALS_V1_9;
1155 
1156 // End of versioning of structures for wdfGlobals.h
1157 
1158 //
1159 // Versioning of structures for wdfinstaller.h
1160 //
1161 // End of versioning of structures for wdfinstaller.h
1162 
1163 //
1164 // Versioning of structures for wdfinterrupt.h
1165 //
1166 //
1167 // Interrupt Configuration Structure
1168 //
1169 typedef struct _WDF_INTERRUPT_CONFIG_V1_9 {
1170     ULONG              Size;
1171 
1172     //
1173     // If this interrupt is to be synchronized with other interrupt(s) assigned
1174     // to the same WDFDEVICE, create a WDFSPINLOCK and assign it to each of the
1175     // WDFINTERRUPTs config.
1176     //
1177     WDFSPINLOCK        SpinLock;
1178 
1179     WDF_TRI_STATE      ShareVector;
1180 
1181     BOOLEAN            FloatingSave;
1182 
1183     //
1184     // Automatic Serialization of the DpcForIsr
1185     //
1186     BOOLEAN            AutomaticSerialization;
1187 
1188     // Event Callbacks
1189     PFN_WDF_INTERRUPT_ISR         EvtInterruptIsr;
1190 
1191     PFN_WDF_INTERRUPT_DPC         EvtInterruptDpc;
1192 
1193     PFN_WDF_INTERRUPT_ENABLE      EvtInterruptEnable;
1194 
1195     PFN_WDF_INTERRUPT_DISABLE     EvtInterruptDisable;
1196 
1197 } WDF_INTERRUPT_CONFIG_V1_9, *PWDF_INTERRUPT_CONFIG_V1_9;
1198 
1199 typedef struct _WDF_INTERRUPT_INFO_V1_9 {
1200     //
1201     // Size of this structure in bytes
1202     //
1203     ULONG                  Size;
1204 
1205     ULONG64                Reserved1;
1206 
1207     KAFFINITY              TargetProcessorSet;
1208 
1209     ULONG                  Reserved2;
1210 
1211     ULONG                  MessageNumber;
1212 
1213     ULONG                  Vector;
1214 
1215     KIRQL                  Irql;
1216 
1217     KINTERRUPT_MODE        Mode;
1218 
1219     WDF_INTERRUPT_POLARITY Polarity;
1220 
1221     BOOLEAN                MessageSignaled;
1222 
1223     // CM_SHARE_DISPOSITION
1224     UCHAR                  ShareDisposition;
1225 
1226     DECLSPEC_ALIGN(8) USHORT Group;
1227 
1228 } WDF_INTERRUPT_INFO_V1_9, *PWDF_INTERRUPT_INFO_V1_9;
1229 
1230 //
1231 // Interrupt Extended Policy Configuration Structure
1232 //
1233 typedef struct _WDF_INTERRUPT_EXTENDED_POLICY_V1_9 {
1234     //
1235     // Size of this structure in bytes
1236     //
1237     ULONG                   Size;
1238 
1239     WDF_INTERRUPT_POLICY    Policy;
1240 
1241     WDF_INTERRUPT_PRIORITY  Priority;
1242 
1243     GROUP_AFFINITY          TargetProcessorSetAndGroup;
1244 
1245 } WDF_INTERRUPT_EXTENDED_POLICY_V1_9, *PWDF_INTERRUPT_EXTENDED_POLICY_V1_9;
1246 
1247 // End of versioning of structures for wdfinterrupt.h
1248 
1249 //
1250 // Versioning of structures for wdfio.h
1251 //
1252 //
1253 // This is the structure used to configure an IoQueue and
1254 // register callback events to it.
1255 //
1256 //
1257 typedef struct _WDF_IO_QUEUE_CONFIG_V1_9 {
1258     ULONG                                       Size;
1259 
1260     WDF_IO_QUEUE_DISPATCH_TYPE                  DispatchType;
1261 
1262     WDF_TRI_STATE                               PowerManaged;
1263 
1264     BOOLEAN                                     AllowZeroLengthRequests;
1265 
1266     BOOLEAN                                     DefaultQueue;
1267 
1268     PFN_WDF_IO_QUEUE_IO_DEFAULT                 EvtIoDefault;
1269 
1270     PFN_WDF_IO_QUEUE_IO_READ                    EvtIoRead;
1271 
1272     PFN_WDF_IO_QUEUE_IO_WRITE                   EvtIoWrite;
1273 
1274     PFN_WDF_IO_QUEUE_IO_DEVICE_CONTROL          EvtIoDeviceControl;
1275 
1276     PFN_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL EvtIoInternalDeviceControl;
1277 
1278     PFN_WDF_IO_QUEUE_IO_STOP                    EvtIoStop;
1279 
1280     PFN_WDF_IO_QUEUE_IO_RESUME                  EvtIoResume;
1281 
1282     PFN_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE       EvtIoCanceledOnQueue;
1283 
1284     union {
1285         struct {
1286             ULONG NumberOfPresentedRequests;
1287 
1288         } Parallel;
1289 
1290     } Settings;
1291 
1292 } WDF_IO_QUEUE_CONFIG_V1_9, *PWDF_IO_QUEUE_CONFIG_V1_9;
1293 
1294 typedef struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9 {
1295     ULONG  Size;
1296 
1297     ULONG TotalForwardProgressRequests;
1298 
1299     //
1300     // Specify the type of the policy here.
1301     //
1302     WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY ForwardProgressReservedPolicy;
1303 
1304     //
1305     // Structure which contains the policy specific fields
1306     //
1307     WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY_SETTINGS ForwardProgressReservePolicySettings;
1308 
1309     //
1310     // Callback for reserved request given at initialization time
1311     //
1312     PFN_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST EvtIoAllocateResourcesForReservedRequest;
1313 
1314     //
1315     // Callback for reserved request given at run time
1316     //
1317     PFN_WDF_IO_ALLOCATE_REQUEST_RESOURCES  EvtIoAllocateRequestResources;
1318 
1319 } WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9, *PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V1_9;
1320 
1321 // End of versioning of structures for wdfio.h
1322 
1323 //
1324 // Versioning of structures for wdfIoTarget.h
1325 //
1326 typedef struct _WDF_IO_TARGET_OPEN_PARAMS_V1_9 {
1327     //
1328     // Size of this structure in bytes
1329     //
1330     ULONG Size;
1331 
1332     //
1333     // Indicates which fields of this structure are going to be used in
1334     // creating the WDFIOTARGET.
1335     //
1336     WDF_IO_TARGET_OPEN_TYPE Type;
1337 
1338     //
1339     // Notification when the target is being queried for removal.
1340     // If !NT_SUCCESS is returned, the query will fail and the target will
1341     // remain opened.
1342     //
1343     PFN_WDF_IO_TARGET_QUERY_REMOVE EvtIoTargetQueryRemove;
1344 
1345     //
1346     // The previous query remove has been canceled and the target can now be
1347     // reopened.
1348     //
1349     PFN_WDF_IO_TARGET_REMOVE_CANCELED EvtIoTargetRemoveCanceled;
1350 
1351     //
1352     // The query remove has succeeded and the target is now removed from the
1353     // system.
1354     //
1355     PFN_WDF_IO_TARGET_REMOVE_COMPLETE EvtIoTargetRemoveComplete;
1356 
1357     // ========== WdfIoTargetOpenUseExistingDevice begin ==========
1358     //
1359     // The device object to send requests to
1360     //
1361     PDEVICE_OBJECT TargetDeviceObject;
1362 
1363     //
1364     // File object representing the TargetDeviceObject.  The PFILE_OBJECT will
1365     // be passed as a parameter in all requests sent to the resulting
1366     // WDFIOTARGET.
1367     //
1368     PFILE_OBJECT TargetFileObject;
1369 
1370     // ========== WdfIoTargetOpenUseExistingDevice end ==========
1371     //
1372     // ========== WdfIoTargetOpenByName begin ==========
1373     //
1374     // Name of the device to open.
1375     //
1376     UNICODE_STRING TargetDeviceName;
1377 
1378     //
1379     // The access desired on the device being opened up, ie WDM FILE_XXX_ACCESS
1380     // such as FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, or
1381     // FILE_WRITE_ACCESS or you can use values such as GENERIC_READ,
1382     // GENERIC_WRITE, or GENERIC_ALL.
1383     //
1384     ACCESS_MASK DesiredAccess;
1385 
1386     //
1387     // Share access desired on the target being opened, ie WDM FILE_SHARE_XXX
1388     // values such as FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE.
1389     //
1390     // A zero value means exclusive access to the target.
1391     //
1392     ULONG ShareAccess;
1393 
1394     //
1395     // File  attributes, see ZwCreateFile in the DDK for a list of valid
1396     // values and their meaning.
1397     //
1398     ULONG FileAttributes;
1399 
1400     //
1401     // Create disposition, see ZwCreateFile in the DDK for a list of valid
1402     // values and their meaning.
1403     //
1404     ULONG CreateDisposition;
1405 
1406     //
1407     // Options for opening the device, see CreateOptions for ZwCreateFile in the
1408     // DDK for a list of valid values and their meaning.
1409     //
1410     ULONG CreateOptions;
1411 
1412     PVOID EaBuffer;
1413 
1414     ULONG EaBufferLength;
1415 
1416     PLONGLONG AllocationSize;
1417 
1418     // ========== WdfIoTargetOpenByName end ==========
1419     //
1420     //
1421     // On return for a create by name, this will contain one of the following
1422     // values:  FILE_CREATED, FILE_OPENED, FILE_OVERWRITTEN, FILE_SUPERSEDED,
1423     // FILE_EXISTS, FILE_DOES_NOT_EXIST
1424     //
1425     ULONG FileInformation;
1426 
1427 } WDF_IO_TARGET_OPEN_PARAMS_V1_9, *PWDF_IO_TARGET_OPEN_PARAMS_V1_9;
1428 
1429 // End of versioning of structures for wdfIoTarget.h
1430 
1431 //
1432 // Versioning of structures for wdfMemory.h
1433 //
1434 typedef struct _WDFMEMORY_OFFSET_V1_9 {
1435     //
1436     // Offset into the WDFMEMORY that the operation should start at.
1437     //
1438     size_t BufferOffset;
1439 
1440     //
1441     // Number of bytes that the operation should access.  If 0, the entire
1442     // length of the WDFMEMORY buffer will be used in the operation or ignored
1443     // depending on the API.
1444     //
1445     size_t BufferLength;
1446 
1447 } WDFMEMORY_OFFSET_V1_9, *PWDFMEMORY_OFFSET_V1_9;
1448 
1449 typedef struct _WDF_MEMORY_DESCRIPTOR_V1_9 {
1450     WDF_MEMORY_DESCRIPTOR_TYPE Type;
1451 
1452     union {
1453         struct {
1454             PVOID Buffer;
1455 
1456             ULONG Length;
1457 
1458         } BufferType;
1459 
1460         struct {
1461             PMDL Mdl;
1462 
1463             ULONG BufferLength;
1464 
1465         } MdlType;
1466 
1467         struct {
1468             WDFMEMORY Memory;
1469 
1470             PWDFMEMORY_OFFSET_V1_9 Offsets;
1471 
1472         } HandleType;
1473 
1474     } u;
1475 
1476 } WDF_MEMORY_DESCRIPTOR_V1_9, *PWDF_MEMORY_DESCRIPTOR_V1_9;
1477 
1478 // End of versioning of structures for wdfMemory.h
1479 
1480 //
1481 // Versioning of structures for wdfMiniport.h
1482 //
1483 // End of versioning of structures for wdfMiniport.h
1484 
1485 //
1486 // Versioning of structures for wdfObject.h
1487 //
1488 typedef struct _WDF_OBJECT_ATTRIBUTES_V1_9 {
1489     //
1490     // Size in bytes of this structure
1491     //
1492     ULONG Size;
1493 
1494     //
1495     // Function to call when the object is deleted
1496     //
1497     PFN_WDF_OBJECT_CONTEXT_CLEANUP EvtCleanupCallback;
1498 
1499     //
1500     // Function to call when the objects memory is destroyed when the
1501     // the last reference count goes to zero
1502     //
1503     PFN_WDF_OBJECT_CONTEXT_DESTROY EvtDestroyCallback;
1504 
1505     //
1506     // Execution level constraints for Object
1507     //
1508     WDF_EXECUTION_LEVEL ExecutionLevel;
1509 
1510     //
1511     // Synchronization level constraint for Object
1512     //
1513     WDF_SYNCHRONIZATION_SCOPE SynchronizationScope;
1514 
1515     //
1516     // Optional Parent Object
1517     //
1518     WDFOBJECT ParentObject;
1519 
1520     //
1521     // Overrides the size of the context allocated as specified by
1522     // ContextTypeInfo->ContextSize
1523     //
1524     size_t ContextSizeOverride;
1525 
1526     //
1527     // Pointer to the type information to be associated with the object
1528     //
1529     PCWDF_OBJECT_CONTEXT_TYPE_INFO_V1_9 ContextTypeInfo;
1530 
1531 } WDF_OBJECT_ATTRIBUTES_V1_9, *PWDF_OBJECT_ATTRIBUTES_V1_9;
1532 
1533 //
1534 // Since C does not have strong type checking we must invent our own
1535 //
1536 typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V1_9 {
1537     //
1538     // The size of this structure in bytes
1539     //
1540     ULONG Size;
1541 
1542     //
1543     // String representation of the context's type name, i.e. "DEVICE_CONTEXT"
1544     //
1545     PCHAR ContextName;
1546 
1547     //
1548     // The size of the context in bytes.  This will be the size of the context
1549     // associated with the handle unless
1550     // WDF_OBJECT_ATTRIBUTES::ContextSizeOverride is specified.
1551     //
1552     size_t ContextSize;
1553 
1554     //
1555     // If NULL, this structure is the unique type identifier for the context
1556     // type.  If != NULL, the UniqueType pointer value is the unique type id
1557     // for the context type.
1558     //
1559     PCWDF_OBJECT_CONTEXT_TYPE_INFO_V1_9 UniqueType;
1560 
1561     //
1562     // Function pointer to retrieve the context type information structure
1563     // pointer from the provider of the context type.  This function is invoked
1564     // by the client driver's entry point by the KMDF stub after all class
1565     // drivers are loaded and before DriverEntry is invoked.
1566     //
1567     PFN_GET_UNIQUE_CONTEXT_TYPE EvtDriverGetUniqueContextType;
1568 
1569 } WDF_OBJECT_CONTEXT_TYPE_INFO_V1_9, *PWDF_OBJECT_CONTEXT_TYPE_INFO_V1_9;
1570 
1571 // End of versioning of structures for wdfObject.h
1572 
1573 //
1574 // Versioning of structures for wdfpdo.h
1575 //
1576 typedef struct _WDF_PDO_EVENT_CALLBACKS_V1_9 {
1577     //
1578     // The size of this structure in bytes
1579     //
1580     ULONG Size;
1581 
1582     //
1583     // Called in response to IRP_MN_QUERY_RESOURCES
1584     //
1585     PFN_WDF_DEVICE_RESOURCES_QUERY EvtDeviceResourcesQuery;
1586 
1587     //
1588     // Called in response to IRP_MN_QUERY_RESOURCE_REQUIREMENTS
1589     //
1590     PFN_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY EvtDeviceResourceRequirementsQuery;
1591 
1592     //
1593     // Called in response to IRP_MN_EJECT
1594     //
1595     PFN_WDF_DEVICE_EJECT EvtDeviceEject;
1596 
1597     //
1598     // Called in response to IRP_MN_SET_LOCK
1599     //
1600     PFN_WDF_DEVICE_SET_LOCK EvtDeviceSetLock;
1601 
1602     //
1603     // Called in response to the power policy owner sending a wait wake to the
1604     // PDO.  Bus generic arming shoulding occur here.
1605     //
1606     PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS       EvtDeviceEnableWakeAtBus;
1607 
1608     //
1609     // Called in response to the power policy owner sending a wait wake to the
1610     // PDO.  Bus generic disarming shoulding occur here.
1611     //
1612     PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS      EvtDeviceDisableWakeAtBus;
1613 
1614 } WDF_PDO_EVENT_CALLBACKS_V1_9, *PWDF_PDO_EVENT_CALLBACKS_V1_9;
1615 
1616 // End of versioning of structures for wdfpdo.h
1617 
1618 //
1619 // Versioning of structures for wdfpool.h
1620 //
1621 // End of versioning of structures for wdfpool.h
1622 
1623 //
1624 // Versioning of structures for wdfqueryinterface.h
1625 //
1626 typedef struct _WDF_QUERY_INTERFACE_CONFIG_V1_9 {
1627     //
1628     // Size of this structure in bytes.
1629     //
1630     ULONG Size;
1631 
1632     //
1633     // Interface to be returned to the caller.  Optional if BehaviorType is set
1634     // to WdfQueryInterfaceTypePassThrough or ImportInterface is set to TRUE.
1635     //
1636     PINTERFACE Interface;
1637 
1638     //
1639     // The GUID identifying the interface
1640     //
1641     CONST GUID * InterfaceType;
1642 
1643     //
1644     // Valid only for PDOs.  The framework will allocate a new request and
1645     // forward it down the parent's device stack.
1646     //
1647     BOOLEAN SendQueryToParentStack;
1648 
1649     //
1650     // Driver supplied callback which is called after some basic interface
1651     // validation has been performed (size, version, and guid checking).  This
1652     // is an optional parameter and may be NULL unless ImportInterface is
1653     // specified.
1654     //
1655     // If the callback returns !NT_SUCCESS, this error will be returned to the
1656     // caller and the query interface will fail.
1657     //
1658     // In this callback, the caller is free to modify the ExposedInterface in
1659     // any manner of its choosing.  For instance, the callback may change any
1660     // field in the interface.  The callback may also alloate a dynamic context
1661     // to be associated with the interface; the InterfaceReference and
1662     // InterfaceDereference functions may also be overridden.
1663     //
1664     // If ImportInterface is set to TRUE, then this is a required field and the
1665     // callback must initialize the interface (the framework will leave the
1666     // ExposedInterface buffer exactly as it received it) since the framework
1667     // has no way of knowing which fields to fill in and which to leave alone.
1668     //
1669     PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST EvtDeviceProcessQueryInterfaceRequest;
1670 
1671     //
1672     // If TRUE, the interface provided by the caller contains data that the
1673     // driver is interested in.  By setting to this field to TRUE, the
1674     // EvtDeviceProcessQueryInterfaceRequest callback must initialize the
1675     // ExposedInterface.
1676     //
1677     // If FALSE, the entire ExposedInterface is initialized through a memory
1678     // copy before the EvtDeviceProcessQueryInterfaceRequest is called.
1679     //
1680     BOOLEAN ImportInterface;
1681 
1682 } WDF_QUERY_INTERFACE_CONFIG_V1_9, *PWDF_QUERY_INTERFACE_CONFIG_V1_9;
1683 
1684 // End of versioning of structures for wdfqueryinterface.h
1685 
1686 //
1687 // Versioning of structures for wdfregistry.h
1688 //
1689 // End of versioning of structures for wdfregistry.h
1690 
1691 //
1692 // Versioning of structures for wdfrequest.h
1693 //
1694 //
1695 // This parameters structure allows general access to a requests parameters
1696 //
1697 typedef struct _WDF_REQUEST_PARAMETERS_V1_9 {
1698     USHORT Size;
1699 
1700     UCHAR MinorFunction;
1701 
1702     WDF_REQUEST_TYPE Type;
1703 
1704     //
1705     // The following user parameters are based on the service that is being
1706     // invoked.  Drivers and file systems can determine which set to use based
1707     // on the above major and minor function codes.
1708     //
1709     union {
1710         //
1711         // System service parameters for:  Create
1712         //
1713         //
1714         struct {
1715             PIO_SECURITY_CONTEXT SecurityContext;
1716 
1717             ULONG Options;
1718 
1719             USHORT POINTER_ALIGNMENT FileAttributes;
1720 
1721             USHORT ShareAccess;
1722 
1723             ULONG POINTER_ALIGNMENT EaLength;
1724 
1725         } Create;
1726 
1727         //
1728         // System service parameters for:  Read
1729         //
1730         //
1731         struct {
1732             size_t Length;
1733 
1734             ULONG POINTER_ALIGNMENT Key;
1735 
1736             LONGLONG DeviceOffset;
1737 
1738         } Read;
1739 
1740         //
1741         // System service parameters for:  Write
1742         //
1743         //
1744         struct {
1745             size_t Length;
1746 
1747             ULONG POINTER_ALIGNMENT Key;
1748 
1749             LONGLONG DeviceOffset;
1750 
1751         } Write;
1752 
1753         //
1754         // System service parameters for:  Device Control
1755         //
1756         // Note that the user's output buffer is stored in the UserBuffer field
1757         // and the user's input buffer is stored in the SystemBuffer field.
1758         //
1759         //
1760         struct {
1761             size_t OutputBufferLength;
1762 
1763             size_t POINTER_ALIGNMENT InputBufferLength;
1764 
1765             ULONG POINTER_ALIGNMENT IoControlCode;
1766 
1767             PVOID Type3InputBuffer;
1768 
1769         } DeviceIoControl;
1770 
1771         struct {
1772             PVOID Arg1;
1773 
1774             PVOID  Arg2;
1775 
1776             ULONG POINTER_ALIGNMENT IoControlCode;
1777 
1778             PVOID Arg4;
1779 
1780         } Others;
1781 
1782     } Parameters;
1783 
1784 } WDF_REQUEST_PARAMETERS_V1_9, *PWDF_REQUEST_PARAMETERS_V1_9;
1785 
1786 typedef struct _WDF_REQUEST_COMPLETION_PARAMS_V1_9 {
1787     //
1788     // Size of the structure in bytes
1789     //
1790     ULONG Size;
1791 
1792     WDF_REQUEST_TYPE Type;
1793 
1794     IO_STATUS_BLOCK IoStatus;
1795 
1796     union {
1797         struct {
1798             WDFMEMORY Buffer;
1799 
1800             size_t Length;
1801 
1802             size_t Offset;
1803 
1804         } Write;
1805 
1806         struct {
1807             WDFMEMORY Buffer;
1808 
1809             size_t Length;
1810 
1811             size_t Offset;
1812 
1813         } Read;
1814 
1815         struct {
1816             ULONG IoControlCode;
1817 
1818             struct {
1819                 WDFMEMORY Buffer;
1820 
1821                 size_t Offset;
1822 
1823             } Input;
1824 
1825             struct {
1826                 WDFMEMORY Buffer;
1827 
1828                 size_t Offset;
1829 
1830                 size_t Length;
1831 
1832             } Output;
1833 
1834         } Ioctl;
1835 
1836         struct {
1837             union {
1838                 PVOID Ptr;
1839 
1840                 ULONG_PTR Value;
1841 
1842             } Argument1;
1843 
1844             union {
1845                 PVOID Ptr;
1846 
1847                 ULONG_PTR Value;
1848 
1849             } Argument2;
1850 
1851             union {
1852                 PVOID Ptr;
1853 
1854                 ULONG_PTR Value;
1855 
1856             } Argument3;
1857 
1858             union {
1859                 PVOID Ptr;
1860 
1861                 ULONG_PTR Value;
1862 
1863             } Argument4;
1864 
1865         } Others;
1866 
1867         struct {
1868             PWDF_USB_REQUEST_COMPLETION_PARAMS_V1_9 Completion;
1869 
1870         } Usb;
1871 
1872     } Parameters;
1873 
1874 } WDF_REQUEST_COMPLETION_PARAMS_V1_9, *PWDF_REQUEST_COMPLETION_PARAMS_V1_9;
1875 
1876 typedef struct _WDF_REQUEST_REUSE_PARAMS_V1_9 {
1877     //
1878     // Size of this structure in bytes
1879     //
1880     ULONG Size;
1881 
1882     //
1883     // Bit field combination of WDF_REQUEST_REUSE_Xxx values
1884     //
1885     ULONG Flags;
1886 
1887     //
1888     // The new status of the request.
1889     //
1890     NTSTATUS Status;
1891 
1892     //
1893     // New PIRP  to be contained in the WDFREQUEST.   Setting a new PIRP value
1894     // is only valid for WDFREQUESTs created by WdfRequestCreateFromIrp where
1895     // RequestFreesIrp == FALSE.  No other WDFREQUESTs (presented by the
1896     // I/O queue for instance) may have their IRPs changed.
1897     //
1898     PIRP NewIrp;
1899 
1900 } WDF_REQUEST_REUSE_PARAMS_V1_9, *PWDF_REQUEST_REUSE_PARAMS_V1_9;
1901 
1902 typedef struct _WDF_REQUEST_SEND_OPTIONS_V1_9 {
1903     //
1904     // Size of the structure in bytes
1905     //
1906     ULONG Size;
1907 
1908     //
1909     // Bit field combination of values from the WDF_REQUEST_SEND_OPTIONS_FLAGS
1910     // enumeration
1911     //
1912     ULONG Flags;
1913 
1914     //
1915     // Valid when WDF_REQUEST_SEND_OPTION_TIMEOUT is set
1916     //
1917     LONGLONG Timeout;
1918 
1919 } WDF_REQUEST_SEND_OPTIONS_V1_9, *PWDF_REQUEST_SEND_OPTIONS_V1_9;
1920 
1921 typedef struct _WDF_REQUEST_FORWARD_OPTIONS_V1_9 {
1922     //
1923     // Size of the structure in bytes
1924     //
1925     ULONG Size;
1926 
1927     //
1928     // Bit field combination of values from the WDF_REQUEST_FORWARD_OPTIONS_FLAGS
1929     // enumeration
1930     //
1931     ULONG Flags;
1932 
1933 } WDF_REQUEST_FORWARD_OPTIONS_V1_9, *PWDF_REQUEST_FORWARD_OPTIONS_V1_9;
1934 
1935 // End of versioning of structures for wdfrequest.h
1936 
1937 //
1938 // Versioning of structures for wdfresource.h
1939 //
1940 // End of versioning of structures for wdfresource.h
1941 
1942 //
1943 // Versioning of structures for wdfstring.h
1944 //
1945 // End of versioning of structures for wdfstring.h
1946 
1947 //
1948 // Versioning of structures for wdfsync.h
1949 //
1950 // End of versioning of structures for wdfsync.h
1951 
1952 //
1953 // Versioning of structures for wdftimer.h
1954 //
1955 typedef struct _WDF_TIMER_CONFIG_V1_9 {
1956     ULONG Size;
1957 
1958     PFN_WDF_TIMER EvtTimerFunc;
1959 
1960     ULONG Period;
1961 
1962     //
1963     // If this is TRUE, the Timer will automatically serialize
1964     // with the event callback handlers of its Parent Object.
1965     //
1966     // Parent Object's callback constraints should be compatible
1967     // with the Timer DPC (DISPATCH_LEVEL), or the request will fail.
1968     //
1969     BOOLEAN AutomaticSerialization;
1970 
1971     //
1972     // Optional tolerance for the timer in milliseconds.
1973     //
1974     ULONG TolerableDelay;
1975 
1976 } WDF_TIMER_CONFIG_V1_9, *PWDF_TIMER_CONFIG_V1_9;
1977 
1978 // End of versioning of structures for wdftimer.h
1979 
1980 //
1981 // Versioning of structures for wdftypes.h
1982 //
1983 // End of versioning of structures for wdftypes.h
1984 
1985 //
1986 // Versioning of structures for wdfUsb.h
1987 //
1988 typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS_V1_9 {
1989     USBD_STATUS UsbdStatus;
1990 
1991     WDF_USB_REQUEST_TYPE Type;
1992 
1993     union {
1994         struct {
1995             WDFMEMORY Buffer;
1996 
1997             USHORT LangID;
1998 
1999             UCHAR StringIndex;
2000 
2001             //
2002             // If STATUS_BUFFER_OVERFLOW is returned, this field will contain the
2003             // number of bytes required to retrieve the entire string.
2004             //
2005             UCHAR RequiredSize;
2006 
2007         } DeviceString;
2008 
2009         struct {
2010             WDFMEMORY Buffer;
2011 
2012             WDF_USB_CONTROL_SETUP_PACKET SetupPacket;
2013 
2014             ULONG Length;
2015 
2016         } DeviceControlTransfer;
2017 
2018         struct {
2019             WDFMEMORY Buffer;
2020 
2021         } DeviceUrb;
2022 
2023         struct {
2024             WDFMEMORY Buffer;
2025 
2026             size_t Length;
2027 
2028             size_t Offset;
2029 
2030         } PipeWrite;
2031 
2032         struct {
2033             WDFMEMORY Buffer;
2034 
2035             size_t Length;
2036 
2037             size_t Offset;
2038 
2039         } PipeRead;
2040 
2041         struct {
2042             WDFMEMORY Buffer;
2043 
2044         } PipeUrb;
2045 
2046     } Parameters;
2047 
2048 } WDF_USB_REQUEST_COMPLETION_PARAMS_V1_9, *PWDF_USB_REQUEST_COMPLETION_PARAMS_V1_9;
2049 
2050 typedef struct _WDF_USB_CONTINUOUS_READER_CONFIG_V1_9 {
2051     //
2052     // Size of the string in bytes
2053     //
2054     ULONG Size;
2055 
2056     //
2057     // Number of bytes to send ask for from the usb device.
2058     //
2059     size_t TransferLength;
2060 
2061     //
2062     // Number of bytes to allocate before the requested transfer length
2063     //
2064     size_t HeaderLength;
2065 
2066     //
2067     // Number of bytes to allocate after the requested transfer length
2068     //
2069     size_t TrailerLength;
2070 
2071     //
2072     // Number of reads to send to the device at once.  If zero is specified, the
2073     // default will be used.
2074     //
2075     UCHAR NumPendingReads;
2076 
2077     //
2078     // Optional attributes to apply to each WDFMEMORY allocated for each read
2079     //
2080     PWDF_OBJECT_ATTRIBUTES_V1_9 BufferAttributes;
2081 
2082     //
2083     // Event callback invoked when a read is completed
2084     //
2085     PFN_WDF_USB_READER_COMPLETION_ROUTINE EvtUsbTargetPipeReadComplete;
2086 
2087     //
2088     // Context to be passed to EvtUsbTargetPipeReadComplete
2089     //
2090     WDFCONTEXT EvtUsbTargetPipeReadCompleteContext;
2091 
2092     //
2093     // Event callback invoked when a reader fails.  If TRUE is returned, the
2094     // readers are restarted.
2095     //
2096     PFN_WDF_USB_READERS_FAILED EvtUsbTargetPipeReadersFailed;
2097 
2098 } WDF_USB_CONTINUOUS_READER_CONFIG_V1_9, *PWDF_USB_CONTINUOUS_READER_CONFIG_V1_9;
2099 
2100 typedef struct _WDF_USB_DEVICE_INFORMATION_V1_9 {
2101     //
2102     // Size of this structure in bytes
2103     //
2104     ULONG Size;
2105 
2106     //
2107     // USBD version information
2108     //
2109     USBD_VERSION_INFORMATION UsbdVersionInformation;
2110 
2111     //
2112     // Usb controller port capabilities
2113     //
2114     ULONG HcdPortCapabilities;
2115 
2116     //
2117     // Bitfield of WDF_USB_DEVICE_TRAITS values
2118     //
2119     ULONG Traits;
2120 
2121 } WDF_USB_DEVICE_INFORMATION_V1_9, *PWDF_USB_DEVICE_INFORMATION_V1_9;
2122 
2123 typedef struct _WDF_USB_INTERFACE_SETTING_PAIR_V1_9 {
2124     //
2125     // Interface to select
2126     //
2127     WDFUSBINTERFACE UsbInterface;
2128 
2129     //
2130     // Setting to select on UsbInterface
2131     //
2132     UCHAR SettingIndex;
2133 
2134 } WDF_USB_INTERFACE_SETTING_PAIR_V1_9, *PWDF_USB_INTERFACE_SETTING_PAIR_V1_9;
2135 
2136 typedef struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9 {
2137     //
2138     // Size of the structure in bytes
2139     //
2140     ULONG Size;
2141 
2142     //
2143     // Type of select config, one of WdfUsbTargetDeviceSelectConfigType values
2144     //
2145     WdfUsbTargetDeviceSelectConfigType Type;
2146 
2147     union {
2148         struct {
2149             //
2150             // Configuration descriptor to use
2151             //
2152             PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
2153 
2154             //
2155             // Array of interface descriptors pointers.
2156             //
2157             PUSB_INTERFACE_DESCRIPTOR * InterfaceDescriptors;
2158 
2159             //
2160             // Number of elements in the InterfaceDescrtiptors pointer array.
2161             //
2162             ULONG NumInterfaceDescriptors;
2163 
2164         } Descriptor;
2165 
2166         struct {
2167             //
2168             // Preallocated select config URB formatted by the caller.
2169             // Will be used, as supplied without modification, as the select
2170             // config request.
2171             //
2172             PURB Urb;
2173 
2174         } Urb;
2175 
2176         struct {
2177             //
2178             // Number of pipes configured on the single after.  This value is
2179             // returned to the caller after a succssful call.
2180             //
2181             UCHAR   NumberConfiguredPipes;
2182 
2183             //
2184             // The interface which was configred.  This value is returned to the
2185             // caller after a successful call.
2186             //
2187             WDFUSBINTERFACE ConfiguredUsbInterface;
2188 
2189         } SingleInterface;
2190 
2191         struct {
2192             //
2193             // Number of interface pairs in the Pairs array
2194             //
2195             UCHAR NumberInterfaces;
2196 
2197             //
2198             // Array of interface + settings
2199             //
2200             PWDF_USB_INTERFACE_SETTING_PAIR_V1_9 Pairs;
2201 
2202             //
2203             // Number of interfaces which were configured after a successful call
2204             //
2205             UCHAR NumberOfConfiguredInterfaces;
2206 
2207         } MultiInterface;
2208 
2209     } Types;
2210 
2211 } WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9, *PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V1_9;
2212 
2213 typedef struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9 {
2214     //
2215     // Size of this data structure in bytes
2216     //
2217     ULONG Size;
2218 
2219     //
2220     // Type of select interface as indicated by one of the
2221     // WdfUsbTargetDeviceSelectSettingType values.
2222     //
2223     WdfUsbTargetDeviceSelectSettingType Type;
2224 
2225     union {
2226         struct {
2227             //
2228             // Interface descriptor that will be used in the interface selection
2229             //
2230             PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
2231 
2232         } Descriptor;
2233 
2234         struct {
2235             //
2236             // The setting index of the WDFUSBINTERFACE to use
2237             //
2238             UCHAR SettingIndex;
2239 
2240         } Interface;
2241 
2242         struct {
2243             //
2244             // Preformatted select interface URB which will be used in the
2245             // select interface request.
2246             //
2247             PURB Urb;
2248 
2249         } Urb;
2250 
2251     } Types;
2252 
2253 } WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9, *PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V1_9;
2254 
2255 typedef struct _WDF_USB_PIPE_INFORMATION_V1_9 {
2256     //
2257     // Size of the structure in bytes
2258     //
2259     ULONG Size;
2260 
2261     //
2262     // Maximum packet size this device is capable of
2263     //
2264     ULONG MaximumPacketSize;
2265 
2266     //
2267     // Raw endpoint address of the device as described by its descriptor
2268     //
2269     UCHAR EndpointAddress;
2270 
2271     //
2272     // Polling interval
2273     //
2274     UCHAR Interval;
2275 
2276     //
2277     // Which alternate setting this structure is relevant for
2278     //
2279     UCHAR SettingIndex;
2280 
2281     //
2282     // The type of the pipe
2283     WDF_USB_PIPE_TYPE PipeType;
2284 
2285     //
2286     // Maximum size of one transfer which should be sent to the host controller
2287     //
2288     ULONG  MaximumTransferSize;
2289 
2290 } WDF_USB_PIPE_INFORMATION_V1_9, *PWDF_USB_PIPE_INFORMATION_V1_9;
2291 
2292 // End of versioning of structures for wdfUsb.h
2293 
2294 //
2295 // Versioning of structures for wdfverifier.h
2296 //
2297 // End of versioning of structures for wdfverifier.h
2298 
2299 //
2300 // Versioning of structures for wdfWMI.h
2301 //
2302 typedef struct _WDF_WMI_PROVIDER_CONFIG_V1_9 {
2303     //
2304     // Size of this structure in bytes
2305     //
2306     ULONG Size;
2307 
2308     //
2309     // The GUID being registered
2310     //
2311     GUID Guid;
2312 
2313     //
2314     // Combination of values from the enum WDF_WMI_PROVIDER_FLAGS
2315     //
2316     ULONG Flags;
2317 
2318     //
2319     // Minimum expected buffer size for query and set instance requests.
2320     // Ignored if WdfWmiProviderEventOnly is set in Flags.
2321     //
2322     ULONG MinInstanceBufferSize;
2323 
2324     //
2325     // Callback when caller is opening a provider which ha been marked as
2326     // expensive or when a caller is interested in events.
2327     //
2328     PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL EvtWmiProviderFunctionControl;
2329 
2330 } WDF_WMI_PROVIDER_CONFIG_V1_9, *PWDF_WMI_PROVIDER_CONFIG_V1_9;
2331 
2332 typedef struct _WDF_WMI_INSTANCE_CONFIG_V1_9 {
2333     //
2334     // Size of the structure in bytes
2335     //
2336     ULONG Size;
2337 
2338     //
2339     // Optional parameter.  If NULL, ProviderConfig must be set to a valid pointer
2340     // value.   If specified, indicates the provider to create an instance for.
2341     //
2342     WDFWMIPROVIDER Provider;
2343 
2344     //
2345     // Optional parameter.  If NULL, Provider must be set to a valid handle
2346     // value.  If specifeid, indicates the configuration for a provider to be
2347     // created and for this instance to be associated with.
2348     //
2349     PWDF_WMI_PROVIDER_CONFIG_V1_9 ProviderConfig;
2350 
2351     //
2352     // If the Provider is configured as read only and this field is set to TRUE,
2353     // the EvtWmiInstanceQueryInstance is ignored and WDF will blindly copy the
2354     // context associated with this instance (using RtlCopyMemory, with no locks
2355     // held) into the query buffer.
2356     //
2357     BOOLEAN UseContextForQuery;
2358 
2359     //
2360     // If TRUE, the instance will be registered as well as created.
2361     //
2362     BOOLEAN Register;
2363 
2364     //
2365     // Callback when caller wants to query the entire data item's buffer.
2366     //
2367     PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE EvtWmiInstanceQueryInstance;
2368 
2369     //
2370     // Callback when caller wants to set the entire data item's buffer.
2371     //
2372     PFN_WDF_WMI_INSTANCE_SET_INSTANCE EvtWmiInstanceSetInstance;
2373 
2374     //
2375     // Callback when caller wants to set a single field in the data item's buffer
2376     //
2377     PFN_WDF_WMI_INSTANCE_SET_ITEM EvtWmiInstanceSetItem;
2378 
2379     //
2380     // Callback when caller wants to execute a method on the data item.
2381     //
2382     PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD EvtWmiInstanceExecuteMethod;
2383 
2384 } WDF_WMI_INSTANCE_CONFIG_V1_9, *PWDF_WMI_INSTANCE_CONFIG_V1_9;
2385 
2386 // End of versioning of structures for wdfWMI.h
2387 
2388 //
2389 // Versioning of structures for wdfworkitem.h
2390 //
2391 typedef struct _WDF_WORKITEM_CONFIG_V1_9 {
2392     ULONG Size;
2393 
2394     PFN_WDF_WORKITEM EvtWorkItemFunc;
2395 
2396     //
2397     // If this is TRUE, the workitem will automatically serialize
2398     // with the event callback handlers of its Parent Object.
2399     //
2400     // Parent Object's callback constraints should be compatible
2401     // with the work item (PASSIVE_LEVEL), or the request will fail.
2402     //
2403     BOOLEAN AutomaticSerialization;
2404 
2405 } WDF_WORKITEM_CONFIG_V1_9, *PWDF_WORKITEM_CONFIG_V1_9;
2406 
2407 // End of versioning of structures for wdfworkitem.h
2408 
2409 
2410 #endif // _WDF_V1_9_TYPES_H_
2411