1 // 2 // Copyright (c) Microsoft. All rights reserved. 3 // 4 #ifndef _WDF_V2_0_TYPES_H_ 5 #define _WDF_V2_0_TYPES_H_ 6 7 8 typedef enum _WDFFUNCENUM_V2_0 { 9 WdfFunctionTableNumEntries_V2_0 = 248, 10 } WDFFUNCENUM_V2_0; 11 12 typedef struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA_V2_0 *PWDF_POWER_ROUTINE_TIMED_OUT_DATA_V2_0; 13 typedef const struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA_V2_0 *PCWDF_POWER_ROUTINE_TIMED_OUT_DATA_V2_0; 14 typedef struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0 *PWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0; 15 typedef const struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0 *PCWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0; 16 typedef struct _WDF_QUEUE_FATAL_ERROR_DATA_V2_0 *PWDF_QUEUE_FATAL_ERROR_DATA_V2_0; 17 typedef const struct _WDF_QUEUE_FATAL_ERROR_DATA_V2_0 *PCWDF_QUEUE_FATAL_ERROR_DATA_V2_0; 18 typedef struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0 *PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0; 19 typedef const struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0 *PCWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0; 20 typedef struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0 *PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0; 21 typedef const struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0 *PCWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0; 22 typedef struct _WDF_CHILD_RETRIEVE_INFO_V2_0 *PWDF_CHILD_RETRIEVE_INFO_V2_0; 23 typedef const struct _WDF_CHILD_RETRIEVE_INFO_V2_0 *PCWDF_CHILD_RETRIEVE_INFO_V2_0; 24 typedef struct _WDF_CHILD_LIST_CONFIG_V2_0 *PWDF_CHILD_LIST_CONFIG_V2_0; 25 typedef const struct _WDF_CHILD_LIST_CONFIG_V2_0 *PCWDF_CHILD_LIST_CONFIG_V2_0; 26 typedef struct _WDF_CHILD_LIST_ITERATOR_V2_0 *PWDF_CHILD_LIST_ITERATOR_V2_0; 27 typedef const struct _WDF_CHILD_LIST_ITERATOR_V2_0 *PCWDF_CHILD_LIST_ITERATOR_V2_0; 28 typedef struct _WDF_COMMON_BUFFER_CONFIG_V2_0 *PWDF_COMMON_BUFFER_CONFIG_V2_0; 29 typedef const struct _WDF_COMMON_BUFFER_CONFIG_V2_0 *PCWDF_COMMON_BUFFER_CONFIG_V2_0; 30 typedef struct _WDFCX_FILEOBJECT_CONFIG_V2_0 *PWDFCX_FILEOBJECT_CONFIG_V2_0; 31 typedef const struct _WDFCX_FILEOBJECT_CONFIG_V2_0 *PCWDFCX_FILEOBJECT_CONFIG_V2_0; 32 typedef struct _WDF_CLASS_EXTENSION_DESCRIPTOR_V2_0 *PWDF_CLASS_EXTENSION_DESCRIPTOR_V2_0; 33 typedef const struct _WDF_CLASS_EXTENSION_DESCRIPTOR_V2_0 *PCWDF_CLASS_EXTENSION_DESCRIPTOR_V2_0; 34 typedef struct _WDF_CLASS_VERSION_V2_0 *PWDF_CLASS_VERSION_V2_0; 35 typedef const struct _WDF_CLASS_VERSION_V2_0 *PCWDF_CLASS_VERSION_V2_0; 36 typedef struct _WDF_CLASS_BIND_INFO_V2_0 *PWDF_CLASS_BIND_INFO_V2_0; 37 typedef const struct _WDF_CLASS_BIND_INFO_V2_0 *PCWDF_CLASS_BIND_INFO_V2_0; 38 typedef struct _WDF_CLASS_LIBRARY_INFO_V2_0 *PWDF_CLASS_LIBRARY_INFO_V2_0; 39 typedef const struct _WDF_CLASS_LIBRARY_INFO_V2_0 *PCWDF_CLASS_LIBRARY_INFO_V2_0; 40 typedef struct _WDF_FILEOBJECT_CONFIG_V2_0 *PWDF_FILEOBJECT_CONFIG_V2_0; 41 typedef const struct _WDF_FILEOBJECT_CONFIG_V2_0 *PCWDF_FILEOBJECT_CONFIG_V2_0; 42 typedef struct _WDF_DEVICE_PNP_NOTIFICATION_DATA_V2_0 *PWDF_DEVICE_PNP_NOTIFICATION_DATA_V2_0; 43 typedef const struct _WDF_DEVICE_PNP_NOTIFICATION_DATA_V2_0 *PCWDF_DEVICE_PNP_NOTIFICATION_DATA_V2_0; 44 typedef struct _WDF_DEVICE_POWER_NOTIFICATION_DATA_V2_0 *PWDF_DEVICE_POWER_NOTIFICATION_DATA_V2_0; 45 typedef const struct _WDF_DEVICE_POWER_NOTIFICATION_DATA_V2_0 *PCWDF_DEVICE_POWER_NOTIFICATION_DATA_V2_0; 46 typedef struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V2_0 *PWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V2_0; 47 typedef const struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V2_0 *PCWDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V2_0; 48 typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS_V2_0 *PWDF_PNPPOWER_EVENT_CALLBACKS_V2_0; 49 typedef const struct _WDF_PNPPOWER_EVENT_CALLBACKS_V2_0 *PCWDF_PNPPOWER_EVENT_CALLBACKS_V2_0; 50 typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V2_0 *PWDF_POWER_POLICY_EVENT_CALLBACKS_V2_0; 51 typedef const struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V2_0 *PCWDF_POWER_POLICY_EVENT_CALLBACKS_V2_0; 52 typedef struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0 *PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0; 53 typedef const struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0 *PCWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0; 54 typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0 *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0; 55 typedef const struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0 *PCWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0; 56 typedef struct _WDF_DEVICE_STATE_V2_0 *PWDF_DEVICE_STATE_V2_0; 57 typedef const struct _WDF_DEVICE_STATE_V2_0 *PCWDF_DEVICE_STATE_V2_0; 58 typedef struct _WDF_DEVICE_PNP_CAPABILITIES_V2_0 *PWDF_DEVICE_PNP_CAPABILITIES_V2_0; 59 typedef const struct _WDF_DEVICE_PNP_CAPABILITIES_V2_0 *PCWDF_DEVICE_PNP_CAPABILITIES_V2_0; 60 typedef struct _WDF_DEVICE_POWER_CAPABILITIES_V2_0 *PWDF_DEVICE_POWER_CAPABILITIES_V2_0; 61 typedef const struct _WDF_DEVICE_POWER_CAPABILITIES_V2_0 *PCWDF_DEVICE_POWER_CAPABILITIES_V2_0; 62 typedef struct _WDF_REMOVE_LOCK_OPTIONS_V2_0 *PWDF_REMOVE_LOCK_OPTIONS_V2_0; 63 typedef const struct _WDF_REMOVE_LOCK_OPTIONS_V2_0 *PCWDF_REMOVE_LOCK_OPTIONS_V2_0; 64 typedef struct _WDF_POWER_FRAMEWORK_SETTINGS_V2_0 *PWDF_POWER_FRAMEWORK_SETTINGS_V2_0; 65 typedef const struct _WDF_POWER_FRAMEWORK_SETTINGS_V2_0 *PCWDF_POWER_FRAMEWORK_SETTINGS_V2_0; 66 typedef struct _WDF_IO_TYPE_CONFIG_V2_0 *PWDF_IO_TYPE_CONFIG_V2_0; 67 typedef const struct _WDF_IO_TYPE_CONFIG_V2_0 *PCWDF_IO_TYPE_CONFIG_V2_0; 68 typedef struct _WDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0 *PWDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0; 69 typedef const struct _WDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0 *PCWDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0; 70 typedef struct _WDF_DEVICE_PROPERTY_DATA_V2_0 *PWDF_DEVICE_PROPERTY_DATA_V2_0; 71 typedef const struct _WDF_DEVICE_PROPERTY_DATA_V2_0 *PCWDF_DEVICE_PROPERTY_DATA_V2_0; 72 typedef struct _WDF_DMA_ENABLER_CONFIG_V2_0 *PWDF_DMA_ENABLER_CONFIG_V2_0; 73 typedef const struct _WDF_DMA_ENABLER_CONFIG_V2_0 *PCWDF_DMA_ENABLER_CONFIG_V2_0; 74 typedef struct _WDF_DMA_SYSTEM_PROFILE_CONFIG_V2_0 *PWDF_DMA_SYSTEM_PROFILE_CONFIG_V2_0; 75 typedef const struct _WDF_DMA_SYSTEM_PROFILE_CONFIG_V2_0 *PCWDF_DMA_SYSTEM_PROFILE_CONFIG_V2_0; 76 typedef struct _WDF_DPC_CONFIG_V2_0 *PWDF_DPC_CONFIG_V2_0; 77 typedef const struct _WDF_DPC_CONFIG_V2_0 *PCWDF_DPC_CONFIG_V2_0; 78 typedef struct _WDF_DRIVER_CONFIG_V2_0 *PWDF_DRIVER_CONFIG_V2_0; 79 typedef const struct _WDF_DRIVER_CONFIG_V2_0 *PCWDF_DRIVER_CONFIG_V2_0; 80 typedef struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0 *PWDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0; 81 typedef const struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0 *PCWDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0; 82 typedef struct _WDF_FDO_EVENT_CALLBACKS_V2_0 *PWDF_FDO_EVENT_CALLBACKS_V2_0; 83 typedef const struct _WDF_FDO_EVENT_CALLBACKS_V2_0 *PCWDF_FDO_EVENT_CALLBACKS_V2_0; 84 typedef struct _WDF_DRIVER_GLOBALS_V2_0 *PWDF_DRIVER_GLOBALS_V2_0; 85 typedef const struct _WDF_DRIVER_GLOBALS_V2_0 *PCWDF_DRIVER_GLOBALS_V2_0; 86 typedef struct _WDF_INTERRUPT_CONFIG_V2_0 *PWDF_INTERRUPT_CONFIG_V2_0; 87 typedef const struct _WDF_INTERRUPT_CONFIG_V2_0 *PCWDF_INTERRUPT_CONFIG_V2_0; 88 typedef struct _WDF_INTERRUPT_INFO_V2_0 *PWDF_INTERRUPT_INFO_V2_0; 89 typedef const struct _WDF_INTERRUPT_INFO_V2_0 *PCWDF_INTERRUPT_INFO_V2_0; 90 typedef struct _WDF_INTERRUPT_EXTENDED_POLICY_V2_0 *PWDF_INTERRUPT_EXTENDED_POLICY_V2_0; 91 typedef const struct _WDF_INTERRUPT_EXTENDED_POLICY_V2_0 *PCWDF_INTERRUPT_EXTENDED_POLICY_V2_0; 92 typedef struct _WDF_IO_QUEUE_CONFIG_V2_0 *PWDF_IO_QUEUE_CONFIG_V2_0; 93 typedef const struct _WDF_IO_QUEUE_CONFIG_V2_0 *PCWDF_IO_QUEUE_CONFIG_V2_0; 94 typedef struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0 *PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0; 95 typedef const struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0 *PCWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0; 96 typedef struct _WDF_IO_TARGET_OPEN_PARAMS_V2_0 *PWDF_IO_TARGET_OPEN_PARAMS_V2_0; 97 typedef const struct _WDF_IO_TARGET_OPEN_PARAMS_V2_0 *PCWDF_IO_TARGET_OPEN_PARAMS_V2_0; 98 typedef struct _WDFMEMORY_OFFSET_V2_0 *PWDFMEMORY_OFFSET_V2_0; 99 typedef const struct _WDFMEMORY_OFFSET_V2_0 *PCWDFMEMORY_OFFSET_V2_0; 100 typedef struct _WDF_MEMORY_DESCRIPTOR_V2_0 *PWDF_MEMORY_DESCRIPTOR_V2_0; 101 typedef const struct _WDF_MEMORY_DESCRIPTOR_V2_0 *PCWDF_MEMORY_DESCRIPTOR_V2_0; 102 typedef struct _WDF_OBJECT_ATTRIBUTES_V2_0 *PWDF_OBJECT_ATTRIBUTES_V2_0; 103 typedef const struct _WDF_OBJECT_ATTRIBUTES_V2_0 *PCWDF_OBJECT_ATTRIBUTES_V2_0; 104 typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V2_0 *PWDF_OBJECT_CONTEXT_TYPE_INFO_V2_0; 105 typedef const struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V2_0 *PCWDF_OBJECT_CONTEXT_TYPE_INFO_V2_0; 106 typedef struct _WDF_CUSTOM_TYPE_CONTEXT_V2_0 *PWDF_CUSTOM_TYPE_CONTEXT_V2_0; 107 typedef const struct _WDF_CUSTOM_TYPE_CONTEXT_V2_0 *PCWDF_CUSTOM_TYPE_CONTEXT_V2_0; 108 typedef struct _WDF_PDO_EVENT_CALLBACKS_V2_0 *PWDF_PDO_EVENT_CALLBACKS_V2_0; 109 typedef const struct _WDF_PDO_EVENT_CALLBACKS_V2_0 *PCWDF_PDO_EVENT_CALLBACKS_V2_0; 110 typedef struct _WDF_QUERY_INTERFACE_CONFIG_V2_0 *PWDF_QUERY_INTERFACE_CONFIG_V2_0; 111 typedef const struct _WDF_QUERY_INTERFACE_CONFIG_V2_0 *PCWDF_QUERY_INTERFACE_CONFIG_V2_0; 112 typedef struct _WDF_REQUEST_PARAMETERS_V2_0 *PWDF_REQUEST_PARAMETERS_V2_0; 113 typedef const struct _WDF_REQUEST_PARAMETERS_V2_0 *PCWDF_REQUEST_PARAMETERS_V2_0; 114 typedef struct _WDF_REQUEST_COMPLETION_PARAMS_V2_0 *PWDF_REQUEST_COMPLETION_PARAMS_V2_0; 115 typedef const struct _WDF_REQUEST_COMPLETION_PARAMS_V2_0 *PCWDF_REQUEST_COMPLETION_PARAMS_V2_0; 116 typedef struct _WDF_REQUEST_REUSE_PARAMS_V2_0 *PWDF_REQUEST_REUSE_PARAMS_V2_0; 117 typedef const struct _WDF_REQUEST_REUSE_PARAMS_V2_0 *PCWDF_REQUEST_REUSE_PARAMS_V2_0; 118 typedef struct _WDF_REQUEST_SEND_OPTIONS_V2_0 *PWDF_REQUEST_SEND_OPTIONS_V2_0; 119 typedef const struct _WDF_REQUEST_SEND_OPTIONS_V2_0 *PCWDF_REQUEST_SEND_OPTIONS_V2_0; 120 typedef struct _WDF_REQUEST_FORWARD_OPTIONS_V2_0 *PWDF_REQUEST_FORWARD_OPTIONS_V2_0; 121 typedef const struct _WDF_REQUEST_FORWARD_OPTIONS_V2_0 *PCWDF_REQUEST_FORWARD_OPTIONS_V2_0; 122 typedef struct _WDF_TIMER_CONFIG_V2_0 *PWDF_TIMER_CONFIG_V2_0; 123 typedef const struct _WDF_TIMER_CONFIG_V2_0 *PCWDF_TIMER_CONFIG_V2_0; 124 typedef struct _WDFOBJECT_TRIAGE_INFO_V2_0 *PWDFOBJECT_TRIAGE_INFO_V2_0; 125 typedef const struct _WDFOBJECT_TRIAGE_INFO_V2_0 *PCWDFOBJECT_TRIAGE_INFO_V2_0; 126 typedef struct _WDFCONTEXT_TRIAGE_INFO_V2_0 *PWDFCONTEXT_TRIAGE_INFO_V2_0; 127 typedef const struct _WDFCONTEXT_TRIAGE_INFO_V2_0 *PCWDFCONTEXT_TRIAGE_INFO_V2_0; 128 typedef struct _WDFCONTEXTTYPE_TRIAGE_INFO_V2_0 *PWDFCONTEXTTYPE_TRIAGE_INFO_V2_0; 129 typedef const struct _WDFCONTEXTTYPE_TRIAGE_INFO_V2_0 *PCWDFCONTEXTTYPE_TRIAGE_INFO_V2_0; 130 typedef struct _WDFQUEUE_TRIAGE_INFO_V2_0 *PWDFQUEUE_TRIAGE_INFO_V2_0; 131 typedef const struct _WDFQUEUE_TRIAGE_INFO_V2_0 *PCWDFQUEUE_TRIAGE_INFO_V2_0; 132 typedef struct _WDFFWDPROGRESS_TRIAGE_INFO_V2_0 *PWDFFWDPROGRESS_TRIAGE_INFO_V2_0; 133 typedef const struct _WDFFWDPROGRESS_TRIAGE_INFO_V2_0 *PCWDFFWDPROGRESS_TRIAGE_INFO_V2_0; 134 typedef struct _WDFIRPQUEUE_TRIAGE_INFO_V2_0 *PWDFIRPQUEUE_TRIAGE_INFO_V2_0; 135 typedef const struct _WDFIRPQUEUE_TRIAGE_INFO_V2_0 *PCWDFIRPQUEUE_TRIAGE_INFO_V2_0; 136 typedef struct _WDFREQUEST_TRIAGE_INFO_V2_0 *PWDFREQUEST_TRIAGE_INFO_V2_0; 137 typedef const struct _WDFREQUEST_TRIAGE_INFO_V2_0 *PCWDFREQUEST_TRIAGE_INFO_V2_0; 138 typedef struct _WDFDEVICE_TRIAGE_INFO_V2_0 *PWDFDEVICE_TRIAGE_INFO_V2_0; 139 typedef const struct _WDFDEVICE_TRIAGE_INFO_V2_0 *PCWDFDEVICE_TRIAGE_INFO_V2_0; 140 typedef struct _WDFIRP_TRIAGE_INFO_V2_0 *PWDFIRP_TRIAGE_INFO_V2_0; 141 typedef const struct _WDFIRP_TRIAGE_INFO_V2_0 *PCWDFIRP_TRIAGE_INFO_V2_0; 142 typedef struct _WDF_TRIAGE_INFO_V2_0 *PWDF_TRIAGE_INFO_V2_0; 143 typedef const struct _WDF_TRIAGE_INFO_V2_0 *PCWDF_TRIAGE_INFO_V2_0; 144 typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS_V2_0 *PWDF_USB_REQUEST_COMPLETION_PARAMS_V2_0; 145 typedef const struct _WDF_USB_REQUEST_COMPLETION_PARAMS_V2_0 *PCWDF_USB_REQUEST_COMPLETION_PARAMS_V2_0; 146 typedef struct _WDF_USB_CONTINUOUS_READER_CONFIG_V2_0 *PWDF_USB_CONTINUOUS_READER_CONFIG_V2_0; 147 typedef const struct _WDF_USB_CONTINUOUS_READER_CONFIG_V2_0 *PCWDF_USB_CONTINUOUS_READER_CONFIG_V2_0; 148 typedef struct _WDF_USB_DEVICE_INFORMATION_V2_0 *PWDF_USB_DEVICE_INFORMATION_V2_0; 149 typedef const struct _WDF_USB_DEVICE_INFORMATION_V2_0 *PCWDF_USB_DEVICE_INFORMATION_V2_0; 150 typedef struct _WDF_USB_INTERFACE_SETTING_PAIR_V2_0 *PWDF_USB_INTERFACE_SETTING_PAIR_V2_0; 151 typedef const struct _WDF_USB_INTERFACE_SETTING_PAIR_V2_0 *PCWDF_USB_INTERFACE_SETTING_PAIR_V2_0; 152 typedef struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0 *PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0; 153 typedef const struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0 *PCWDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0; 154 typedef struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0 *PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0; 155 typedef const struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0 *PCWDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0; 156 typedef struct _WDF_USB_PIPE_INFORMATION_V2_0 *PWDF_USB_PIPE_INFORMATION_V2_0; 157 typedef const struct _WDF_USB_PIPE_INFORMATION_V2_0 *PCWDF_USB_PIPE_INFORMATION_V2_0; 158 typedef struct _WDF_USB_DEVICE_CREATE_CONFIG_V2_0 *PWDF_USB_DEVICE_CREATE_CONFIG_V2_0; 159 typedef const struct _WDF_USB_DEVICE_CREATE_CONFIG_V2_0 *PCWDF_USB_DEVICE_CREATE_CONFIG_V2_0; 160 typedef struct _WDF_WMI_PROVIDER_CONFIG_V2_0 *PWDF_WMI_PROVIDER_CONFIG_V2_0; 161 typedef const struct _WDF_WMI_PROVIDER_CONFIG_V2_0 *PCWDF_WMI_PROVIDER_CONFIG_V2_0; 162 typedef struct _WDF_WMI_INSTANCE_CONFIG_V2_0 *PWDF_WMI_INSTANCE_CONFIG_V2_0; 163 typedef const struct _WDF_WMI_INSTANCE_CONFIG_V2_0 *PCWDF_WMI_INSTANCE_CONFIG_V2_0; 164 typedef struct _WDF_WORKITEM_CONFIG_V2_0 *PWDF_WORKITEM_CONFIG_V2_0; 165 typedef const struct _WDF_WORKITEM_CONFIG_V2_0 *PCWDF_WORKITEM_CONFIG_V2_0; 166 167 // 168 // Versioning of structures for wdf.h 169 // 170 // End of versioning of structures for wdf.h 171 172 // 173 // Versioning of structures for wdfassert.h 174 // 175 // End of versioning of structures for wdfassert.h 176 177 // 178 // Versioning of structures for wdfbugcodes.h 179 // 180 typedef struct _WDF_POWER_ROUTINE_TIMED_OUT_DATA_V2_0 { 181 // 182 // Current power state associated with the timed out device 183 // 184 WDF_DEVICE_POWER_STATE PowerState; 185 186 // 187 // Current power policy state associated with the timed out device 188 // 189 WDF_DEVICE_POWER_POLICY_STATE PowerPolicyState; 190 191 // 192 // The device object for the timed out device 193 // 194 PDEVICE_OBJECT DeviceObject; 195 196 // 197 // The handle for the timed out device 198 // 199 WDFDEVICE Device; 200 201 // 202 // The thread which is stuck 203 // 204 PKTHREAD TimedOutThread; 205 206 } WDF_POWER_ROUTINE_TIMED_OUT_DATA_V2_0; 207 208 typedef struct _WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0 { 209 WDFREQUEST Request; 210 211 PIRP Irp; 212 213 ULONG OutputBufferLength; 214 215 ULONG_PTR Information; 216 217 UCHAR MajorFunction; 218 219 } WDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0, *PWDF_REQUEST_FATAL_ERROR_INFORMATION_LENGTH_MISMATCH_DATA_V2_0; 220 221 typedef struct _WDF_QUEUE_FATAL_ERROR_DATA_V2_0 { 222 WDFQUEUE Queue; 223 224 WDFREQUEST Request; 225 226 NTSTATUS Status; 227 228 } WDF_QUEUE_FATAL_ERROR_DATA_V2_0, *PWDF_QUEUE_FATAL_ERROR_DATA_V2_0; 229 230 // End of versioning of structures for wdfbugcodes.h 231 232 // 233 // Versioning of structures for wdfchildlist.h 234 // 235 typedef struct _WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0 { 236 // 237 // Size in bytes of the entire description, including this header. 238 // 239 // Same value as WDF_CHILD_LIST_CONFIG::IdentificationDescriptionSize 240 // Used as a sanity check. 241 // 242 ULONG IdentificationDescriptionSize; 243 244 } WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0, *PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0; 245 246 typedef struct _WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0 { 247 // 248 // Size in bytes of the entire description, including this header. 249 // 250 // Same value as WDF_CHILD_LIST_CONFIG::AddressDescriptionSize 251 // Used as a sanity check. 252 // 253 ULONG AddressDescriptionSize; 254 255 } WDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0, *PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0; 256 257 typedef struct _WDF_CHILD_RETRIEVE_INFO_V2_0 { 258 // 259 // Size of the structure in bytes 260 // 261 ULONG Size; 262 263 // 264 // Must be a valid pointer when passed in, copied into upon success 265 // 266 PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_V2_0 IdentificationDescription; 267 268 // 269 // Optional pointer when passed in, copied into upon success 270 // 271 PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER_V2_0 AddressDescription; 272 273 // 274 // Status of the returned device 275 // 276 WDF_CHILD_LIST_RETRIEVE_DEVICE_STATUS Status; 277 278 // 279 // If provided, will be used for searching through the list of devices 280 // instead of the default list ID compare function 281 // 282 PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE EvtChildListIdentificationDescriptionCompare; 283 284 } WDF_CHILD_RETRIEVE_INFO_V2_0, *PWDF_CHILD_RETRIEVE_INFO_V2_0; 285 286 typedef struct _WDF_CHILD_LIST_CONFIG_V2_0 { 287 // 288 // Size of this structure in bytes 289 // 290 ULONG Size; 291 292 // 293 // The size in bytes of an identificaiton description to be used with the 294 // created WDFCHILDLIST handle 295 // 296 ULONG IdentificationDescriptionSize; 297 298 // 299 // Optional size in bytes of an address description to be used with the 300 // created WDFCHILDLIST handle. 301 // 302 ULONG AddressDescriptionSize; 303 304 // 305 // Required callback to be invoked when a description on the device list 306 // needs to be converted into a real WDFDEVICE handle. 307 // 308 PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice; 309 310 // 311 // Optional callback to be invoked when the device list needs to be 312 // rescanned. This function will be called after the device has entered D0 313 // and been fully initialized but before I/O has started. 314 // 315 PFN_WDF_CHILD_LIST_SCAN_FOR_CHILDREN EvtChildListScanForChildren; 316 317 // 318 // Optional callback to be invoked when an identification description needs 319 // to be copied from one location to another. 320 // 321 // If left NULL, RtlCopyMemory will be used to copy the description. 322 // 323 PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COPY EvtChildListIdentificationDescriptionCopy; 324 325 // 326 // Optional callback to be invoked when an identification description needs 327 // to be duplicated. As opposed to EvtChildListIdentificationDescriptionCopy, 328 // EvtChildListIdentificationDescriptionDuplicate can fail. 329 // 330 PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_DUPLICATE EvtChildListIdentificationDescriptionDuplicate; 331 332 // 333 // Optional callback to be invoked when an identification description needs 334 // to be cleaned up. This function should *NOT* free the description passed 335 // to it, just free any associated resources. 336 // 337 PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_CLEANUP EvtChildListIdentificationDescriptionCleanup; 338 339 // 340 // Optional callback to be invoked when an identification description needs 341 // to be compared with another identificaiton description. 342 // 343 // If left NULL, RtlCompareMemory will be used to compare the two 344 // descriptions. 345 // 346 PFN_WDF_CHILD_LIST_IDENTIFICATION_DESCRIPTION_COMPARE EvtChildListIdentificationDescriptionCompare; 347 348 // 349 // Optional callback to be invoked when an address description needs 350 // to be copied from one location to another. 351 // 352 // If left NULL, RtlCopyMemory will be used to copy the description. 353 // 354 PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_COPY EvtChildListAddressDescriptionCopy; 355 356 // 357 // Optional callback to be invoked when an address description needs to be 358 // duplicated. As opposed to EvtChildListAddressDescriptionCopy, 359 // EvtChildListAddressDescriptionDuplicate can fail. 360 // 361 PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_DUPLICATE EvtChildListAddressDescriptionDuplicate; 362 363 // 364 // Optional callback to be invoked when an address description needs to be 365 // cleaned up. This function should *NOT* free the description passed to 366 // it, just free any associated resources. 367 // 368 PFN_WDF_CHILD_LIST_ADDRESS_DESCRIPTION_CLEANUP EvtChildListAddressDescriptionCleanup; 369 370 // 371 // If provided, will be called when the child's stack requests that the 372 // child be reenumerated. Returning TRUE allows for the reenumeration to 373 // proceed. FALSE will no reenumerate the stack. 374 // 375 PFN_WDF_CHILD_LIST_DEVICE_REENUMERATED EvtChildListDeviceReenumerated; 376 377 } WDF_CHILD_LIST_CONFIG_V2_0, *PWDF_CHILD_LIST_CONFIG_V2_0; 378 379 typedef struct _WDF_CHILD_LIST_ITERATOR_V2_0 { 380 // 381 // Size of this structure in bytes 382 // 383 ULONG Size; 384 385 // 386 // What type of devices to return, see WDF_RETRIEVE_CHILD_FLAGS for 387 // flag values 388 // 389 // 390 ULONG Flags; 391 392 // 393 // For internal use, treat this field as opaque 394 // 395 PVOID Reserved[4]; 396 397 } WDF_CHILD_LIST_ITERATOR_V2_0, *PWDF_CHILD_LIST_ITERATOR_V2_0; 398 399 // End of versioning of structures for wdfchildlist.h 400 401 // 402 // Versioning of structures for wdfcollection.h 403 // 404 // End of versioning of structures for wdfcollection.h 405 406 // 407 // Versioning of structures for wdfCommonBuffer.h 408 // 409 // End of versioning of structures for wdfCommonBuffer.h 410 411 // 412 // Versioning of structures for wdfcontrol.h 413 // 414 // End of versioning of structures for wdfcontrol.h 415 416 // 417 // Versioning of structures for wdfcore.h 418 // 419 // End of versioning of structures for wdfcore.h 420 421 // 422 // Versioning of structures for wdfcx.h 423 // 424 typedef struct _WDFCX_FILEOBJECT_CONFIG_V2_0 { 425 // 426 // Size of this structure in bytes 427 // 428 ULONG Size; 429 430 // 431 // Event callback for create requests 432 // 433 PFN_WDFCX_DEVICE_FILE_CREATE EvtCxDeviceFileCreate; 434 435 // 436 // Event callback for close requests 437 // 438 PFN_WDF_FILE_CLOSE EvtFileClose; 439 440 // 441 // Event callback for cleanup requests 442 // 443 PFN_WDF_FILE_CLEANUP EvtFileCleanup; 444 445 // 446 // If WdfTrue, create/cleanup/close file object related requests will be 447 // sent down the stack. 448 // 449 // If WdfFalse, create/cleanup/close will be completed at this location in 450 // the device stack. 451 // 452 // If WdfDefault, behavior depends on device type 453 // FDO, PDO, Control: use the WdfFalse behavior 454 // Filter: use the WdfTrue behavior 455 // 456 WDF_TRI_STATE AutoForwardCleanupClose; 457 458 // 459 // Specify whether framework should create WDFFILEOBJECT and also 460 // whether it can FsContexts fields in the WDM fileobject to store 461 // WDFFILEOBJECT so that it can avoid table look up and improve perf. 462 // 463 WDF_FILEOBJECT_CLASS FileObjectClass; 464 465 } WDFCX_FILEOBJECT_CONFIG_V2_0, *PWDFCX_FILEOBJECT_CONFIG_V2_0; 466 467 // End of versioning of structures for wdfcx.h 468 469 // 470 // Versioning of structures for wdfcxbase.h 471 // 472 typedef struct _WDF_CLASS_VERSION_V2_0 { 473 WDF_MAJOR_VERSION Major; 474 475 WDF_MINOR_VERSION Minor; 476 477 WDF_BUILD_NUMBER Build; 478 479 } WDF_CLASS_VERSION_V2_0; 480 481 typedef struct _WDF_CLASS_BIND_INFO_V2_0 { 482 // 483 // Size of the structure in bytes 484 // 485 ULONG Size; 486 487 // 488 // Name of the class to bind to 489 // 490 PWSTR ClassName; 491 492 // 493 // Version information for the class 494 // 495 WDF_CLASS_VERSION_V2_0 Version; 496 497 // 498 // Function export table from the class driver to resolve on bind 499 // 500 PFN_WDF_CLASS_EXPORT * FunctionTable; 501 502 // 503 // Number of entries in FunctionTable 504 // 505 ULONG FunctionTableCount; 506 507 // 508 // Optional field where the client specify additional information 509 // for the class driver to resolve 510 // 511 PVOID ClassBindInfo; 512 513 // 514 // Optional bind callback. If set, WdfVersionBindClass will not 515 // be called and it will be up to ClientClassBind to call this function 516 // if required. 517 // 518 PFN_WDF_CLIENT_BIND_CLASS ClientBindClass; 519 520 // 521 // Optional unbind callback. If set, WdfVersionUnbindClass will not be 522 // called and it will be up to ClientClassUnbind to call this function 523 // if required. 524 // 525 PFN_WDF_CLIENT_UNBIND_CLASS ClientUnbindClass; 526 527 // 528 // Diagnostic cookie to use during debugging 529 // 530 PVOID ClassModule; 531 532 } WDF_CLASS_BIND_INFO_V2_0, * PWDF_CLASS_BIND_INFO_V2_0; 533 534 typedef struct _WDF_CLASS_LIBRARY_INFO_V2_0 { 535 // 536 // Size of this structure in bytes 537 // 538 ULONG Size; 539 540 // 541 // Version of this class library 542 // 543 WDF_CLASS_VERSION_V2_0 Version; 544 545 // 546 // Callback to be called by the loader to initialize the class library 547 // 548 PFN_WDF_CLASS_LIBRARY_INITIALIZE ClassLibraryInitialize; 549 550 // 551 // Callback to be called by the loader to deinitialize the class library 552 // after succesful initialization (immediately before the class library will 553 // be unloaded). 554 // 555 PFN_WDF_CLASS_LIBRARY_DEINITIALIZE ClassLibraryDeinitialize; 556 557 // 558 // Callback to be called by the loader when a client driver has request to 559 // be bound to this class library. 560 // 561 PFN_WDF_CLASS_LIBRARY_BIND_CLIENT ClassLibraryBindClient; 562 563 // 564 // Callback to be called by the loader when a previously bound client driver 565 // is being unloaded. 566 // 567 PFN_WDF_CLASS_LIBRARY_UNBIND_CLIENT ClassLibraryUnbindClient; 568 569 } WDF_CLASS_LIBRARY_INFO_V2_0, *PWDF_CLASS_LIBRARY_INFO_V2_0; 570 571 // End of versioning of structures for wdfcxbase.h 572 573 // 574 // Versioning of structures for wdfDevice.h 575 // 576 typedef struct _WDF_FILEOBJECT_CONFIG_V2_0 { 577 // 578 // Size of this structure in bytes 579 // 580 ULONG Size; 581 582 // 583 // Event callback for create requests 584 // 585 PFN_WDF_DEVICE_FILE_CREATE EvtDeviceFileCreate; 586 587 // 588 // Event callback for close requests 589 // 590 PFN_WDF_FILE_CLOSE EvtFileClose; 591 592 // 593 // Event callback for cleanup requests 594 // 595 PFN_WDF_FILE_CLEANUP EvtFileCleanup; 596 597 // 598 // If WdfTrue, create/cleanup/close file object related requests will be 599 // sent down the stack. 600 // 601 // If WdfFalse, create/cleanup/close will be completed at this location in 602 // the device stack. 603 // 604 // If WdfDefault, behavior depends on device type 605 // FDO, PDO, Control: use the WdfFalse behavior 606 // Filter: use the WdfTrue behavior 607 // 608 WDF_TRI_STATE AutoForwardCleanupClose; 609 610 // 611 // Specify whether framework should create WDFFILEOBJECT and also 612 // whether it can FsContexts fields in the WDM fileobject to store 613 // WDFFILEOBJECT so that it can avoid table look up and improve perf. 614 // 615 WDF_FILEOBJECT_CLASS FileObjectClass; 616 617 } WDF_FILEOBJECT_CONFIG_V2_0, *PWDF_FILEOBJECT_CONFIG_V2_0; 618 619 typedef struct _WDF_DEVICE_PNP_NOTIFICATION_DATA_V2_0 { 620 // 621 // Type of data 622 // 623 WDF_STATE_NOTIFICATION_TYPE Type; 624 625 union { 626 struct { 627 // 628 // The current state that is about to be exited 629 // 630 WDF_DEVICE_PNP_STATE CurrentState; 631 632 // 633 // The new state that is about to be entered 634 // 635 WDF_DEVICE_PNP_STATE NewState; 636 637 } EnterState; 638 639 struct { 640 // 641 // The current state 642 // 643 WDF_DEVICE_PNP_STATE CurrentState; 644 645 } PostProcessState; 646 647 struct { 648 // 649 // The current state that is about to be exitted 650 // 651 WDF_DEVICE_PNP_STATE CurrentState; 652 653 // 654 // The state that is about to be entered 655 // 656 WDF_DEVICE_PNP_STATE NewState; 657 658 } LeaveState; 659 660 } Data; 661 662 } WDF_DEVICE_PNP_NOTIFICATION_DATA_V2_0; 663 664 typedef struct _WDF_DEVICE_POWER_NOTIFICATION_DATA_V2_0 { 665 // 666 // Type of data 667 // 668 WDF_STATE_NOTIFICATION_TYPE Type; 669 670 union { 671 struct { 672 // 673 // The current state that is about to be exitted 674 // 675 WDF_DEVICE_POWER_STATE CurrentState; 676 677 // 678 // The new state that is about to be entered 679 // 680 WDF_DEVICE_POWER_STATE NewState; 681 682 } EnterState; 683 684 struct { 685 // 686 // The current state 687 // 688 WDF_DEVICE_POWER_STATE CurrentState; 689 690 } PostProcessState; 691 692 struct { 693 // 694 // The current state that is about to be exitted 695 // 696 WDF_DEVICE_POWER_STATE CurrentState; 697 698 // 699 // The state that is about to be entered 700 // 701 WDF_DEVICE_POWER_STATE NewState; 702 703 } LeaveState; 704 705 } Data; 706 707 } WDF_DEVICE_POWER_NOTIFICATION_DATA_V2_0; 708 709 typedef struct _WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V2_0 { 710 // 711 // Type of data 712 // 713 WDF_STATE_NOTIFICATION_TYPE Type; 714 715 union { 716 struct { 717 // 718 // The current state that is about to be exitted 719 // 720 WDF_DEVICE_POWER_POLICY_STATE CurrentState; 721 722 // 723 // The new state that is about to be entered 724 // 725 WDF_DEVICE_POWER_POLICY_STATE NewState; 726 727 } EnterState; 728 729 struct { 730 // 731 // The current state 732 // 733 WDF_DEVICE_POWER_POLICY_STATE CurrentState; 734 735 } PostProcessState; 736 737 struct { 738 // 739 // The current state that is about to be exitted 740 // 741 WDF_DEVICE_POWER_POLICY_STATE CurrentState; 742 743 // 744 // The state that is about to be entered 745 // 746 WDF_DEVICE_POWER_POLICY_STATE NewState; 747 748 } LeaveState; 749 750 } Data; 751 752 } WDF_DEVICE_POWER_POLICY_NOTIFICATION_DATA_V2_0; 753 754 typedef struct _WDF_PNPPOWER_EVENT_CALLBACKS_V2_0 { 755 // 756 // Size of this structure in bytes 757 // 758 ULONG Size; 759 760 PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry; 761 762 PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled; 763 764 PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit; 765 766 PFN_WDF_DEVICE_D0_EXIT_PRE_INTERRUPTS_DISABLED EvtDeviceD0ExitPreInterruptsDisabled; 767 768 PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware; 769 770 PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware; 771 772 PFN_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP EvtDeviceSelfManagedIoCleanup; 773 774 PFN_WDF_DEVICE_SELF_MANAGED_IO_FLUSH EvtDeviceSelfManagedIoFlush; 775 776 PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit; 777 778 PFN_WDF_DEVICE_SELF_MANAGED_IO_SUSPEND EvtDeviceSelfManagedIoSuspend; 779 780 PFN_WDF_DEVICE_SELF_MANAGED_IO_RESTART EvtDeviceSelfManagedIoRestart; 781 782 PFN_WDF_DEVICE_SURPRISE_REMOVAL EvtDeviceSurpriseRemoval; 783 784 PFN_WDF_DEVICE_QUERY_REMOVE EvtDeviceQueryRemove; 785 786 PFN_WDF_DEVICE_QUERY_STOP EvtDeviceQueryStop; 787 788 PFN_WDF_DEVICE_USAGE_NOTIFICATION EvtDeviceUsageNotification; 789 790 PFN_WDF_DEVICE_RELATIONS_QUERY EvtDeviceRelationsQuery; 791 792 PFN_WDF_DEVICE_USAGE_NOTIFICATION_EX EvtDeviceUsageNotificationEx; 793 794 } WDF_PNPPOWER_EVENT_CALLBACKS_V2_0, *PWDF_PNPPOWER_EVENT_CALLBACKS_V2_0; 795 796 typedef struct _WDF_POWER_POLICY_EVENT_CALLBACKS_V2_0 { 797 // 798 // Size of this structure in bytes 799 // 800 ULONG Size; 801 802 PFN_WDF_DEVICE_ARM_WAKE_FROM_S0 EvtDeviceArmWakeFromS0; 803 804 PFN_WDF_DEVICE_DISARM_WAKE_FROM_S0 EvtDeviceDisarmWakeFromS0; 805 806 PFN_WDF_DEVICE_WAKE_FROM_S0_TRIGGERED EvtDeviceWakeFromS0Triggered; 807 808 PFN_WDF_DEVICE_ARM_WAKE_FROM_SX EvtDeviceArmWakeFromSx; 809 810 PFN_WDF_DEVICE_DISARM_WAKE_FROM_SX EvtDeviceDisarmWakeFromSx; 811 812 PFN_WDF_DEVICE_WAKE_FROM_SX_TRIGGERED EvtDeviceWakeFromSxTriggered; 813 814 PFN_WDF_DEVICE_ARM_WAKE_FROM_SX_WITH_REASON EvtDeviceArmWakeFromSxWithReason; 815 816 } WDF_POWER_POLICY_EVENT_CALLBACKS_V2_0, *PWDF_POWER_POLICY_EVENT_CALLBACKS_V2_0; 817 818 typedef struct _WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0 { 819 // 820 // Size of this structure in bytes 821 // 822 ULONG Size; 823 824 // 825 // Indicates whether the device can wake itself up while the machine is in 826 // S0. 827 // 828 WDF_POWER_POLICY_S0_IDLE_CAPABILITIES IdleCaps; 829 830 // 831 // The low power state in which the device will be placed when it is idled 832 // out while the machine is in S0. 833 // 834 DEVICE_POWER_STATE DxState; 835 836 // 837 // Amount of time the device must be idle before idling out. Timeout is in 838 // milliseconds. 839 // 840 ULONG IdleTimeout; 841 842 // 843 // Inidcates whether a user can control the idle policy of the device. 844 // By default, a user is allowed to change the policy. 845 // 846 WDF_POWER_POLICY_S0_IDLE_USER_CONTROL UserControlOfIdleSettings; 847 848 // 849 // If WdfTrue, idling out while the machine is in S0 will be enabled. 850 // 851 // If WdfFalse, idling out will be disabled. 852 // 853 // If WdfUseDefault, the idling out will be enabled. If 854 // UserControlOfIdleSettings is set to IdleAllowUserControl, the user's 855 // settings will override the default. 856 // 857 WDF_TRI_STATE Enabled; 858 859 // 860 // This field is applicable only when IdleCaps == IdleCannotWakeFromS0 861 // If WdfTrue,device is powered up on System Wake even if device is idle 862 // If WdfFalse, device is not powered up on system wake if it is idle 863 // If WdfUseDefault, the behavior is same as WdfFalse 864 // 865 WDF_TRI_STATE PowerUpIdleDeviceOnSystemWake; 866 867 // 868 // This field determines how the IdleTimeout field is used. 869 // 870 // If the value is DriverManagedIdleTimeout, then the idle timeout value 871 // is determined by the IdleTimeout field of this structure. 872 // 873 // If the value is SystemManagedIdleTimeout, then the timeout value is 874 // determined by the power framework (PoFx) on operating systems where 875 // the PoFx is available (i.e. Windows 8 and later). The IdleTimeout field 876 // is ignored on these operating systems. On operating systems where the 877 // PoFx is not available, the behavior is same as DriverManagedIdleTimeout. 878 // 879 // If the value is SystemManagedIdleTimeoutWithHint, then the timeout value 880 // is determined by the power framework (PoFx) on operating systems where 881 // the PoFx is available (i.e. Windows 8 and later). In addition, the value 882 // specified in the IdleTimeout field is provided as a hint to the PoFx in 883 // determining when the device should be allowed to enter a low-power state. 884 // Since it is only a hint, the actual duration after which the PoFx allows 885 // the device to enter a low-power state might be greater than or less than 886 // the IdleTimeout value. On operating systems where the PoFx is not 887 // available, the behavior is same as DriverManagedIdleTimeout. 888 // 889 WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE IdleTimeoutType; 890 891 // 892 // This field forces the device to avoid idling in the D3cold power state. 893 // WDF will ensure, with help from the bus drivers, that the device will 894 // idle in a D-state that can successfully generate a wake signal, if 895 // necessary. If the client specifies that DxState == PowerDeviceD3, this 896 // setting allows the client to distinguish betwen D3hot and D3cold. If 897 // the client sets DxState == PowerDeviceMaximum, then WDF will pick the 898 // deepest idle state identified by the bus driver. If that deepest state 899 // is D3cold, this field allows the client to override that and choose 900 // D3hot. 901 // 902 // If WdfTrue, device will not use D3cold in S0. 903 // If WdfFalse, device will use D3cold in S0 if the ACPI firmware indicates 904 // that the device can enter that state, if DxState above does not 905 // specify some other D-state and, if the device is armed for 906 // wake, that it can generate its wake signal from D3cold. 907 // If WdfUseDefault, this setting will be derived from the driver's INF, 908 // specifically the presence or absence of the following two lines in 909 // the DDInstall.HW section: 910 // Include=machine.inf 911 // Needs=PciD3ColdSupported 912 // 913 WDF_TRI_STATE ExcludeD3Cold; 914 915 } WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0, *PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_V2_0; 916 917 typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0 { 918 // 919 // Size of this structure in bytes 920 // 921 ULONG Size; 922 923 // 924 // The low power state in which the device will be placed when it is armed 925 // for wake from Sx. 926 // 927 DEVICE_POWER_STATE DxState; 928 929 // 930 // Inidcates whether a user can control the idle policy of the device. 931 // By default, a user is allowed to change the policy. 932 // 933 WDF_POWER_POLICY_SX_WAKE_USER_CONTROL UserControlOfWakeSettings; 934 935 // 936 // If WdfTrue, arming the device for wake while the machine is in Sx is 937 // enabled. 938 // 939 // If WdfFalse, arming the device for wake while the machine is in Sx is 940 // disabled. 941 // 942 // If WdfUseDefault, arming will be enabled. If UserControlOfWakeSettings 943 // is set to WakeAllowUserControl, the user's settings will override the 944 // default. 945 // 946 WDF_TRI_STATE Enabled; 947 948 // 949 // If set to TRUE, arming the parent device can depend on whether there 950 // is atleast one child device armed for wake. 951 // 952 // If set to FALSE, arming of the parent device will be independent of 953 // whether any of the child devices are armed for wake. 954 // 955 BOOLEAN ArmForWakeIfChildrenAreArmedForWake; 956 957 // 958 // Indicates that whenever the parent device completes the wake irp 959 // successfully, the status needs to be also propagated to the child 960 // devices. This helps in tracking which devices were responsible for 961 // waking the system. 962 // 963 BOOLEAN IndicateChildWakeOnParentWake; 964 965 } WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0, *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_V2_0; 966 967 typedef struct _WDF_DEVICE_STATE_V2_0 { 968 // 969 // Size of this structure in bytes 970 // 971 ULONG Size; 972 973 // 974 // If set to WdfTrue, the device will be disabled 975 // 976 WDF_TRI_STATE Disabled; 977 978 // 979 // If set to WdfTrue, the device will not be displayed in device manager. 980 // Once hidden, the device cannot be unhidden. 981 // 982 WDF_TRI_STATE DontDisplayInUI; 983 984 // 985 // If set to WdfTrue, the device is reporting itself as failed. If set 986 // in conjuction with ResourcesChanged to WdfTrue, the device will receive 987 // a PnP stop and then a new PnP start device. 988 // 989 WDF_TRI_STATE Failed; 990 991 // 992 // If set to WdfTrue, the device cannot be subsequently disabled. 993 // 994 WDF_TRI_STATE NotDisableable; 995 996 997 998 999 // 1000 // 1001 // If set to WdfTrue, the device stack will be torn down. 1002 // 1003 WDF_TRI_STATE Removed; 1004 1005 // 1006 // If set to WdfTrue, the device will be sent another PnP start. If the 1007 // Failed field is set to WdfTrue as well, a PnP stop will be sent before 1008 // the start. 1009 // 1010 WDF_TRI_STATE ResourcesChanged; 1011 1012 } WDF_DEVICE_STATE_V2_0, *PWDF_DEVICE_STATE_V2_0; 1013 1014 typedef struct _WDF_DEVICE_PNP_CAPABILITIES_V2_0 { 1015 // 1016 // Size of the structure in bytes 1017 // 1018 ULONG Size; 1019 1020 // 1021 // NOTE: To mark a PDO as raw, call WdfPdoInitAssignRawDevice 1022 // 1023 // 1024 WDF_TRI_STATE LockSupported; 1025 1026 WDF_TRI_STATE EjectSupported; 1027 1028 WDF_TRI_STATE Removable; 1029 1030 WDF_TRI_STATE DockDevice; 1031 1032 WDF_TRI_STATE UniqueID; 1033 1034 WDF_TRI_STATE SilentInstall; 1035 1036 WDF_TRI_STATE SurpriseRemovalOK; 1037 1038 WDF_TRI_STATE HardwareDisabled; 1039 1040 WDF_TRI_STATE NoDisplayInUI; 1041 1042 // 1043 // Default values of -1 indicate not to set this value 1044 // 1045 ULONG Address; 1046 1047 ULONG UINumber; 1048 1049 } WDF_DEVICE_PNP_CAPABILITIES_V2_0, *PWDF_DEVICE_PNP_CAPABILITIES_V2_0; 1050 1051 typedef struct _WDF_DEVICE_POWER_CAPABILITIES_V2_0 { 1052 // 1053 // Size of the structure in bytes 1054 // 1055 ULONG Size; 1056 1057 WDF_TRI_STATE DeviceD1; 1058 1059 WDF_TRI_STATE DeviceD2; 1060 1061 WDF_TRI_STATE WakeFromD0; 1062 1063 WDF_TRI_STATE WakeFromD1; 1064 1065 WDF_TRI_STATE WakeFromD2; 1066 1067 WDF_TRI_STATE WakeFromD3; 1068 1069 // 1070 // Default value PowerDeviceMaximum indicates not to set this value 1071 // 1072 DEVICE_POWER_STATE DeviceState[PowerSystemMaximum]; 1073 1074 // 1075 // Default value PowerDeviceMaximum, PowerSystemMaximum indicates not to 1076 // set this value. 1077 // 1078 DEVICE_POWER_STATE DeviceWake; 1079 1080 SYSTEM_POWER_STATE SystemWake; 1081 1082 // 1083 // Default values of -1 indicate not to set this value 1084 // 1085 ULONG D1Latency; 1086 1087 ULONG D2Latency; 1088 1089 ULONG D3Latency; 1090 1091 // 1092 // Ideal Dx state for the device to be put into when the machine moves into 1093 // Sx and the device is not armed for wake. By default, the default will be 1094 // placed into D3. If IdealDxStateForSx is lighter then 1095 // DeviceState[Sx], then DeviceState[Sx] will be used as the Dx state. 1096 // 1097 DEVICE_POWER_STATE IdealDxStateForSx; 1098 1099 } WDF_DEVICE_POWER_CAPABILITIES_V2_0, *PWDF_DEVICE_POWER_CAPABILITIES_V2_0; 1100 1101 typedef struct _WDF_REMOVE_LOCK_OPTIONS_V2_0 { 1102 // 1103 // Size of the structure in bytes 1104 // 1105 ULONG Size; 1106 1107 // 1108 // Bit field combination of values from the WDF_REMOVE_LOCK_OPTIONS_FLAGS 1109 // enumeration 1110 // 1111 ULONG Flags; 1112 1113 } WDF_REMOVE_LOCK_OPTIONS_V2_0, *PWDF_REMOVE_LOCK_OPTIONS_V2_0; 1114 1115 typedef struct _WDF_POWER_FRAMEWORK_SETTINGS_V2_0 { 1116 // 1117 // Size of the structure, in bytes. 1118 // 1119 ULONG Size; 1120 1121 // 1122 // Client driver's callback function that is invoked after KMDF has 1123 // registered with the power framework. This field can be NULL if the 1124 // client driver does not wish to specify this callback. 1125 // 1126 PFN_WDFDEVICE_WDM_POST_PO_FX_REGISTER_DEVICE EvtDeviceWdmPostPoFxRegisterDevice; 1127 1128 // 1129 // Client driver's callback function that is invoked before KMDF 1130 // unregisters with the power framework. This field can be NULL if the 1131 // client driver does not wish to specify this callback. 1132 // 1133 PFN_WDFDEVICE_WDM_PRE_PO_FX_UNREGISTER_DEVICE EvtDeviceWdmPrePoFxUnregisterDevice; 1134 1135 // 1136 // Pointer to a PO_FX_COMPONENT structure that describes the only component 1137 // in the single-component device. This field can be NULL if the client 1138 // driver wants KMDF to use the default specification for this component 1139 // (i.e. support for F0 only). 1140 // 1141 PPO_FX_COMPONENT Component; 1142 1143 // 1144 // Client driver's PO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK callback 1145 // function. This field can be NULL if the client driver does not wish to 1146 // specify this callback. 1147 // 1148 PPO_FX_COMPONENT_ACTIVE_CONDITION_CALLBACK ComponentActiveConditionCallback; 1149 1150 // 1151 // Client driver's PO_FX_COMPONENT_IDLE_CONDITION_CALLBACK callback 1152 // function. This field can be NULL if the client driver does not wish to 1153 // specify this callback. 1154 // 1155 PPO_FX_COMPONENT_IDLE_CONDITION_CALLBACK ComponentIdleConditionCallback; 1156 1157 // 1158 // Client driver's PO_FX_COMPONENT_IDLE_STATE_CALLBACK callback function. 1159 // This field can be NULL if the client driver does not wish to specify 1160 // this callback. 1161 // 1162 PPO_FX_COMPONENT_IDLE_STATE_CALLBACK ComponentIdleStateCallback; 1163 1164 // 1165 // Client driver's PO_FX_POWER_CONTROL_CALLBACK callback function. This 1166 // field can be NULL if the client driver does not wish to specify this 1167 // callback. 1168 // 1169 PPO_FX_POWER_CONTROL_CALLBACK PowerControlCallback; 1170 1171 // 1172 // Context value that is passed in to the ComponentIdleStateCallback and 1173 // PowerControlCallback callback functions. 1174 // 1175 PVOID PoFxDeviceContext; 1176 1177 } WDF_POWER_FRAMEWORK_SETTINGS_V2_0, *PWDF_POWER_FRAMEWORK_SETTINGS_V2_0; 1178 1179 typedef struct _WDF_IO_TYPE_CONFIG_V2_0 { 1180 // 1181 // Size of this structure in bytes 1182 // 1183 ULONG Size; 1184 1185 // 1186 // <KMDF_DOC/> 1187 // Identifies the method that the driver will use to access data buffers 1188 // that it receives for read and write requests. 1189 // 1190 // <UMDF_DOC/> 1191 // Identifies the method that the driver will "prefer" to use to access data 1192 // buffers that it receives for read and write requests. Note that UMDF 1193 // driver provides just a preference, and not a guarantee.Therefore, 1194 // even if a driver specified direct access method, UMDF might use the 1195 // buffered access method for one or more of the device's requests to 1196 // improve performance. For example, UMDF uses buffered access for small 1197 // buffers, if it can copy the data to the driver's buffer faster than it 1198 // can map the buffers for direct access. 1199 // 1200 WDF_DEVICE_IO_TYPE ReadWriteIoType; 1201 1202 // 1203 // <UMDF_ONLY/> 1204 // Identifies the method that the driver will "prefer" to use to access data 1205 // buffers that it receives for IOCTL requests. Note that UMDF 1206 // driver provides just a preference, and not a guarantee. Therefore, 1207 // even if a driver specified direct access method, UMDF might use the 1208 // buffered access method for one or more of the device's requests to 1209 // improve performance. For example, UMDF uses buffered access for small 1210 // buffers, if it can copy the data to the driver's buffer faster than it 1211 // can map the buffers for direct access. 1212 // 1213 WDF_DEVICE_IO_TYPE DeviceControlIoType; 1214 1215 // 1216 // <UMDF_ONLY/> 1217 // Optional, Provides the smallest buffer size (in bytes) for which 1218 // UMDF will use direct access for the buffers. For example, set 1219 // DirectTransferThreshold to "12288" to indicate that UMDF should use buffered 1220 // access for all buffers that are smaller than 12 kilobytes, and direct 1221 // access for buffers equal to or greater than that. Typically, you 1222 // do not need to provide this value because UMDF uses a value that provides 1223 // the best performance. Note that there are other requirements that must be 1224 // met in order to get direct access of buffers. See Docs for details. 1225 // 1226 ULONG DirectTransferThreshold; 1227 1228 } WDF_IO_TYPE_CONFIG_V2_0, *PWDF_IO_TYPE_CONFIG_V2_0; 1229 1230 typedef struct _WDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0 { 1231 _In_ ULONG Size; 1232 1233 // 1234 // A pointer to a GUID that identifies the device interface class. 1235 // 1236 _In_ const GUID * InterfaceClassGUID; 1237 1238 // 1239 // A pointer to a UNICODE_STRING structure that describes a reference 1240 // string for the device interface. This parameter is optional and can 1241 // be NULL. 1242 _In_opt_ PCUNICODE_STRING ReferenceString; 1243 1244 // 1245 // A pointer to a DEVPROPKEY structure that specifies the device 1246 // property key. 1247 // 1248 _In_ const DEVPROPKEY * PropertyKey; 1249 1250 // 1251 // A locale identifier. Set this parameter either to a language-specific 1252 // LCID value or to LOCALE_NEUTRAL. The LOCALE_NEUTRAL LCID specifies 1253 // that the property is language-neutral (that is, not specific to any 1254 // language). Do not set this parameter to LOCALE_SYSTEM_DEFAULT or 1255 // LOCALE_USER_DEFAULT. For more information about language-specific 1256 // LCID values, see LCID Structure. 1257 // 1258 _In_ LCID Lcid; 1259 1260 // 1261 // Set this parameter to PLUGPLAY_PROPERTY_PERSISTENT if the property 1262 // value set by this routine should persist across computer restarts. 1263 // Otherwise, set Flags to zero. Ignored for Query DDIs. 1264 // 1265 _In_ ULONG Flags; 1266 1267 } WDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0, *PWDF_DEVICE_INTERFACE_PROPERTY_DATA_V2_0; 1268 1269 typedef struct _WDF_DEVICE_PROPERTY_DATA_V2_0 { 1270 // 1271 // Size of this structure 1272 // 1273 _In_ ULONG Size; 1274 1275 // 1276 // A pointer to a DEVPROPKEY structure that specifies the device 1277 // property key. 1278 // 1279 _In_ const DEVPROPKEY * PropertyKey; 1280 1281 // 1282 // A locale identifier. Set this parameter either to a language-specific 1283 // LCID value or to LOCALE_NEUTRAL. The LOCALE_NEUTRAL LCID specifies 1284 // that the property is language-neutral (that is, not specific to any 1285 // language). Do not set this parameter to LOCALE_SYSTEM_DEFAULT or 1286 // LOCALE_USER_DEFAULT. For more information about language-specific 1287 // LCID values, see LCID Structure. 1288 // 1289 _In_ LCID Lcid; 1290 1291 // 1292 // Set this parameter to PLUGPLAY_PROPERTY_PERSISTENT if the property 1293 // value set by this routine should persist across computer restarts. 1294 // Otherwise, set Flags to zero. Ignored for Query DDIs. 1295 // 1296 _In_ ULONG Flags; 1297 1298 } WDF_DEVICE_PROPERTY_DATA_V2_0, *PWDF_DEVICE_PROPERTY_DATA_V2_0; 1299 1300 // End of versioning of structures for wdfDevice.h 1301 1302 // 1303 // Versioning of structures for wdfDmaEnabler.h 1304 // 1305 // End of versioning of structures for wdfDmaEnabler.h 1306 1307 // 1308 // Versioning of structures for wdfDmaTransaction.h 1309 // 1310 // End of versioning of structures for wdfDmaTransaction.h 1311 1312 // 1313 // Versioning of structures for wdfdpc.h 1314 // 1315 // End of versioning of structures for wdfdpc.h 1316 1317 // 1318 // Versioning of structures for wdfdriver.h 1319 // 1320 typedef struct _WDF_DRIVER_CONFIG_V2_0 { 1321 // 1322 // Size of this structure in bytes 1323 // 1324 ULONG Size; 1325 1326 // 1327 // Event callbacks 1328 // 1329 PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd; 1330 1331 PFN_WDF_DRIVER_UNLOAD EvtDriverUnload; 1332 1333 // 1334 // Combination of WDF_DRIVER_INIT_FLAGS values 1335 // 1336 ULONG DriverInitFlags; 1337 1338 // 1339 // Pool tag to use for all allocations made by the framework on behalf of 1340 // the client driver. 1341 // 1342 ULONG DriverPoolTag; 1343 1344 } WDF_DRIVER_CONFIG_V2_0, *PWDF_DRIVER_CONFIG_V2_0; 1345 1346 typedef struct _WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0 { 1347 // 1348 // Size of the structure in bytes 1349 // 1350 ULONG Size; 1351 1352 // 1353 // Major Version requested 1354 // 1355 ULONG MajorVersion; 1356 1357 // 1358 // Minor Version requested 1359 // 1360 ULONG MinorVersion; 1361 1362 } WDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0, *PWDF_DRIVER_VERSION_AVAILABLE_PARAMS_V2_0; 1363 1364 // End of versioning of structures for wdfdriver.h 1365 1366 // 1367 // Versioning of structures for wdffdo.h 1368 // 1369 typedef struct _WDF_FDO_EVENT_CALLBACKS_V2_0 { 1370 // 1371 // Size of this structure in bytes 1372 // 1373 ULONG Size; 1374 1375 PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS EvtDeviceFilterAddResourceRequirements; 1376 1377 PFN_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS EvtDeviceFilterRemoveResourceRequirements; 1378 1379 PFN_WDF_DEVICE_REMOVE_ADDED_RESOURCES EvtDeviceRemoveAddedResources; 1380 1381 } WDF_FDO_EVENT_CALLBACKS_V2_0, *PWDF_FDO_EVENT_CALLBACKS_V2_0; 1382 1383 // End of versioning of structures for wdffdo.h 1384 1385 // 1386 // Versioning of structures for wdffileobject.h 1387 // 1388 // End of versioning of structures for wdffileobject.h 1389 1390 // 1391 // Versioning of structures for wdfGlobals.h 1392 // 1393 typedef struct _WDF_DRIVER_GLOBALS_V2_0 { 1394 // backpointer to the handle for this driver 1395 WDFDRIVER Driver; 1396 1397 // Flags indicated by the driver during create 1398 ULONG DriverFlags; 1399 1400 // Tag generated by WDF for the driver. Tag used by allocations made on 1401 // behalf of the driver by WDF. 1402 ULONG DriverTag; 1403 1404 CHAR DriverName[WDF_DRIVER_GLOBALS_NAME_LEN]; 1405 1406 // If TRUE, the stub code will capture DriverObject->DriverUnload and insert 1407 // itself first in the unload chain. If FALSE, DriverUnload is left alone 1408 // (but WDF will not be notified of unload and there will be no auto cleanup). 1409 BOOLEAN DisplaceDriverUnload; 1410 1411 } WDF_DRIVER_GLOBALS_V2_0, *PWDF_DRIVER_GLOBALS_V2_0; 1412 1413 // End of versioning of structures for wdfGlobals.h 1414 1415 // 1416 // Versioning of structures for wdfhwaccess.h 1417 // 1418 // End of versioning of structures for wdfhwaccess.h 1419 1420 // 1421 // Versioning of structures for wdfinstaller.h 1422 // 1423 // End of versioning of structures for wdfinstaller.h 1424 1425 // 1426 // Versioning of structures for wdfinternal.h 1427 // 1428 // End of versioning of structures for wdfinternal.h 1429 1430 // 1431 // Versioning of structures for wdfinterrupt.h 1432 // 1433 // 1434 // Interrupt Configuration Structure 1435 // 1436 typedef struct _WDF_INTERRUPT_CONFIG_V2_0 { 1437 ULONG Size; 1438 1439 // 1440 // If this interrupt is to be synchronized with other interrupt(s) assigned 1441 // to the same WDFDEVICE, create a WDFSPINLOCK and assign it to each of the 1442 // WDFINTERRUPTs config. 1443 // 1444 WDFSPINLOCK SpinLock; 1445 1446 WDF_TRI_STATE ShareVector; 1447 1448 BOOLEAN FloatingSave; 1449 1450 // 1451 // DIRQL handling: automatic serialization of the DpcForIsr/WaitItemForIsr. 1452 // Passive-level handling: automatic serialization of all callbacks. 1453 // 1454 BOOLEAN AutomaticSerialization; 1455 1456 // 1457 // Event Callbacks 1458 // 1459 PFN_WDF_INTERRUPT_ISR EvtInterruptIsr; 1460 1461 PFN_WDF_INTERRUPT_DPC EvtInterruptDpc; 1462 1463 PFN_WDF_INTERRUPT_ENABLE EvtInterruptEnable; 1464 1465 PFN_WDF_INTERRUPT_DISABLE EvtInterruptDisable; 1466 1467 PFN_WDF_INTERRUPT_WORKITEM EvtInterruptWorkItem; 1468 1469 // 1470 // These fields are only used when interrupt is created in 1471 // EvtDevicePrepareHardware callback. 1472 // 1473 PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw; 1474 1475 PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated; 1476 1477 // 1478 // Optional passive lock for handling interrupts at passive-level. 1479 // 1480 WDFWAITLOCK WaitLock; 1481 1482 // 1483 // TRUE: handle interrupt at passive-level. 1484 // FALSE: handle interrupt at DIRQL level. This is the default. 1485 // 1486 BOOLEAN PassiveHandling; 1487 1488 // 1489 // TRUE: Interrupt is reported inactive on explicit power down 1490 // instead of disconnecting it. 1491 // FALSE: Interrupt is disconnected instead of reporting inactive 1492 // on explicit power down. 1493 // DEFAULT: Framework decides the right value. 1494 // 1495 WDF_TRI_STATE ReportInactiveOnPowerDown; 1496 1497 // 1498 // TRUE: Interrupt is used to wake the device from low-power states 1499 // and when the device is armed for wake this interrupt should 1500 // remain connected. 1501 // FALSE: Interrupt is not used to wake the device from low-power states. 1502 // This is the default. 1503 // 1504 BOOLEAN CanWakeDevice; 1505 1506 } WDF_INTERRUPT_CONFIG_V2_0, *PWDF_INTERRUPT_CONFIG_V2_0; 1507 1508 typedef struct _WDF_INTERRUPT_INFO_V2_0 { 1509 // 1510 // Size of this structure in bytes 1511 // 1512 ULONG Size; 1513 1514 ULONG64 Reserved1; 1515 1516 KAFFINITY TargetProcessorSet; 1517 1518 ULONG Reserved2; 1519 1520 ULONG MessageNumber; 1521 1522 ULONG Vector; 1523 1524 KIRQL Irql; 1525 1526 KINTERRUPT_MODE Mode; 1527 1528 WDF_INTERRUPT_POLARITY Polarity; 1529 1530 BOOLEAN MessageSignaled; 1531 1532 // CM_SHARE_DISPOSITION 1533 UCHAR ShareDisposition; 1534 1535 DECLSPEC_ALIGN(8) USHORT Group; 1536 1537 } WDF_INTERRUPT_INFO_V2_0, *PWDF_INTERRUPT_INFO_V2_0; 1538 1539 // 1540 // Interrupt Extended Policy Configuration Structure 1541 // 1542 typedef struct _WDF_INTERRUPT_EXTENDED_POLICY_V2_0 { 1543 // 1544 // Size of this structure in bytes 1545 // 1546 ULONG Size; 1547 1548 WDF_INTERRUPT_POLICY Policy; 1549 1550 WDF_INTERRUPT_PRIORITY Priority; 1551 1552 GROUP_AFFINITY TargetProcessorSetAndGroup; 1553 1554 } WDF_INTERRUPT_EXTENDED_POLICY_V2_0, *PWDF_INTERRUPT_EXTENDED_POLICY_V2_0; 1555 1556 // End of versioning of structures for wdfinterrupt.h 1557 1558 // 1559 // Versioning of structures for wdfio.h 1560 // 1561 // 1562 // This is the structure used to configure an IoQueue and 1563 // register callback events to it. 1564 // 1565 // 1566 typedef struct _WDF_IO_QUEUE_CONFIG_V2_0 { 1567 ULONG Size; 1568 1569 WDF_IO_QUEUE_DISPATCH_TYPE DispatchType; 1570 1571 WDF_TRI_STATE PowerManaged; 1572 1573 BOOLEAN AllowZeroLengthRequests; 1574 1575 BOOLEAN DefaultQueue; 1576 1577 PFN_WDF_IO_QUEUE_IO_DEFAULT EvtIoDefault; 1578 1579 PFN_WDF_IO_QUEUE_IO_READ EvtIoRead; 1580 1581 PFN_WDF_IO_QUEUE_IO_WRITE EvtIoWrite; 1582 1583 PFN_WDF_IO_QUEUE_IO_DEVICE_CONTROL EvtIoDeviceControl; 1584 1585 PFN_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL EvtIoInternalDeviceControl; 1586 1587 PFN_WDF_IO_QUEUE_IO_STOP EvtIoStop; 1588 1589 PFN_WDF_IO_QUEUE_IO_RESUME EvtIoResume; 1590 1591 PFN_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE EvtIoCanceledOnQueue; 1592 1593 union { 1594 struct { 1595 ULONG NumberOfPresentedRequests; 1596 1597 } Parallel; 1598 1599 } Settings; 1600 1601 WDFDRIVER Driver; 1602 1603 } WDF_IO_QUEUE_CONFIG_V2_0, *PWDF_IO_QUEUE_CONFIG_V2_0; 1604 1605 typedef struct _WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0 { 1606 ULONG Size; 1607 1608 ULONG TotalForwardProgressRequests; 1609 1610 // 1611 // Specify the type of the policy here. 1612 // 1613 WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY ForwardProgressReservedPolicy; 1614 1615 // 1616 // Structure which contains the policy specific fields 1617 // 1618 WDF_IO_FORWARD_PROGRESS_RESERVED_POLICY_SETTINGS ForwardProgressReservePolicySettings; 1619 1620 // 1621 // Callback for reserved request given at initialization time 1622 // 1623 PFN_WDF_IO_ALLOCATE_RESOURCES_FOR_RESERVED_REQUEST EvtIoAllocateResourcesForReservedRequest; 1624 1625 // 1626 // Callback for reserved request given at run time 1627 // 1628 PFN_WDF_IO_ALLOCATE_REQUEST_RESOURCES EvtIoAllocateRequestResources; 1629 1630 } WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0, *PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_V2_0; 1631 1632 // End of versioning of structures for wdfio.h 1633 1634 // 1635 // Versioning of structures for wdfIoTarget.h 1636 // 1637 typedef struct _WDF_IO_TARGET_OPEN_PARAMS_V2_0 { 1638 // 1639 // Size of this structure in bytes 1640 // 1641 ULONG Size; 1642 1643 // 1644 // Indicates which fields of this structure are going to be used in 1645 // creating the WDFIOTARGET. 1646 // 1647 WDF_IO_TARGET_OPEN_TYPE Type; 1648 1649 // 1650 // Notification when the target is being queried for removal. 1651 // If !NT_SUCCESS is returned, the query will fail and the target will 1652 // remain opened. 1653 // 1654 PFN_WDF_IO_TARGET_QUERY_REMOVE EvtIoTargetQueryRemove; 1655 1656 // 1657 // The previous query remove has been canceled and the target can now be 1658 // reopened. 1659 // 1660 PFN_WDF_IO_TARGET_REMOVE_CANCELED EvtIoTargetRemoveCanceled; 1661 1662 // 1663 // The query remove has succeeded and the target is now removed from the 1664 // system. 1665 // 1666 PFN_WDF_IO_TARGET_REMOVE_COMPLETE EvtIoTargetRemoveComplete; 1667 1668 // <KMDF_ONLY/> 1669 // ========== WdfIoTargetOpenUseExistingDevice begin ========== 1670 // 1671 // The device object to send requests to 1672 // 1673 PDEVICE_OBJECT TargetDeviceObject; 1674 1675 // <KMDF_ONLY/> 1676 // File object representing the TargetDeviceObject. The PFILE_OBJECT will 1677 // be passed as a parameter in all requests sent to the resulting 1678 // WDFIOTARGET. 1679 // 1680 PFILE_OBJECT TargetFileObject; 1681 1682 // ========== WdfIoTargetOpenUseExistingDevice end ========== 1683 // 1684 // ========== WdfIoTargetOpenByName begin ========== 1685 // 1686 // Name of the device to open. 1687 // 1688 UNICODE_STRING TargetDeviceName; 1689 1690 // <KMDF_DOC> 1691 // The access desired on the device being opened up, ie WDM FILE_XXX_ACCESS 1692 // such as FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, or 1693 // FILE_WRITE_ACCESS or you can use values such as GENERIC_READ, 1694 // GENERIC_WRITE, or GENERIC_ALL. 1695 // </KMDF_DOC> 1696 // <UMDF_DOC> 1697 // The requested access to the file or device, which can be summarized as 1698 // read, write, both or neither zero). For more information about 1699 // this member, see the dwDesiredAccess parameter of CreateFile in the 1700 // Windows SDK. Note that ACCESS_MASK data type is a DWORD value. 1701 // </UMDF_DOC> 1702 // 1703 ACCESS_MASK DesiredAccess; 1704 1705 // 1706 // <KMDF_DOC> 1707 // Share access desired on the target being opened, ie WDM FILE_SHARE_XXX 1708 // values such as FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE. 1709 // A zero value means exclusive access to the target. 1710 // 1711 // </KMDF_DOC> 1712 // <UMDF_DOC> 1713 // The type of sharing to allow for the file. For more information about 1714 // this member, see the dwShareMode parameter of CreateFile in the 1715 // Windows SDK. A value of 0 means exclusive access. 1716 // </UMDF_DOC> 1717 // 1718 ULONG ShareAccess; 1719 1720 // 1721 // <KMDF_DOC> 1722 // File attributes, see ZwCreateFile in the DDK for a list of valid 1723 // values and their meaning. 1724 // </KMDF_DOC> 1725 // <UMDF_DOC> 1726 // Additional flags and attributes for the file. For more information about 1727 // this member, see the dwFlagsAndAttributes parameter of CreateFile 1728 // in the Windows SDK. 1729 // </UMDF_DOC> 1730 // 1731 ULONG FileAttributes; 1732 1733 // 1734 // <KMDF_DOC> 1735 // Create disposition, see ZwCreateFile in the DDK for a list of valid 1736 // values and their meaning. 1737 // </KMDF_DOC> 1738 // <UMDF_DOC> 1739 // The action to take if the file already exists. For more information 1740 // about this member, see the dwCreationDisposition parameter of 1741 // CreateFile in the Windows SDK. 1742 // </UMDF_DOC> 1743 // 1744 ULONG CreateDisposition; 1745 1746 // 1747 // <KMDF_ONLY/> 1748 // Options for opening the device, see CreateOptions for ZwCreateFile in the 1749 // DDK for a list of valid values and their meaning. 1750 // 1751 ULONG CreateOptions; 1752 1753 // 1754 // <KMDF_ONLY/> 1755 // 1756 PVOID EaBuffer; 1757 1758 // 1759 // <KMDF_ONLY/> 1760 // 1761 ULONG EaBufferLength; 1762 1763 // 1764 // <KMDF_ONLY/> 1765 // 1766 PLONGLONG AllocationSize; 1767 1768 // ========== WdfIoTargetOpenByName end ========== 1769 // 1770 // 1771 // <KMDF_ONLY/> 1772 // 1773 // On return for a create by name, this will contain one of the following 1774 // values: FILE_CREATED, FILE_OPENED, FILE_OVERWRITTEN, FILE_SUPERSEDED, 1775 // FILE_EXISTS, FILE_DOES_NOT_EXIST 1776 // 1777 ULONG FileInformation; 1778 1779 // ========== WdfIoTargetOpenLocalTargetByFile begin ========== 1780 // 1781 // 1782 // <UMDF_ONLY/> A UNICODE_STRING-formatted string that contains the 1783 // name of the file to create a file object from. This parameter is 1784 // optional, and is applicable only when Type parameter is 1785 // WdfIoTargetOpenLocalTargetByFile. The driver can leave this member 1786 // unchanged if the driver does not have to create the file object 1787 // from a file name. If the driver must supply a name, the string that 1788 // the driver passes must not contain any path separator characters 1789 // ("/" or "\"). 1790 // 1791 UNICODE_STRING FileName; 1792 1793 } WDF_IO_TARGET_OPEN_PARAMS_V2_0, *PWDF_IO_TARGET_OPEN_PARAMS_V2_0; 1794 1795 // End of versioning of structures for wdfIoTarget.h 1796 1797 // 1798 // Versioning of structures for wdfMemory.h 1799 // 1800 typedef struct _WDFMEMORY_OFFSET_V2_0 { 1801 // 1802 // Offset into the WDFMEMORY that the operation should start at. 1803 // 1804 size_t BufferOffset; 1805 1806 // 1807 // Number of bytes that the operation should access. If 0, the entire 1808 // length of the WDFMEMORY buffer will be used in the operation or ignored 1809 // depending on the API. 1810 // 1811 size_t BufferLength; 1812 1813 } WDFMEMORY_OFFSET_V2_0, *PWDFMEMORY_OFFSET_V2_0; 1814 1815 typedef struct _WDF_MEMORY_DESCRIPTOR_V2_0 { 1816 WDF_MEMORY_DESCRIPTOR_TYPE Type; 1817 1818 union { 1819 struct { 1820 PVOID Buffer; 1821 1822 ULONG Length; 1823 1824 } BufferType; 1825 1826 struct { 1827 PMDL Mdl; 1828 1829 ULONG BufferLength; 1830 1831 } MdlType; 1832 1833 struct { 1834 WDFMEMORY Memory; 1835 1836 PWDFMEMORY_OFFSET_V2_0 Offsets; 1837 1838 } HandleType; 1839 1840 } u; 1841 1842 } WDF_MEMORY_DESCRIPTOR_V2_0, *PWDF_MEMORY_DESCRIPTOR_V2_0; 1843 1844 // End of versioning of structures for wdfMemory.h 1845 1846 // 1847 // Versioning of structures for wdfMiniport.h 1848 // 1849 // End of versioning of structures for wdfMiniport.h 1850 1851 // 1852 // Versioning of structures for wdfObject.h 1853 // 1854 typedef struct _WDF_OBJECT_ATTRIBUTES_V2_0 { 1855 // 1856 // Size in bytes of this structure 1857 // 1858 ULONG Size; 1859 1860 // 1861 // Function to call when the object is deleted 1862 // 1863 PFN_WDF_OBJECT_CONTEXT_CLEANUP EvtCleanupCallback; 1864 1865 // 1866 // Function to call when the objects memory is destroyed when the 1867 // the last reference count goes to zero 1868 // 1869 PFN_WDF_OBJECT_CONTEXT_DESTROY EvtDestroyCallback; 1870 1871 // 1872 // Execution level constraints for Object 1873 // 1874 WDF_EXECUTION_LEVEL ExecutionLevel; 1875 1876 // 1877 // Synchronization level constraint for Object 1878 // 1879 WDF_SYNCHRONIZATION_SCOPE SynchronizationScope; 1880 1881 // 1882 // Optional Parent Object 1883 // 1884 WDFOBJECT ParentObject; 1885 1886 // 1887 // Overrides the size of the context allocated as specified by 1888 // ContextTypeInfo->ContextSize 1889 // 1890 size_t ContextSizeOverride; 1891 1892 // 1893 // Pointer to the type information to be associated with the object 1894 // 1895 PCWDF_OBJECT_CONTEXT_TYPE_INFO_V2_0 ContextTypeInfo; 1896 1897 } WDF_OBJECT_ATTRIBUTES_V2_0, *PWDF_OBJECT_ATTRIBUTES_V2_0; 1898 1899 // 1900 // Since C does not have strong type checking we must invent our own 1901 // 1902 typedef struct _WDF_OBJECT_CONTEXT_TYPE_INFO_V2_0 { 1903 // 1904 // The size of this structure in bytes 1905 // 1906 ULONG Size; 1907 1908 // 1909 // String representation of the context's type name, i.e. "DEVICE_CONTEXT" 1910 // 1911 PCHAR ContextName; 1912 1913 // 1914 // The size of the context in bytes. This will be the size of the context 1915 // associated with the handle unless 1916 // WDF_OBJECT_ATTRIBUTES::ContextSizeOverride is specified. 1917 // 1918 size_t ContextSize; 1919 1920 // 1921 // If NULL, this structure is the unique type identifier for the context 1922 // type. If != NULL, the UniqueType pointer value is the unique type id 1923 // for the context type. 1924 // 1925 PCWDF_OBJECT_CONTEXT_TYPE_INFO_V2_0 UniqueType; 1926 1927 // 1928 // Function pointer to retrieve the context type information structure 1929 // pointer from the provider of the context type. This function is invoked 1930 // by the client driver's entry point by the KMDF stub after all class 1931 // drivers are loaded and before DriverEntry is invoked. 1932 // 1933 PFN_GET_UNIQUE_CONTEXT_TYPE EvtDriverGetUniqueContextType; 1934 1935 } WDF_OBJECT_CONTEXT_TYPE_INFO_V2_0, *PWDF_OBJECT_CONTEXT_TYPE_INFO_V2_0; 1936 1937 // 1938 // Core structure for supporting custom types, see macros below. 1939 // 1940 typedef struct _WDF_CUSTOM_TYPE_CONTEXT_V2_0 { 1941 ULONG Size; 1942 1943 ULONG_PTR Data; 1944 1945 } WDF_CUSTOM_TYPE_CONTEXT_V2_0, *PWDF_CUSTOM_TYPE_CONTEXT_V2_0; 1946 1947 // End of versioning of structures for wdfObject.h 1948 1949 // 1950 // Versioning of structures for wdfpdo.h 1951 // 1952 typedef struct _WDF_PDO_EVENT_CALLBACKS_V2_0 { 1953 // 1954 // The size of this structure in bytes 1955 // 1956 ULONG Size; 1957 1958 // 1959 // Called in response to IRP_MN_QUERY_RESOURCES 1960 // 1961 PFN_WDF_DEVICE_RESOURCES_QUERY EvtDeviceResourcesQuery; 1962 1963 // 1964 // Called in response to IRP_MN_QUERY_RESOURCE_REQUIREMENTS 1965 // 1966 PFN_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY EvtDeviceResourceRequirementsQuery; 1967 1968 // 1969 // Called in response to IRP_MN_EJECT 1970 // 1971 PFN_WDF_DEVICE_EJECT EvtDeviceEject; 1972 1973 // 1974 // Called in response to IRP_MN_SET_LOCK 1975 // 1976 PFN_WDF_DEVICE_SET_LOCK EvtDeviceSetLock; 1977 1978 // 1979 // Called in response to the power policy owner sending a wait wake to the 1980 // PDO. Bus generic arming shoulding occur here. 1981 // 1982 PFN_WDF_DEVICE_ENABLE_WAKE_AT_BUS EvtDeviceEnableWakeAtBus; 1983 1984 // 1985 // Called in response to the power policy owner sending a wait wake to the 1986 // PDO. Bus generic disarming shoulding occur here. 1987 // 1988 PFN_WDF_DEVICE_DISABLE_WAKE_AT_BUS EvtDeviceDisableWakeAtBus; 1989 1990 // 1991 // Called when reporting the PDO missing to PnP manager in response to 1992 // IRP_MN_QUERY_DEVICE_RELATIONS for Bus Relations. 1993 // 1994 PFN_WDF_DEVICE_REPORTED_MISSING EvtDeviceReportedMissing; 1995 1996 } WDF_PDO_EVENT_CALLBACKS_V2_0, *PWDF_PDO_EVENT_CALLBACKS_V2_0; 1997 1998 // End of versioning of structures for wdfpdo.h 1999 2000 // 2001 // Versioning of structures for wdfpool.h 2002 // 2003 // End of versioning of structures for wdfpool.h 2004 2005 // 2006 // Versioning of structures for wdfqueryinterface.h 2007 // 2008 typedef struct _WDF_QUERY_INTERFACE_CONFIG_V2_0 { 2009 // 2010 // Size of this structure in bytes. 2011 // 2012 ULONG Size; 2013 2014 // 2015 // Interface to be returned to the caller. Optional if BehaviorType is set 2016 // to WdfQueryInterfaceTypePassThrough or ImportInterface is set to TRUE. 2017 // 2018 PINTERFACE Interface; 2019 2020 // 2021 // The GUID identifying the interface 2022 // 2023 CONST GUID * InterfaceType; 2024 2025 // 2026 // Valid only for PDOs. The framework will allocate a new request and 2027 // forward it down the parent's device stack. 2028 // 2029 BOOLEAN SendQueryToParentStack; 2030 2031 // 2032 // Driver supplied callback which is called after some basic interface 2033 // validation has been performed (size, version, and guid checking). This 2034 // is an optional parameter and may be NULL unless ImportInterface is 2035 // specified. 2036 // 2037 // If the callback returns !NT_SUCCESS, this error will be returned to the 2038 // caller and the query interface will fail. 2039 // 2040 // In this callback, the caller is free to modify the ExposedInterface in 2041 // any manner of its choosing. For instance, the callback may change any 2042 // field in the interface. The callback may also alloate a dynamic context 2043 // to be associated with the interface; the InterfaceReference and 2044 // InterfaceDereference functions may also be overridden. 2045 // 2046 // If ImportInterface is set to TRUE, then this is a required field and the 2047 // callback must initialize the interface (the framework will leave the 2048 // ExposedInterface buffer exactly as it received it) since the framework 2049 // has no way of knowing which fields to fill in and which to leave alone. 2050 // 2051 PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST EvtDeviceProcessQueryInterfaceRequest; 2052 2053 // 2054 // If TRUE, the interface provided by the caller contains data that the 2055 // driver is interested in. By setting to this field to TRUE, the 2056 // EvtDeviceProcessQueryInterfaceRequest callback must initialize the 2057 // ExposedInterface. 2058 // 2059 // If FALSE, the entire ExposedInterface is initialized through a memory 2060 // copy before the EvtDeviceProcessQueryInterfaceRequest is called. 2061 // 2062 BOOLEAN ImportInterface; 2063 2064 } WDF_QUERY_INTERFACE_CONFIG_V2_0, *PWDF_QUERY_INTERFACE_CONFIG_V2_0; 2065 2066 // End of versioning of structures for wdfqueryinterface.h 2067 2068 // 2069 // Versioning of structures for wdfregistry.h 2070 // 2071 // End of versioning of structures for wdfregistry.h 2072 2073 // 2074 // Versioning of structures for wdfrequest.h 2075 // 2076 // 2077 // This parameters structure allows general access to a requests parameters 2078 // 2079 typedef struct _WDF_REQUEST_PARAMETERS_V2_0 { 2080 USHORT Size; 2081 2082 UCHAR MinorFunction; 2083 2084 WDF_REQUEST_TYPE Type; 2085 2086 // 2087 // The following user parameters are based on the service that is being 2088 // invoked. Drivers and file systems can determine which set to use based 2089 // on the above major and minor function codes. 2090 // 2091 union { 2092 // 2093 // System service parameters for: Create 2094 // 2095 // 2096 struct { 2097 PIO_SECURITY_CONTEXT SecurityContext; 2098 2099 ULONG Options; 2100 2101 USHORT POINTER_ALIGNMENT FileAttributes; 2102 2103 USHORT ShareAccess; 2104 2105 ULONG POINTER_ALIGNMENT EaLength; 2106 2107 } Create; 2108 2109 // 2110 // System service parameters for: Read 2111 // 2112 // 2113 struct { 2114 size_t Length; 2115 2116 ULONG POINTER_ALIGNMENT Key; 2117 2118 LONGLONG DeviceOffset; 2119 2120 } Read; 2121 2122 // 2123 // System service parameters for: Write 2124 // 2125 // 2126 struct { 2127 size_t Length; 2128 2129 ULONG POINTER_ALIGNMENT Key; 2130 2131 LONGLONG DeviceOffset; 2132 2133 } Write; 2134 2135 // 2136 // System service parameters for: Device Control 2137 // 2138 // Note that the user's output buffer is stored in the UserBuffer field 2139 // and the user's input buffer is stored in the SystemBuffer field. 2140 // 2141 // 2142 struct { 2143 size_t OutputBufferLength; 2144 2145 size_t POINTER_ALIGNMENT InputBufferLength; 2146 2147 ULONG POINTER_ALIGNMENT IoControlCode; 2148 2149 PVOID Type3InputBuffer; 2150 2151 } DeviceIoControl; 2152 2153 struct { 2154 PVOID Arg1; 2155 2156 PVOID Arg2; 2157 2158 ULONG POINTER_ALIGNMENT IoControlCode; 2159 2160 PVOID Arg4; 2161 2162 } Others; 2163 2164 } Parameters; 2165 2166 } WDF_REQUEST_PARAMETERS_V2_0, *PWDF_REQUEST_PARAMETERS_V2_0; 2167 2168 typedef struct _WDF_REQUEST_COMPLETION_PARAMS_V2_0 { 2169 // 2170 // Size of the structure in bytes 2171 // 2172 ULONG Size; 2173 2174 WDF_REQUEST_TYPE Type; 2175 2176 IO_STATUS_BLOCK IoStatus; 2177 2178 union { 2179 struct { 2180 WDFMEMORY Buffer; 2181 2182 size_t Length; 2183 2184 size_t Offset; 2185 2186 } Write; 2187 2188 struct { 2189 WDFMEMORY Buffer; 2190 2191 size_t Length; 2192 2193 size_t Offset; 2194 2195 } Read; 2196 2197 struct { 2198 ULONG IoControlCode; 2199 2200 struct { 2201 WDFMEMORY Buffer; 2202 2203 size_t Offset; 2204 2205 } Input; 2206 2207 struct { 2208 WDFMEMORY Buffer; 2209 2210 size_t Offset; 2211 2212 size_t Length; 2213 2214 } Output; 2215 2216 } Ioctl; 2217 2218 struct { 2219 union { 2220 PVOID Ptr; 2221 2222 ULONG_PTR Value; 2223 2224 } Argument1; 2225 2226 union { 2227 PVOID Ptr; 2228 2229 ULONG_PTR Value; 2230 2231 } Argument2; 2232 2233 union { 2234 PVOID Ptr; 2235 2236 ULONG_PTR Value; 2237 2238 } Argument3; 2239 2240 union { 2241 PVOID Ptr; 2242 2243 ULONG_PTR Value; 2244 2245 } Argument4; 2246 2247 } Others; 2248 2249 struct { 2250 PWDF_USB_REQUEST_COMPLETION_PARAMS_V2_0 Completion; 2251 2252 } Usb; 2253 2254 } Parameters; 2255 2256 } WDF_REQUEST_COMPLETION_PARAMS_V2_0, *PWDF_REQUEST_COMPLETION_PARAMS_V2_0; 2257 2258 typedef struct _WDF_REQUEST_REUSE_PARAMS_V2_0 { 2259 // 2260 // Size of this structure in bytes 2261 // 2262 ULONG Size; 2263 2264 // 2265 // Bit field combination of WDF_REQUEST_REUSE_Xxx values 2266 // 2267 ULONG Flags; 2268 2269 // 2270 // The new status of the request. 2271 // 2272 NTSTATUS Status; 2273 2274 // 2275 // New PIRP to be contained in the WDFREQUEST. Setting a new PIRP value 2276 // is only valid for WDFREQUESTs created by WdfRequestCreateFromIrp where 2277 // RequestFreesIrp == FALSE. No other WDFREQUESTs (presented by the 2278 // I/O queue for instance) may have their IRPs changed. 2279 // 2280 PIRP NewIrp; 2281 2282 } WDF_REQUEST_REUSE_PARAMS_V2_0, *PWDF_REQUEST_REUSE_PARAMS_V2_0; 2283 2284 typedef struct _WDF_REQUEST_SEND_OPTIONS_V2_0 { 2285 // 2286 // Size of the structure in bytes 2287 // 2288 ULONG Size; 2289 2290 // 2291 // Bit field combination of values from the WDF_REQUEST_SEND_OPTIONS_FLAGS 2292 // enumeration 2293 // 2294 ULONG Flags; 2295 2296 // 2297 // Valid when WDF_REQUEST_SEND_OPTION_TIMEOUT is set 2298 // 2299 LONGLONG Timeout; 2300 2301 } WDF_REQUEST_SEND_OPTIONS_V2_0, *PWDF_REQUEST_SEND_OPTIONS_V2_0; 2302 2303 typedef struct _WDF_REQUEST_FORWARD_OPTIONS_V2_0 { 2304 // 2305 // Size of the structure in bytes 2306 // 2307 ULONG Size; 2308 2309 // 2310 // Bit field combination of values from the WDF_REQUEST_FORWARD_OPTIONS_FLAGS 2311 // enumeration 2312 // 2313 ULONG Flags; 2314 2315 } WDF_REQUEST_FORWARD_OPTIONS_V2_0, *PWDF_REQUEST_FORWARD_OPTIONS_V2_0; 2316 2317 // End of versioning of structures for wdfrequest.h 2318 2319 // 2320 // Versioning of structures for wdfresource.h 2321 // 2322 // End of versioning of structures for wdfresource.h 2323 2324 // 2325 // Versioning of structures for wdfroletypes.h 2326 // 2327 // End of versioning of structures for wdfroletypes.h 2328 2329 // 2330 // Versioning of structures for wdfstring.h 2331 // 2332 // End of versioning of structures for wdfstring.h 2333 2334 // 2335 // Versioning of structures for wdfsync.h 2336 // 2337 // End of versioning of structures for wdfsync.h 2338 2339 // 2340 // Versioning of structures for wdftimer.h 2341 // 2342 typedef struct _WDF_TIMER_CONFIG_V2_0 { 2343 ULONG Size; 2344 2345 PFN_WDF_TIMER EvtTimerFunc; 2346 2347 ULONG Period; 2348 2349 // 2350 // If this is TRUE, the Timer will automatically serialize 2351 // with the event callback handlers of its Parent Object. 2352 // 2353 // Parent Object's callback constraints should be compatible 2354 // with the Timer DPC (DISPATCH_LEVEL), or the request will fail. 2355 // 2356 BOOLEAN AutomaticSerialization; 2357 2358 // 2359 // Optional tolerance for the timer in milliseconds. 2360 // 2361 ULONG TolerableDelay; 2362 2363 // 2364 // If this is TRUE, high resolution timers will be used. The default 2365 // value is FALSE 2366 // 2367 DECLSPEC_ALIGN(8) BOOLEAN UseHighResolutionTimer; 2368 2369 } WDF_TIMER_CONFIG_V2_0, *PWDF_TIMER_CONFIG_V2_0; 2370 2371 // End of versioning of structures for wdftimer.h 2372 2373 // 2374 // Versioning of structures for wdftriage.h 2375 // 2376 typedef struct _WDFOBJECT_TRIAGE_INFO_V2_0 { 2377 // value 2378 ULONG RawObjectSize; 2379 2380 ULONG ObjectType; 2381 2382 ULONG TotalObjectSize; 2383 2384 ULONG ChildListHead; 2385 2386 ULONG ChildEntry; 2387 2388 ULONG Globals; 2389 2390 ULONG ParentObject; 2391 2392 } WDFOBJECT_TRIAGE_INFO_V2_0, *PWDFOBJECT_TRIAGE_INFO_V2_0; 2393 2394 typedef struct _WDFCONTEXT_TRIAGE_INFO_V2_0 { 2395 // value 2396 ULONG HeaderSize; 2397 2398 ULONG NextHeader; 2399 2400 ULONG Object; 2401 2402 ULONG TypeInfoPtr; 2403 2404 ULONG Context; 2405 2406 } WDFCONTEXT_TRIAGE_INFO_V2_0, *PWDFCONTEXT_TRIAGE_INFO_V2_0; 2407 2408 typedef struct _WDFCONTEXTTYPE_TRIAGE_INFO_V2_0 { 2409 // value 2410 ULONG TypeInfoSize; 2411 2412 ULONG ContextSize; 2413 2414 ULONG ContextName; 2415 2416 } WDFCONTEXTTYPE_TRIAGE_INFO_V2_0, *PWDFCONTEXTTYPE_TRIAGE_INFO_V2_0; 2417 2418 typedef struct _WDFQUEUE_TRIAGE_INFO_V2_0 { 2419 // value 2420 ULONG QueueSize; 2421 2422 ULONG IrpQueue1; 2423 2424 ULONG IrpQueue2; 2425 2426 ULONG RequestList1; 2427 2428 ULONG RequestList2; 2429 2430 ULONG FwdProgressContext; 2431 2432 ULONG PkgIo; 2433 2434 } WDFQUEUE_TRIAGE_INFO_V2_0, *PWDFQUEUE_TRIAGE_INFO_V2_0; 2435 2436 typedef struct _WDFFWDPROGRESS_TRIAGE_INFO_V2_0 { 2437 ULONG ReservedRequestList; 2438 2439 ULONG ReservedRequestInUseList; 2440 2441 ULONG PendedIrpList; 2442 2443 } WDFFWDPROGRESS_TRIAGE_INFO_V2_0, *PWDFFWDPROGRESS_TRIAGE_INFO_V2_0; 2444 2445 typedef struct _WDFIRPQUEUE_TRIAGE_INFO_V2_0 { 2446 // value 2447 ULONG IrpQueueSize; 2448 2449 ULONG IrpListHeader; 2450 2451 ULONG IrpListEntry; 2452 2453 ULONG IrpContext; 2454 2455 } WDFIRPQUEUE_TRIAGE_INFO_V2_0, *PWDFIRPQUEUE_TRIAGE_INFO_V2_0; 2456 2457 typedef struct _WDFREQUEST_TRIAGE_INFO_V2_0 { 2458 // value 2459 ULONG RequestSize; 2460 2461 ULONG CsqContext; 2462 2463 // WDF irp wrapper, see below. 2464 ULONG FxIrp; 2465 2466 ULONG ListEntryQueueOwned; 2467 2468 ULONG ListEntryQueueOwned2; 2469 2470 ULONG RequestListEntry; 2471 2472 ULONG FwdProgressList; 2473 2474 } WDFREQUEST_TRIAGE_INFO_V2_0, *PWDFREQUEST_TRIAGE_INFO_V2_0; 2475 2476 typedef struct _WDFDEVICE_TRIAGE_INFO_V2_0 { 2477 // value 2478 ULONG DeviceInitSize; 2479 2480 ULONG DeviceDriver; 2481 2482 } WDFDEVICE_TRIAGE_INFO_V2_0, *PWDFDEVICE_TRIAGE_INFO_V2_0; 2483 2484 typedef struct _WDFIRP_TRIAGE_INFO_V2_0 { 2485 // value 2486 ULONG FxIrpSize; 2487 2488 ULONG IrpPtr; 2489 2490 } WDFIRP_TRIAGE_INFO_V2_0, *PWDFIRP_TRIAGE_INFO_V2_0; 2491 2492 typedef struct _WDF_TRIAGE_INFO_V2_0 { 2493 // 2494 // Version. 2495 // 2496 ULONG WdfMajorVersion; 2497 2498 ULONG WdfMinorVersion; 2499 2500 ULONG TriageInfoMajorVersion; 2501 2502 ULONG TriageInfoMinorVersion; 2503 2504 // 2505 // Reserved pointer. 2506 // 2507 PVOID Reserved; 2508 2509 // 2510 // WDF objects triage info. 2511 // 2512 PWDFOBJECT_TRIAGE_INFO_V2_0 WdfObjectTriageInfo; 2513 2514 PWDFCONTEXT_TRIAGE_INFO_V2_0 WdfContextTriageInfo; 2515 2516 PWDFCONTEXTTYPE_TRIAGE_INFO_V2_0 WdfContextTypeTriageInfo; 2517 2518 PWDFQUEUE_TRIAGE_INFO_V2_0 WdfQueueTriageInfo; 2519 2520 PWDFFWDPROGRESS_TRIAGE_INFO_V2_0 WdfFwdProgressTriageInfo; 2521 2522 PWDFIRPQUEUE_TRIAGE_INFO_V2_0 WdfIrpQueueTriageInfo; 2523 2524 PWDFREQUEST_TRIAGE_INFO_V2_0 WdfRequestTriageInfo; 2525 2526 PWDFDEVICE_TRIAGE_INFO_V2_0 WdfDeviceTriageInfo; 2527 2528 PWDFIRP_TRIAGE_INFO_V2_0 WdfIrpTriageInfo; 2529 2530 } WDF_TRIAGE_INFO_V2_0, *PWDF_TRIAGE_INFO_V2_0; 2531 2532 // End of versioning of structures for wdftriage.h 2533 2534 // 2535 // Versioning of structures for wdftypes.h 2536 // 2537 // End of versioning of structures for wdftypes.h 2538 2539 // 2540 // Versioning of structures for wdfUsb.h 2541 // 2542 typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS_V2_0 { 2543 USBD_STATUS UsbdStatus; 2544 2545 WDF_USB_REQUEST_TYPE Type; 2546 2547 union { 2548 struct { 2549 WDFMEMORY Buffer; 2550 2551 USHORT LangID; 2552 2553 UCHAR StringIndex; 2554 2555 // 2556 // If STATUS_BUFFER_OVERFLOW is returned, this field will contain the 2557 // number of bytes required to retrieve the entire string. 2558 // 2559 UCHAR RequiredSize; 2560 2561 } DeviceString; 2562 2563 struct { 2564 WDFMEMORY Buffer; 2565 2566 WDF_USB_CONTROL_SETUP_PACKET SetupPacket; 2567 2568 ULONG Length; 2569 2570 } DeviceControlTransfer; 2571 2572 struct { 2573 WDFMEMORY Buffer; 2574 2575 } DeviceUrb; 2576 2577 struct { 2578 WDFMEMORY Buffer; 2579 2580 size_t Length; 2581 2582 size_t Offset; 2583 2584 } PipeWrite; 2585 2586 struct { 2587 WDFMEMORY Buffer; 2588 2589 size_t Length; 2590 2591 size_t Offset; 2592 2593 } PipeRead; 2594 2595 struct { 2596 WDFMEMORY Buffer; 2597 2598 } PipeUrb; 2599 2600 } Parameters; 2601 2602 } WDF_USB_REQUEST_COMPLETION_PARAMS_V2_0, *PWDF_USB_REQUEST_COMPLETION_PARAMS_V2_0; 2603 2604 typedef struct _WDF_USB_CONTINUOUS_READER_CONFIG_V2_0 { 2605 // 2606 // Size of the string in bytes 2607 // 2608 ULONG Size; 2609 2610 // 2611 // Number of bytes to send ask for from the usb device. 2612 // 2613 size_t TransferLength; 2614 2615 // 2616 // Number of bytes to allocate before the requested transfer length 2617 // 2618 size_t HeaderLength; 2619 2620 // 2621 // Number of bytes to allocate after the requested transfer length 2622 // 2623 size_t TrailerLength; 2624 2625 // 2626 // Number of reads to send to the device at once. If zero is specified, the 2627 // default will be used. 2628 // 2629 UCHAR NumPendingReads; 2630 2631 // 2632 // Optional attributes to apply to each WDFMEMORY allocated for each read 2633 // 2634 PWDF_OBJECT_ATTRIBUTES_V2_0 BufferAttributes; 2635 2636 // 2637 // Event callback invoked when a read is completed 2638 // 2639 PFN_WDF_USB_READER_COMPLETION_ROUTINE EvtUsbTargetPipeReadComplete; 2640 2641 // 2642 // Context to be passed to EvtUsbTargetPipeReadComplete 2643 // 2644 WDFCONTEXT EvtUsbTargetPipeReadCompleteContext; 2645 2646 // 2647 // Event callback invoked when a reader fails. If TRUE is returned, the 2648 // readers are restarted. 2649 // 2650 PFN_WDF_USB_READERS_FAILED EvtUsbTargetPipeReadersFailed; 2651 2652 } WDF_USB_CONTINUOUS_READER_CONFIG_V2_0, *PWDF_USB_CONTINUOUS_READER_CONFIG_V2_0; 2653 2654 typedef struct _WDF_USB_DEVICE_INFORMATION_V2_0 { 2655 // 2656 // Size of this structure in bytes 2657 // 2658 ULONG Size; 2659 2660 // 2661 // USBD version information 2662 // 2663 USBD_VERSION_INFORMATION UsbdVersionInformation; 2664 2665 // 2666 // Usb controller port capabilities 2667 // 2668 ULONG HcdPortCapabilities; 2669 2670 // 2671 // Bitfield of WDF_USB_DEVICE_TRAITS values 2672 // 2673 ULONG Traits; 2674 2675 } WDF_USB_DEVICE_INFORMATION_V2_0, *PWDF_USB_DEVICE_INFORMATION_V2_0; 2676 2677 typedef struct _WDF_USB_INTERFACE_SETTING_PAIR_V2_0 { 2678 // 2679 // Interface to select 2680 // 2681 WDFUSBINTERFACE UsbInterface; 2682 2683 // 2684 // Setting to select on UsbInterface 2685 // 2686 UCHAR SettingIndex; 2687 2688 } WDF_USB_INTERFACE_SETTING_PAIR_V2_0, *PWDF_USB_INTERFACE_SETTING_PAIR_V2_0; 2689 2690 typedef struct _WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0 { 2691 // 2692 // Size of the structure in bytes 2693 // 2694 ULONG Size; 2695 2696 // 2697 // Type of select config, one of WdfUsbTargetDeviceSelectConfigType values 2698 // 2699 WdfUsbTargetDeviceSelectConfigType Type; 2700 2701 union { 2702 struct { 2703 // 2704 // Configuration descriptor to use 2705 // 2706 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; 2707 2708 // 2709 // Array of interface descriptors pointers. 2710 // 2711 PUSB_INTERFACE_DESCRIPTOR * InterfaceDescriptors; 2712 2713 // 2714 // Number of elements in the InterfaceDescrtiptors pointer array. 2715 // 2716 ULONG NumInterfaceDescriptors; 2717 2718 } Descriptor; 2719 2720 struct { 2721 // 2722 // Preallocated select config URB formatted by the caller. 2723 // Will be used, as supplied without modification, as the select 2724 // config request. 2725 // 2726 PURB Urb; 2727 2728 } Urb; 2729 2730 struct { 2731 // 2732 // Number of pipes configured on the single after. This value is 2733 // returned to the caller after a succssful call. 2734 // 2735 UCHAR NumberConfiguredPipes; 2736 2737 // 2738 // The interface which was configred. This value is returned to the 2739 // caller after a successful call. 2740 // 2741 WDFUSBINTERFACE ConfiguredUsbInterface; 2742 2743 } SingleInterface; 2744 2745 struct { 2746 // 2747 // Number of interface pairs in the Pairs array 2748 // 2749 UCHAR NumberInterfaces; 2750 2751 // 2752 // Array of interface + settings 2753 // 2754 PWDF_USB_INTERFACE_SETTING_PAIR_V2_0 Pairs; 2755 2756 // 2757 // Number of interfaces which were configured after a successful call 2758 // 2759 UCHAR NumberOfConfiguredInterfaces; 2760 2761 } MultiInterface; 2762 2763 } Types; 2764 2765 } WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0, *PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS_V2_0; 2766 2767 typedef struct _WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0 { 2768 // 2769 // Size of this data structure in bytes 2770 // 2771 ULONG Size; 2772 2773 // 2774 // Type of select interface as indicated by one of the 2775 // WdfUsbTargetDeviceSelectSettingType values. 2776 // 2777 WdfUsbTargetDeviceSelectSettingType Type; 2778 2779 union { 2780 struct { 2781 // 2782 // Interface descriptor that will be used in the interface selection 2783 // 2784 PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; 2785 2786 } Descriptor; 2787 2788 struct { 2789 // 2790 // The setting index of the WDFUSBINTERFACE to use 2791 // 2792 UCHAR SettingIndex; 2793 2794 } Interface; 2795 2796 struct { 2797 // 2798 // Preformatted select interface URB which will be used in the 2799 // select interface request. 2800 // 2801 PURB Urb; 2802 2803 } Urb; 2804 2805 } Types; 2806 2807 } WDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0, *PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS_V2_0; 2808 2809 typedef struct _WDF_USB_PIPE_INFORMATION_V2_0 { 2810 // 2811 // Size of the structure in bytes 2812 // 2813 ULONG Size; 2814 2815 // 2816 // Maximum packet size this device is capable of 2817 // 2818 ULONG MaximumPacketSize; 2819 2820 // 2821 // Raw endpoint address of the device as described by its descriptor 2822 // 2823 UCHAR EndpointAddress; 2824 2825 // 2826 // Polling interval 2827 // 2828 UCHAR Interval; 2829 2830 // 2831 // Which alternate setting this structure is relevant for 2832 // 2833 UCHAR SettingIndex; 2834 2835 // 2836 // The type of the pipe 2837 WDF_USB_PIPE_TYPE PipeType; 2838 2839 // 2840 // Maximum size of one transfer which should be sent to the host controller 2841 // 2842 ULONG MaximumTransferSize; 2843 2844 } WDF_USB_PIPE_INFORMATION_V2_0, *PWDF_USB_PIPE_INFORMATION_V2_0; 2845 2846 typedef struct _WDF_USB_DEVICE_CREATE_CONFIG_V2_0 { 2847 // 2848 // Size of this structure in bytes 2849 // 2850 ULONG Size; 2851 2852 // 2853 // USBD Client Contraction of the Wdf Client 2854 // 2855 ULONG USBDClientContractVersion; 2856 2857 } WDF_USB_DEVICE_CREATE_CONFIG_V2_0, *PWDF_USB_DEVICE_CREATE_CONFIG_V2_0; 2858 2859 // End of versioning of structures for wdfUsb.h 2860 2861 // 2862 // Versioning of structures for wdfverifier.h 2863 // 2864 // End of versioning of structures for wdfverifier.h 2865 2866 // 2867 // Versioning of structures for wdfWMI.h 2868 // 2869 typedef struct _WDF_WMI_PROVIDER_CONFIG_V2_0 { 2870 // 2871 // Size of this structure in bytes 2872 // 2873 ULONG Size; 2874 2875 // 2876 // The GUID being registered 2877 // 2878 GUID Guid; 2879 2880 // 2881 // Combination of values from the enum WDF_WMI_PROVIDER_FLAGS 2882 // 2883 ULONG Flags; 2884 2885 // 2886 // Minimum expected buffer size for query and set instance requests. 2887 // Ignored if WdfWmiProviderEventOnly is set in Flags. 2888 // 2889 ULONG MinInstanceBufferSize; 2890 2891 // 2892 // Callback when caller is opening a provider which ha been marked as 2893 // expensive or when a caller is interested in events. 2894 // 2895 PFN_WDF_WMI_PROVIDER_FUNCTION_CONTROL EvtWmiProviderFunctionControl; 2896 2897 } WDF_WMI_PROVIDER_CONFIG_V2_0, *PWDF_WMI_PROVIDER_CONFIG_V2_0; 2898 2899 typedef struct _WDF_WMI_INSTANCE_CONFIG_V2_0 { 2900 // 2901 // Size of the structure in bytes 2902 // 2903 ULONG Size; 2904 2905 // 2906 // Optional parameter. If NULL, ProviderConfig must be set to a valid pointer 2907 // value. If specified, indicates the provider to create an instance for. 2908 // 2909 WDFWMIPROVIDER Provider; 2910 2911 // 2912 // Optional parameter. If NULL, Provider must be set to a valid handle 2913 // value. If specifeid, indicates the configuration for a provider to be 2914 // created and for this instance to be associated with. 2915 // 2916 PWDF_WMI_PROVIDER_CONFIG_V2_0 ProviderConfig; 2917 2918 // 2919 // If the Provider is configured as read only and this field is set to TRUE, 2920 // the EvtWmiInstanceQueryInstance is ignored and WDF will blindly copy the 2921 // context associated with this instance (using RtlCopyMemory, with no locks 2922 // held) into the query buffer. 2923 // 2924 BOOLEAN UseContextForQuery; 2925 2926 // 2927 // If TRUE, the instance will be registered as well as created. 2928 // 2929 BOOLEAN Register; 2930 2931 // 2932 // Callback when caller wants to query the entire data item's buffer. 2933 // 2934 PFN_WDF_WMI_INSTANCE_QUERY_INSTANCE EvtWmiInstanceQueryInstance; 2935 2936 // 2937 // Callback when caller wants to set the entire data item's buffer. 2938 // 2939 PFN_WDF_WMI_INSTANCE_SET_INSTANCE EvtWmiInstanceSetInstance; 2940 2941 // 2942 // Callback when caller wants to set a single field in the data item's buffer 2943 // 2944 PFN_WDF_WMI_INSTANCE_SET_ITEM EvtWmiInstanceSetItem; 2945 2946 // 2947 // Callback when caller wants to execute a method on the data item. 2948 // 2949 PFN_WDF_WMI_INSTANCE_EXECUTE_METHOD EvtWmiInstanceExecuteMethod; 2950 2951 } WDF_WMI_INSTANCE_CONFIG_V2_0, *PWDF_WMI_INSTANCE_CONFIG_V2_0; 2952 2953 // End of versioning of structures for wdfWMI.h 2954 2955 // 2956 // Versioning of structures for wdfworkitem.h 2957 // 2958 typedef struct _WDF_WORKITEM_CONFIG_V2_0 { 2959 ULONG Size; 2960 2961 PFN_WDF_WORKITEM EvtWorkItemFunc; 2962 2963 // 2964 // If this is TRUE, the workitem will automatically serialize 2965 // with the event callback handlers of its Parent Object. 2966 // 2967 // Parent Object's callback constraints should be compatible 2968 // with the work item (PASSIVE_LEVEL), or the request will fail. 2969 // 2970 BOOLEAN AutomaticSerialization; 2971 2972 } WDF_WORKITEM_CONFIG_V2_0, *PWDF_WORKITEM_CONFIG_V2_0; 2973 2974 // End of versioning of structures for wdfworkitem.h 2975 2976 2977 #endif // _WDF_V2_0_TYPES_H_ 2978