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