1 /*++ 2 3 Module Name: VfWdfDynamics.cpp 4 5 Abstract: 6 Generated implementation for WDF API Verifier hooks 7 8 Environment: 9 user mode only 10 11 --*/ 12 13 #include "fxmin.hpp" 14 #include "vfpriv.hpp" 15 16 extern "C" { 17 #include "FxDynamics.h" 18 } 19 20 21 extern "C" { 22 extern WDFVERSION WdfVersion; 23 } 24 25 #ifdef ALLOC_PRAGMA 26 #pragma alloc_text(FX_ENHANCED_VERIFIER_SECTION_NAME, \ 27 VFWDFEXPORT(WdfCollectionCreate), \ 28 VFWDFEXPORT(WdfCollectionGetCount), \ 29 VFWDFEXPORT(WdfCollectionAdd), \ 30 VFWDFEXPORT(WdfCollectionRemove), \ 31 VFWDFEXPORT(WdfCollectionRemoveItem), \ 32 VFWDFEXPORT(WdfCollectionGetItem), \ 33 VFWDFEXPORT(WdfCollectionGetFirstItem), \ 34 VFWDFEXPORT(WdfCollectionGetLastItem), \ 35 VFWDFEXPORT(WdfCxDeviceInitAllocate), \ 36 VFWDFEXPORT(WdfCxDeviceInitSetRequestAttributes), \ 37 VFWDFEXPORT(WdfCxDeviceInitSetFileObjectConfig), \ 38 VFWDFEXPORT(WdfCxVerifierKeBugCheck), \ 39 VFWDFEXPORT(WdfDeviceGetDeviceState), \ 40 VFWDFEXPORT(WdfDeviceSetDeviceState), \ 41 VFWDFEXPORT(WdfDeviceWdmDispatchIrp), \ 42 VFWDFEXPORT(WdfDeviceWdmDispatchIrpToIoQueue), \ 43 VFWDFEXPORT(WdfDeviceGetDriver), \ 44 VFWDFEXPORT(WdfDeviceGetIoTarget), \ 45 VFWDFEXPORT(WdfDeviceAssignS0IdleSettings), \ 46 VFWDFEXPORT(WdfDeviceAssignSxWakeSettings), \ 47 VFWDFEXPORT(WdfDeviceOpenRegistryKey), \ 48 VFWDFEXPORT(WdfDeviceOpenDevicemapKey), \ 49 VFWDFEXPORT(WdfDeviceInitSetPnpPowerEventCallbacks), \ 50 VFWDFEXPORT(WdfDeviceInitSetPowerPolicyEventCallbacks), \ 51 VFWDFEXPORT(WdfDeviceInitSetPowerPolicyOwnership), \ 52 VFWDFEXPORT(WdfDeviceInitSetIoType), \ 53 VFWDFEXPORT(WdfDeviceInitSetFileObjectConfig), \ 54 VFWDFEXPORT(WdfDeviceInitSetRequestAttributes), \ 55 VFWDFEXPORT(WdfDeviceCreate), \ 56 VFWDFEXPORT(WdfDeviceSetStaticStopRemove), \ 57 VFWDFEXPORT(WdfDeviceCreateDeviceInterface), \ 58 VFWDFEXPORT(WdfDeviceSetDeviceInterfaceState), \ 59 VFWDFEXPORT(WdfDeviceRetrieveDeviceInterfaceString), \ 60 VFWDFEXPORT(WdfDeviceCreateSymbolicLink), \ 61 VFWDFEXPORT(WdfDeviceQueryProperty), \ 62 VFWDFEXPORT(WdfDeviceAllocAndQueryProperty), \ 63 VFWDFEXPORT(WdfDeviceSetPnpCapabilities), \ 64 VFWDFEXPORT(WdfDeviceSetPowerCapabilities), \ 65 VFWDFEXPORT(WdfDeviceSetFailed), \ 66 VFWDFEXPORT(WdfDeviceStopIdleNoTrack), \ 67 VFWDFEXPORT(WdfDeviceResumeIdleNoTrack), \ 68 VFWDFEXPORT(WdfDeviceStopIdleActual), \ 69 VFWDFEXPORT(WdfDeviceResumeIdleActual), \ 70 VFWDFEXPORT(WdfDeviceGetFileObject), \ 71 VFWDFEXPORT(WdfDeviceGetDefaultQueue), \ 72 VFWDFEXPORT(WdfDeviceConfigureRequestDispatching), \ 73 VFWDFEXPORT(WdfDeviceConfigureWdmIrpDispatchCallback), \ 74 VFWDFEXPORT(WdfDeviceGetSystemPowerAction), \ 75 VFWDFEXPORT(WdfDeviceInitSetReleaseHardwareOrderOnFailure), \ 76 VFWDFEXPORT(WdfDeviceInitSetIoTypeEx), \ 77 VFWDFEXPORT(WdfDevicePostEvent), \ 78 VFWDFEXPORT(WdfDeviceMapIoSpace), \ 79 VFWDFEXPORT(WdfDeviceUnmapIoSpace), \ 80 VFWDFEXPORT(WdfDeviceGetHardwareRegisterMappedAddress), \ 81 VFWDFEXPORT(WdfDeviceReadFromHardware), \ 82 VFWDFEXPORT(WdfDeviceWriteToHardware), \ 83 VFWDFEXPORT(WdfDeviceAssignInterfaceProperty), \ 84 VFWDFEXPORT(WdfDeviceAllocAndQueryInterfaceProperty), \ 85 VFWDFEXPORT(WdfDeviceQueryInterfaceProperty), \ 86 VFWDFEXPORT(WdfDeviceGetDeviceStackIoType), \ 87 VFWDFEXPORT(WdfDeviceQueryPropertyEx), \ 88 VFWDFEXPORT(WdfDeviceAllocAndQueryPropertyEx), \ 89 VFWDFEXPORT(WdfDeviceAssignProperty), \ 90 VFWDFEXPORT(WdfDeviceGetSelfIoTarget), \ 91 VFWDFEXPORT(WdfDeviceInitAllowSelfIoTarget), \ 92 VFWDFEXPORT(WdfDriverCreate), \ 93 VFWDFEXPORT(WdfDriverGetRegistryPath), \ 94 VFWDFEXPORT(WdfDriverOpenParametersRegistryKey), \ 95 VFWDFEXPORT(WdfDriverRetrieveVersionString), \ 96 VFWDFEXPORT(WdfDriverIsVersionAvailable), \ 97 VFWDFEXPORT(WdfFdoInitOpenRegistryKey), \ 98 VFWDFEXPORT(WdfFdoInitQueryProperty), \ 99 VFWDFEXPORT(WdfFdoInitAllocAndQueryProperty), \ 100 VFWDFEXPORT(WdfFdoInitQueryPropertyEx), \ 101 VFWDFEXPORT(WdfFdoInitAllocAndQueryPropertyEx), \ 102 VFWDFEXPORT(WdfFdoInitSetFilter), \ 103 VFWDFEXPORT(WdfFileObjectGetFileName), \ 104 VFWDFEXPORT(WdfFileObjectGetDevice), \ 105 VFWDFEXPORT(WdfFileObjectGetInitiatorProcessId), \ 106 VFWDFEXPORT(WdfFileObjectGetRelatedFileObject), \ 107 VFWDFEXPORT(WdfDeviceInitEnableHidInterface), \ 108 VFWDFEXPORT(WdfDeviceHidNotifyPresence), \ 109 VFWDFEXPORT(WdfInterruptCreate), \ 110 VFWDFEXPORT(WdfInterruptQueueDpcForIsr), \ 111 VFWDFEXPORT(WdfInterruptQueueWorkItemForIsr), \ 112 VFWDFEXPORT(WdfInterruptSynchronize), \ 113 VFWDFEXPORT(WdfInterruptAcquireLock), \ 114 VFWDFEXPORT(WdfInterruptReleaseLock), \ 115 VFWDFEXPORT(WdfInterruptEnable), \ 116 VFWDFEXPORT(WdfInterruptDisable), \ 117 VFWDFEXPORT(WdfInterruptGetInfo), \ 118 VFWDFEXPORT(WdfInterruptSetPolicy), \ 119 VFWDFEXPORT(WdfInterruptSetExtendedPolicy), \ 120 VFWDFEXPORT(WdfInterruptGetDevice), \ 121 VFWDFEXPORT(WdfInterruptTryToAcquireLock), \ 122 VFWDFEXPORT(WdfIoQueueCreate), \ 123 VFWDFEXPORT(WdfIoQueueGetState), \ 124 VFWDFEXPORT(WdfIoQueueStart), \ 125 VFWDFEXPORT(WdfIoQueueStop), \ 126 VFWDFEXPORT(WdfIoQueueStopSynchronously), \ 127 VFWDFEXPORT(WdfIoQueueGetDevice), \ 128 VFWDFEXPORT(WdfIoQueueRetrieveNextRequest), \ 129 VFWDFEXPORT(WdfIoQueueRetrieveRequestByFileObject), \ 130 VFWDFEXPORT(WdfIoQueueFindRequest), \ 131 VFWDFEXPORT(WdfIoQueueRetrieveFoundRequest), \ 132 VFWDFEXPORT(WdfIoQueueDrainSynchronously), \ 133 VFWDFEXPORT(WdfIoQueueDrain), \ 134 VFWDFEXPORT(WdfIoQueuePurgeSynchronously), \ 135 VFWDFEXPORT(WdfIoQueuePurge), \ 136 VFWDFEXPORT(WdfIoQueueReadyNotify), \ 137 VFWDFEXPORT(WdfIoQueueStopAndPurge), \ 138 VFWDFEXPORT(WdfIoQueueStopAndPurgeSynchronously), \ 139 VFWDFEXPORT(WdfIoTargetCreate), \ 140 VFWDFEXPORT(WdfIoTargetOpen), \ 141 VFWDFEXPORT(WdfIoTargetCloseForQueryRemove), \ 142 VFWDFEXPORT(WdfIoTargetClose), \ 143 VFWDFEXPORT(WdfIoTargetStart), \ 144 VFWDFEXPORT(WdfIoTargetStop), \ 145 VFWDFEXPORT(WdfIoTargetPurge), \ 146 VFWDFEXPORT(WdfIoTargetGetState), \ 147 VFWDFEXPORT(WdfIoTargetGetDevice), \ 148 VFWDFEXPORT(WdfIoTargetWdmGetTargetFileHandle), \ 149 VFWDFEXPORT(WdfIoTargetSendReadSynchronously), \ 150 VFWDFEXPORT(WdfIoTargetFormatRequestForRead), \ 151 VFWDFEXPORT(WdfIoTargetSendWriteSynchronously), \ 152 VFWDFEXPORT(WdfIoTargetFormatRequestForWrite), \ 153 VFWDFEXPORT(WdfIoTargetSendIoctlSynchronously), \ 154 VFWDFEXPORT(WdfIoTargetFormatRequestForIoctl), \ 155 VFWDFEXPORT(WdfIoTargetSelfAssignDefaultIoQueue), \ 156 VFWDFEXPORT(WdfMemoryCreate), \ 157 VFWDFEXPORT(WdfMemoryCreatePreallocated), \ 158 VFWDFEXPORT(WdfMemoryGetBuffer), \ 159 VFWDFEXPORT(WdfMemoryAssignBuffer), \ 160 VFWDFEXPORT(WdfMemoryCopyToBuffer), \ 161 VFWDFEXPORT(WdfMemoryCopyFromBuffer), \ 162 VFWDFEXPORT(WdfObjectGetTypedContextWorker), \ 163 VFWDFEXPORT(WdfObjectAllocateContext), \ 164 VFWDFEXPORT(WdfObjectContextGetObject), \ 165 VFWDFEXPORT(WdfObjectReferenceActual), \ 166 VFWDFEXPORT(WdfObjectDereferenceActual), \ 167 VFWDFEXPORT(WdfObjectCreate), \ 168 VFWDFEXPORT(WdfObjectDelete), \ 169 VFWDFEXPORT(WdfObjectQuery), \ 170 VFWDFEXPORT(WdfRegistryOpenKey), \ 171 VFWDFEXPORT(WdfRegistryCreateKey), \ 172 VFWDFEXPORT(WdfRegistryClose), \ 173 VFWDFEXPORT(WdfRegistryWdmGetHandle), \ 174 VFWDFEXPORT(WdfRegistryRemoveKey), \ 175 VFWDFEXPORT(WdfRegistryRemoveValue), \ 176 VFWDFEXPORT(WdfRegistryQueryValue), \ 177 VFWDFEXPORT(WdfRegistryQueryMemory), \ 178 VFWDFEXPORT(WdfRegistryQueryMultiString), \ 179 VFWDFEXPORT(WdfRegistryQueryUnicodeString), \ 180 VFWDFEXPORT(WdfRegistryQueryString), \ 181 VFWDFEXPORT(WdfRegistryQueryULong), \ 182 VFWDFEXPORT(WdfRegistryAssignValue), \ 183 VFWDFEXPORT(WdfRegistryAssignMemory), \ 184 VFWDFEXPORT(WdfRegistryAssignMultiString), \ 185 VFWDFEXPORT(WdfRegistryAssignUnicodeString), \ 186 VFWDFEXPORT(WdfRegistryAssignString), \ 187 VFWDFEXPORT(WdfRegistryAssignULong), \ 188 VFWDFEXPORT(WdfRequestCreate), \ 189 VFWDFEXPORT(WdfRequestReuse), \ 190 VFWDFEXPORT(WdfRequestChangeTarget), \ 191 VFWDFEXPORT(WdfRequestFormatRequestUsingCurrentType), \ 192 VFWDFEXPORT(WdfRequestSend), \ 193 VFWDFEXPORT(WdfRequestGetStatus), \ 194 VFWDFEXPORT(WdfRequestMarkCancelable), \ 195 VFWDFEXPORT(WdfRequestMarkCancelableEx), \ 196 VFWDFEXPORT(WdfRequestUnmarkCancelable), \ 197 VFWDFEXPORT(WdfRequestIsCanceled), \ 198 VFWDFEXPORT(WdfRequestCancelSentRequest), \ 199 VFWDFEXPORT(WdfRequestIsFrom32BitProcess), \ 200 VFWDFEXPORT(WdfRequestSetCompletionRoutine), \ 201 VFWDFEXPORT(WdfRequestGetCompletionParams), \ 202 VFWDFEXPORT(WdfRequestAllocateTimer), \ 203 VFWDFEXPORT(WdfRequestComplete), \ 204 VFWDFEXPORT(WdfRequestCompleteWithInformation), \ 205 VFWDFEXPORT(WdfRequestGetParameters), \ 206 VFWDFEXPORT(WdfRequestRetrieveInputMemory), \ 207 VFWDFEXPORT(WdfRequestRetrieveOutputMemory), \ 208 VFWDFEXPORT(WdfRequestRetrieveInputBuffer), \ 209 VFWDFEXPORT(WdfRequestRetrieveOutputBuffer), \ 210 VFWDFEXPORT(WdfRequestSetInformation), \ 211 VFWDFEXPORT(WdfRequestGetInformation), \ 212 VFWDFEXPORT(WdfRequestGetFileObject), \ 213 VFWDFEXPORT(WdfRequestGetRequestorMode), \ 214 VFWDFEXPORT(WdfRequestForwardToIoQueue), \ 215 VFWDFEXPORT(WdfRequestGetIoQueue), \ 216 VFWDFEXPORT(WdfRequestRequeue), \ 217 VFWDFEXPORT(WdfRequestStopAcknowledge), \ 218 VFWDFEXPORT(WdfRequestImpersonate), \ 219 VFWDFEXPORT(WdfRequestGetRequestorProcessId), \ 220 VFWDFEXPORT(WdfRequestIsFromUserModeDriver), \ 221 VFWDFEXPORT(WdfRequestSetUserModeDriverInitiatedIo), \ 222 VFWDFEXPORT(WdfRequestGetUserModeDriverInitiatedIo), \ 223 VFWDFEXPORT(WdfRequestSetActivityId), \ 224 VFWDFEXPORT(WdfRequestRetrieveActivityId), \ 225 VFWDFEXPORT(WdfRequestGetEffectiveIoType), \ 226 VFWDFEXPORT(WdfCmResourceListGetCount), \ 227 VFWDFEXPORT(WdfCmResourceListGetDescriptor), \ 228 VFWDFEXPORT(WdfStringCreate), \ 229 VFWDFEXPORT(WdfStringGetUnicodeString), \ 230 VFWDFEXPORT(WdfObjectAcquireLock), \ 231 VFWDFEXPORT(WdfObjectReleaseLock), \ 232 VFWDFEXPORT(WdfWaitLockCreate), \ 233 VFWDFEXPORT(WdfWaitLockAcquire), \ 234 VFWDFEXPORT(WdfWaitLockRelease), \ 235 VFWDFEXPORT(WdfSpinLockCreate), \ 236 VFWDFEXPORT(WdfSpinLockAcquire), \ 237 VFWDFEXPORT(WdfSpinLockRelease), \ 238 VFWDFEXPORT(WdfTimerCreate), \ 239 VFWDFEXPORT(WdfTimerStart), \ 240 VFWDFEXPORT(WdfTimerStop), \ 241 VFWDFEXPORT(WdfTimerGetParentObject), \ 242 VFWDFEXPORT(WdfUsbTargetDeviceCreate), \ 243 VFWDFEXPORT(WdfUsbTargetDeviceCreateWithParameters), \ 244 VFWDFEXPORT(WdfUsbTargetDeviceRetrieveInformation), \ 245 VFWDFEXPORT(WdfUsbTargetDeviceGetDeviceDescriptor), \ 246 VFWDFEXPORT(WdfUsbTargetDeviceRetrieveConfigDescriptor), \ 247 VFWDFEXPORT(WdfUsbTargetDeviceQueryString), \ 248 VFWDFEXPORT(WdfUsbTargetDeviceAllocAndQueryString), \ 249 VFWDFEXPORT(WdfUsbTargetDeviceFormatRequestForString), \ 250 VFWDFEXPORT(WdfUsbTargetDeviceGetNumInterfaces), \ 251 VFWDFEXPORT(WdfUsbTargetDeviceSelectConfig), \ 252 VFWDFEXPORT(WdfUsbTargetDeviceSendControlTransferSynchronously), \ 253 VFWDFEXPORT(WdfUsbTargetDeviceFormatRequestForControlTransfer), \ 254 VFWDFEXPORT(WdfUsbTargetDeviceResetPortSynchronously), \ 255 VFWDFEXPORT(WdfUsbTargetDeviceQueryUsbCapability), \ 256 VFWDFEXPORT(WdfUsbTargetPipeGetInformation), \ 257 VFWDFEXPORT(WdfUsbTargetPipeIsInEndpoint), \ 258 VFWDFEXPORT(WdfUsbTargetPipeIsOutEndpoint), \ 259 VFWDFEXPORT(WdfUsbTargetPipeGetType), \ 260 VFWDFEXPORT(WdfUsbTargetPipeSetNoMaximumPacketSizeCheck), \ 261 VFWDFEXPORT(WdfUsbTargetPipeWriteSynchronously), \ 262 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForWrite), \ 263 VFWDFEXPORT(WdfUsbTargetPipeReadSynchronously), \ 264 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForRead), \ 265 VFWDFEXPORT(WdfUsbTargetPipeConfigContinuousReader), \ 266 VFWDFEXPORT(WdfUsbTargetPipeAbortSynchronously), \ 267 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForAbort), \ 268 VFWDFEXPORT(WdfUsbTargetPipeResetSynchronously), \ 269 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForReset), \ 270 VFWDFEXPORT(WdfUsbInterfaceGetInterfaceNumber), \ 271 VFWDFEXPORT(WdfUsbInterfaceGetNumEndpoints), \ 272 VFWDFEXPORT(WdfUsbInterfaceGetDescriptor), \ 273 VFWDFEXPORT(WdfUsbInterfaceGetNumSettings), \ 274 VFWDFEXPORT(WdfUsbInterfaceSelectSetting), \ 275 VFWDFEXPORT(WdfUsbInterfaceGetEndpointInformation), \ 276 VFWDFEXPORT(WdfUsbTargetDeviceGetInterface), \ 277 VFWDFEXPORT(WdfUsbInterfaceGetConfiguredSettingIndex), \ 278 VFWDFEXPORT(WdfUsbInterfaceGetNumConfiguredPipes), \ 279 VFWDFEXPORT(WdfUsbInterfaceGetConfiguredPipe), \ 280 VFWDFEXPORT(WdfVerifierDbgBreakPoint), \ 281 VFWDFEXPORT(WdfVerifierKeBugCheck), \ 282 VFWDFEXPORT(WdfGetTriageInfo), \ 283 VFWDFEXPORT(WdfWorkItemCreate), \ 284 VFWDFEXPORT(WdfWorkItemEnqueue), \ 285 VFWDFEXPORT(WdfWorkItemGetParentObject), \ 286 VFWDFEXPORT(WdfWorkItemFlush), \ 287 ) 288 #endif // #pragma alloc_text 289 290 _Must_inspect_result_ 291 _IRQL_requires_max_(DISPATCH_LEVEL) 292 WDFAPI 293 NTSTATUS 294 VFWDFEXPORT(WdfCollectionCreate)( 295 _In_ 296 PWDF_DRIVER_GLOBALS DriverGlobals, 297 _In_opt_ 298 PWDF_OBJECT_ATTRIBUTES CollectionAttributes, 299 _Out_ 300 WDFCOLLECTION* Collection 301 ) 302 { 303 PAGED_CODE_LOCKED(); 304 return ((PFN_WDFCOLLECTIONCREATE) WdfVersion.Functions.pfnWdfCollectionCreate)(DriverGlobals, CollectionAttributes, Collection); 305 } 306 307 _IRQL_requires_max_(DISPATCH_LEVEL) 308 WDFAPI 309 ULONG 310 VFWDFEXPORT(WdfCollectionGetCount)( 311 _In_ 312 PWDF_DRIVER_GLOBALS DriverGlobals, 313 _In_ 314 WDFCOLLECTION Collection 315 ) 316 { 317 PAGED_CODE_LOCKED(); 318 return ((PFN_WDFCOLLECTIONGETCOUNT) WdfVersion.Functions.pfnWdfCollectionGetCount)(DriverGlobals, Collection); 319 } 320 321 _Must_inspect_result_ 322 _IRQL_requires_max_(DISPATCH_LEVEL) 323 WDFAPI 324 NTSTATUS 325 VFWDFEXPORT(WdfCollectionAdd)( 326 _In_ 327 PWDF_DRIVER_GLOBALS DriverGlobals, 328 _In_ 329 WDFCOLLECTION Collection, 330 _In_ 331 WDFOBJECT Object 332 ) 333 { 334 PAGED_CODE_LOCKED(); 335 return ((PFN_WDFCOLLECTIONADD) WdfVersion.Functions.pfnWdfCollectionAdd)(DriverGlobals, Collection, Object); 336 } 337 338 _IRQL_requires_max_(DISPATCH_LEVEL) 339 WDFAPI 340 VOID 341 VFWDFEXPORT(WdfCollectionRemove)( 342 _In_ 343 PWDF_DRIVER_GLOBALS DriverGlobals, 344 _In_ 345 WDFCOLLECTION Collection, 346 _In_ 347 WDFOBJECT Item 348 ) 349 { 350 PAGED_CODE_LOCKED(); 351 ((PFN_WDFCOLLECTIONREMOVE) WdfVersion.Functions.pfnWdfCollectionRemove)(DriverGlobals, Collection, Item); 352 } 353 354 _IRQL_requires_max_(DISPATCH_LEVEL) 355 WDFAPI 356 VOID 357 VFWDFEXPORT(WdfCollectionRemoveItem)( 358 _In_ 359 PWDF_DRIVER_GLOBALS DriverGlobals, 360 _In_ 361 WDFCOLLECTION Collection, 362 _In_ 363 ULONG Index 364 ) 365 { 366 PAGED_CODE_LOCKED(); 367 ((PFN_WDFCOLLECTIONREMOVEITEM) WdfVersion.Functions.pfnWdfCollectionRemoveItem)(DriverGlobals, Collection, Index); 368 } 369 370 _IRQL_requires_max_(DISPATCH_LEVEL) 371 WDFAPI 372 WDFOBJECT 373 VFWDFEXPORT(WdfCollectionGetItem)( 374 _In_ 375 PWDF_DRIVER_GLOBALS DriverGlobals, 376 _In_ 377 WDFCOLLECTION Collection, 378 _In_ 379 ULONG Index 380 ) 381 { 382 PAGED_CODE_LOCKED(); 383 return ((PFN_WDFCOLLECTIONGETITEM) WdfVersion.Functions.pfnWdfCollectionGetItem)(DriverGlobals, Collection, Index); 384 } 385 386 _IRQL_requires_max_(DISPATCH_LEVEL) 387 WDFAPI 388 WDFOBJECT 389 VFWDFEXPORT(WdfCollectionGetFirstItem)( 390 _In_ 391 PWDF_DRIVER_GLOBALS DriverGlobals, 392 _In_ 393 WDFCOLLECTION Collection 394 ) 395 { 396 PAGED_CODE_LOCKED(); 397 return ((PFN_WDFCOLLECTIONGETFIRSTITEM) WdfVersion.Functions.pfnWdfCollectionGetFirstItem)(DriverGlobals, Collection); 398 } 399 400 _IRQL_requires_max_(DISPATCH_LEVEL) 401 WDFAPI 402 WDFOBJECT 403 VFWDFEXPORT(WdfCollectionGetLastItem)( 404 _In_ 405 PWDF_DRIVER_GLOBALS DriverGlobals, 406 _In_ 407 WDFCOLLECTION Collection 408 ) 409 { 410 PAGED_CODE_LOCKED(); 411 return ((PFN_WDFCOLLECTIONGETLASTITEM) WdfVersion.Functions.pfnWdfCollectionGetLastItem)(DriverGlobals, Collection); 412 } 413 414 _Must_inspect_result_ 415 _IRQL_requires_max_(PASSIVE_LEVEL) 416 WDFAPI 417 PWDFCXDEVICE_INIT 418 VFWDFEXPORT(WdfCxDeviceInitAllocate)( 419 _In_ 420 PWDF_DRIVER_GLOBALS DriverGlobals, 421 _In_ 422 PWDFDEVICE_INIT DeviceInit 423 ) 424 { 425 PAGED_CODE_LOCKED(); 426 return ((PFN_WDFCXDEVICEINITALLOCATE) WdfVersion.Functions.pfnWdfCxDeviceInitAllocate)(DriverGlobals, DeviceInit); 427 } 428 429 _IRQL_requires_max_(DISPATCH_LEVEL) 430 WDFAPI 431 VOID 432 VFWDFEXPORT(WdfCxDeviceInitSetRequestAttributes)( 433 _In_ 434 PWDF_DRIVER_GLOBALS DriverGlobals, 435 _In_ 436 PWDFCXDEVICE_INIT CxDeviceInit, 437 _In_ 438 PWDF_OBJECT_ATTRIBUTES RequestAttributes 439 ) 440 { 441 PAGED_CODE_LOCKED(); 442 ((PFN_WDFCXDEVICEINITSETREQUESTATTRIBUTES) WdfVersion.Functions.pfnWdfCxDeviceInitSetRequestAttributes)(DriverGlobals, CxDeviceInit, RequestAttributes); 443 } 444 445 _IRQL_requires_max_(DISPATCH_LEVEL) 446 WDFAPI 447 VOID 448 VFWDFEXPORT(WdfCxDeviceInitSetFileObjectConfig)( 449 _In_ 450 PWDF_DRIVER_GLOBALS DriverGlobals, 451 _In_ 452 PWDFCXDEVICE_INIT CxDeviceInit, 453 _In_ 454 PWDFCX_FILEOBJECT_CONFIG CxFileObjectConfig, 455 _In_opt_ 456 PWDF_OBJECT_ATTRIBUTES FileObjectAttributes 457 ) 458 { 459 PAGED_CODE_LOCKED(); 460 ((PFN_WDFCXDEVICEINITSETFILEOBJECTCONFIG) WdfVersion.Functions.pfnWdfCxDeviceInitSetFileObjectConfig)(DriverGlobals, CxDeviceInit, CxFileObjectConfig, FileObjectAttributes); 461 } 462 463 WDFAPI 464 VOID 465 VFWDFEXPORT(WdfCxVerifierKeBugCheck)( 466 _In_ 467 PWDF_DRIVER_GLOBALS DriverGlobals, 468 _In_opt_ 469 WDFOBJECT Object, 470 _In_ 471 ULONG BugCheckCode, 472 _In_ 473 ULONG_PTR BugCheckParameter1, 474 _In_ 475 ULONG_PTR BugCheckParameter2, 476 _In_ 477 ULONG_PTR BugCheckParameter3, 478 _In_ 479 ULONG_PTR BugCheckParameter4 480 ) 481 { 482 PAGED_CODE_LOCKED(); 483 ((PFN_WDFCXVERIFIERKEBUGCHECK) WdfVersion.Functions.pfnWdfCxVerifierKeBugCheck)(DriverGlobals, Object, BugCheckCode, BugCheckParameter1, BugCheckParameter2, BugCheckParameter3, BugCheckParameter4); 484 } 485 486 _IRQL_requires_max_(DISPATCH_LEVEL) 487 WDFAPI 488 VOID 489 VFWDFEXPORT(WdfDeviceGetDeviceState)( 490 _In_ 491 PWDF_DRIVER_GLOBALS DriverGlobals, 492 _In_ 493 WDFDEVICE Device, 494 _Out_ 495 PWDF_DEVICE_STATE DeviceState 496 ) 497 { 498 PAGED_CODE_LOCKED(); 499 ((PFN_WDFDEVICEGETDEVICESTATE) WdfVersion.Functions.pfnWdfDeviceGetDeviceState)(DriverGlobals, Device, DeviceState); 500 } 501 502 _IRQL_requires_max_(DISPATCH_LEVEL) 503 WDFAPI 504 VOID 505 VFWDFEXPORT(WdfDeviceSetDeviceState)( 506 _In_ 507 PWDF_DRIVER_GLOBALS DriverGlobals, 508 _In_ 509 WDFDEVICE Device, 510 _In_ 511 PWDF_DEVICE_STATE DeviceState 512 ) 513 { 514 PAGED_CODE_LOCKED(); 515 ((PFN_WDFDEVICESETDEVICESTATE) WdfVersion.Functions.pfnWdfDeviceSetDeviceState)(DriverGlobals, Device, DeviceState); 516 } 517 518 _Must_inspect_result_ 519 _IRQL_requires_max_(DISPATCH_LEVEL) 520 WDFAPI 521 NTSTATUS 522 VFWDFEXPORT(WdfDeviceWdmDispatchIrp)( 523 _In_ 524 PWDF_DRIVER_GLOBALS DriverGlobals, 525 _In_ 526 WDFDEVICE Device, 527 _In_ 528 PIRP Irp, 529 _In_ 530 WDFCONTEXT DispatchContext 531 ) 532 { 533 PAGED_CODE_LOCKED(); 534 return ((PFN_WDFDEVICEWDMDISPATCHIRP) WdfVersion.Functions.pfnWdfDeviceWdmDispatchIrp)(DriverGlobals, Device, Irp, DispatchContext); 535 } 536 537 _Must_inspect_result_ 538 _IRQL_requires_max_(DISPATCH_LEVEL) 539 WDFAPI 540 NTSTATUS 541 VFWDFEXPORT(WdfDeviceWdmDispatchIrpToIoQueue)( 542 _In_ 543 PWDF_DRIVER_GLOBALS DriverGlobals, 544 _In_ 545 WDFDEVICE Device, 546 _In_ 547 PIRP Irp, 548 _In_ 549 WDFQUEUE Queue, 550 _In_ 551 ULONG Flags 552 ) 553 { 554 PAGED_CODE_LOCKED(); 555 return ((PFN_WDFDEVICEWDMDISPATCHIRPTOIOQUEUE) WdfVersion.Functions.pfnWdfDeviceWdmDispatchIrpToIoQueue)(DriverGlobals, Device, Irp, Queue, Flags); 556 } 557 558 _IRQL_requires_max_(DISPATCH_LEVEL) 559 WDFAPI 560 WDFDRIVER 561 VFWDFEXPORT(WdfDeviceGetDriver)( 562 _In_ 563 PWDF_DRIVER_GLOBALS DriverGlobals, 564 _In_ 565 WDFDEVICE Device 566 ) 567 { 568 PAGED_CODE_LOCKED(); 569 return ((PFN_WDFDEVICEGETDRIVER) WdfVersion.Functions.pfnWdfDeviceGetDriver)(DriverGlobals, Device); 570 } 571 572 _IRQL_requires_max_(DISPATCH_LEVEL) 573 WDFAPI 574 WDFIOTARGET 575 VFWDFEXPORT(WdfDeviceGetIoTarget)( 576 _In_ 577 PWDF_DRIVER_GLOBALS DriverGlobals, 578 _In_ 579 WDFDEVICE Device 580 ) 581 { 582 PAGED_CODE_LOCKED(); 583 return ((PFN_WDFDEVICEGETIOTARGET) WdfVersion.Functions.pfnWdfDeviceGetIoTarget)(DriverGlobals, Device); 584 } 585 586 _Must_inspect_result_ 587 _IRQL_requires_max_(DISPATCH_LEVEL) 588 WDFAPI 589 NTSTATUS 590 VFWDFEXPORT(WdfDeviceAssignS0IdleSettings)( 591 _In_ 592 PWDF_DRIVER_GLOBALS DriverGlobals, 593 _In_ 594 WDFDEVICE Device, 595 _In_ 596 PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings 597 ) 598 { 599 PAGED_CODE_LOCKED(); 600 return ((PFN_WDFDEVICEASSIGNS0IDLESETTINGS) WdfVersion.Functions.pfnWdfDeviceAssignS0IdleSettings)(DriverGlobals, Device, Settings); 601 } 602 603 _Must_inspect_result_ 604 _IRQL_requires_max_(DISPATCH_LEVEL) 605 WDFAPI 606 NTSTATUS 607 VFWDFEXPORT(WdfDeviceAssignSxWakeSettings)( 608 _In_ 609 PWDF_DRIVER_GLOBALS DriverGlobals, 610 _In_ 611 WDFDEVICE Device, 612 _In_ 613 PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings 614 ) 615 { 616 PAGED_CODE_LOCKED(); 617 return ((PFN_WDFDEVICEASSIGNSXWAKESETTINGS) WdfVersion.Functions.pfnWdfDeviceAssignSxWakeSettings)(DriverGlobals, Device, Settings); 618 } 619 620 _Must_inspect_result_ 621 _IRQL_requires_max_(PASSIVE_LEVEL) 622 WDFAPI 623 NTSTATUS 624 VFWDFEXPORT(WdfDeviceOpenRegistryKey)( 625 _In_ 626 PWDF_DRIVER_GLOBALS DriverGlobals, 627 _In_ 628 WDFDEVICE Device, 629 _In_ 630 ULONG DeviceInstanceKeyType, 631 _In_ 632 ACCESS_MASK DesiredAccess, 633 _In_opt_ 634 PWDF_OBJECT_ATTRIBUTES KeyAttributes, 635 _Out_ 636 WDFKEY* Key 637 ) 638 { 639 PAGED_CODE_LOCKED(); 640 return ((PFN_WDFDEVICEOPENREGISTRYKEY) WdfVersion.Functions.pfnWdfDeviceOpenRegistryKey)(DriverGlobals, Device, DeviceInstanceKeyType, DesiredAccess, KeyAttributes, Key); 641 } 642 643 _Must_inspect_result_ 644 _IRQL_requires_max_(PASSIVE_LEVEL) 645 WDFAPI 646 NTSTATUS 647 VFWDFEXPORT(WdfDeviceOpenDevicemapKey)( 648 _In_ 649 PWDF_DRIVER_GLOBALS DriverGlobals, 650 _In_ 651 WDFDEVICE Device, 652 _In_ 653 PCUNICODE_STRING KeyName, 654 _In_ 655 ACCESS_MASK DesiredAccess, 656 _In_opt_ 657 PWDF_OBJECT_ATTRIBUTES KeyAttributes, 658 _Out_ 659 WDFKEY* Key 660 ) 661 { 662 PAGED_CODE_LOCKED(); 663 return ((PFN_WDFDEVICEOPENDEVICEMAPKEY) WdfVersion.Functions.pfnWdfDeviceOpenDevicemapKey)(DriverGlobals, Device, KeyName, DesiredAccess, KeyAttributes, Key); 664 } 665 666 _IRQL_requires_max_(DISPATCH_LEVEL) 667 WDFAPI 668 VOID 669 VFWDFEXPORT(WdfDeviceInitSetPnpPowerEventCallbacks)( 670 _In_ 671 PWDF_DRIVER_GLOBALS DriverGlobals, 672 _In_ 673 PWDFDEVICE_INIT DeviceInit, 674 _In_ 675 PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks 676 ) 677 { 678 PAGED_CODE_LOCKED(); 679 ((PFN_WDFDEVICEINITSETPNPPOWEREVENTCALLBACKS) WdfVersion.Functions.pfnWdfDeviceInitSetPnpPowerEventCallbacks)(DriverGlobals, DeviceInit, PnpPowerEventCallbacks); 680 } 681 682 _IRQL_requires_max_(DISPATCH_LEVEL) 683 WDFAPI 684 VOID 685 VFWDFEXPORT(WdfDeviceInitSetPowerPolicyEventCallbacks)( 686 _In_ 687 PWDF_DRIVER_GLOBALS DriverGlobals, 688 _In_ 689 PWDFDEVICE_INIT DeviceInit, 690 _In_ 691 PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks 692 ) 693 { 694 PAGED_CODE_LOCKED(); 695 ((PFN_WDFDEVICEINITSETPOWERPOLICYEVENTCALLBACKS) WdfVersion.Functions.pfnWdfDeviceInitSetPowerPolicyEventCallbacks)(DriverGlobals, DeviceInit, PowerPolicyEventCallbacks); 696 } 697 698 _IRQL_requires_max_(DISPATCH_LEVEL) 699 WDFAPI 700 VOID 701 VFWDFEXPORT(WdfDeviceInitSetPowerPolicyOwnership)( 702 _In_ 703 PWDF_DRIVER_GLOBALS DriverGlobals, 704 _In_ 705 PWDFDEVICE_INIT DeviceInit, 706 _In_ 707 BOOLEAN IsPowerPolicyOwner 708 ) 709 { 710 PAGED_CODE_LOCKED(); 711 ((PFN_WDFDEVICEINITSETPOWERPOLICYOWNERSHIP) WdfVersion.Functions.pfnWdfDeviceInitSetPowerPolicyOwnership)(DriverGlobals, DeviceInit, IsPowerPolicyOwner); 712 } 713 714 _IRQL_requires_max_(DISPATCH_LEVEL) 715 WDFAPI 716 VOID 717 VFWDFEXPORT(WdfDeviceInitSetIoType)( 718 _In_ 719 PWDF_DRIVER_GLOBALS DriverGlobals, 720 _In_ 721 PWDFDEVICE_INIT DeviceInit, 722 _In_ 723 WDF_DEVICE_IO_TYPE IoType 724 ) 725 { 726 PAGED_CODE_LOCKED(); 727 ((PFN_WDFDEVICEINITSETIOTYPE) WdfVersion.Functions.pfnWdfDeviceInitSetIoType)(DriverGlobals, DeviceInit, IoType); 728 } 729 730 _IRQL_requires_max_(DISPATCH_LEVEL) 731 WDFAPI 732 VOID 733 VFWDFEXPORT(WdfDeviceInitSetFileObjectConfig)( 734 _In_ 735 PWDF_DRIVER_GLOBALS DriverGlobals, 736 _In_ 737 PWDFDEVICE_INIT DeviceInit, 738 _In_ 739 PWDF_FILEOBJECT_CONFIG FileObjectConfig, 740 _In_opt_ 741 PWDF_OBJECT_ATTRIBUTES FileObjectAttributes 742 ) 743 { 744 PAGED_CODE_LOCKED(); 745 ((PFN_WDFDEVICEINITSETFILEOBJECTCONFIG) WdfVersion.Functions.pfnWdfDeviceInitSetFileObjectConfig)(DriverGlobals, DeviceInit, FileObjectConfig, FileObjectAttributes); 746 } 747 748 _IRQL_requires_max_(DISPATCH_LEVEL) 749 WDFAPI 750 VOID 751 VFWDFEXPORT(WdfDeviceInitSetRequestAttributes)( 752 _In_ 753 PWDF_DRIVER_GLOBALS DriverGlobals, 754 _In_ 755 PWDFDEVICE_INIT DeviceInit, 756 _In_ 757 PWDF_OBJECT_ATTRIBUTES RequestAttributes 758 ) 759 { 760 PAGED_CODE_LOCKED(); 761 ((PFN_WDFDEVICEINITSETREQUESTATTRIBUTES) WdfVersion.Functions.pfnWdfDeviceInitSetRequestAttributes)(DriverGlobals, DeviceInit, RequestAttributes); 762 } 763 764 _Must_inspect_result_ 765 _IRQL_requires_max_(PASSIVE_LEVEL) 766 WDFAPI 767 NTSTATUS 768 VFWDFEXPORT(WdfDeviceCreate)( 769 _In_ 770 PWDF_DRIVER_GLOBALS DriverGlobals, 771 _Inout_ 772 PWDFDEVICE_INIT* DeviceInit, 773 _In_opt_ 774 PWDF_OBJECT_ATTRIBUTES DeviceAttributes, 775 _Out_ 776 WDFDEVICE* Device 777 ) 778 { 779 VF_HOOK_PROCESS_INFO hookInfo; 780 NTSTATUS status; 781 782 PAGED_CODE_LOCKED(); 783 RtlZeroMemory(&hookInfo, sizeof(VF_HOOK_PROCESS_INFO)); 784 785 status = AddEventHooksWdfDeviceCreate( 786 &hookInfo, 787 DriverGlobals, 788 DeviceInit, 789 DeviceAttributes, 790 Device); 791 792 UNREFERENCED_PARAMETER(status); 793 794 if (hookInfo.DonotCallKmdfLib) { 795 return hookInfo.DdiCallStatus; 796 } 797 798 return ((PFN_WDFDEVICECREATE) WdfVersion.Functions.pfnWdfDeviceCreate)(DriverGlobals, DeviceInit, DeviceAttributes, Device); 799 } 800 801 _IRQL_requires_max_(DISPATCH_LEVEL) 802 WDFAPI 803 VOID 804 VFWDFEXPORT(WdfDeviceSetStaticStopRemove)( 805 _In_ 806 PWDF_DRIVER_GLOBALS DriverGlobals, 807 _In_ 808 WDFDEVICE Device, 809 _In_ 810 BOOLEAN Stoppable 811 ) 812 { 813 PAGED_CODE_LOCKED(); 814 ((PFN_WDFDEVICESETSTATICSTOPREMOVE) WdfVersion.Functions.pfnWdfDeviceSetStaticStopRemove)(DriverGlobals, Device, Stoppable); 815 } 816 817 _Must_inspect_result_ 818 _IRQL_requires_max_(PASSIVE_LEVEL) 819 WDFAPI 820 NTSTATUS 821 VFWDFEXPORT(WdfDeviceCreateDeviceInterface)( 822 _In_ 823 PWDF_DRIVER_GLOBALS DriverGlobals, 824 _In_ 825 WDFDEVICE Device, 826 _In_ 827 CONST GUID* InterfaceClassGUID, 828 _In_opt_ 829 PCUNICODE_STRING ReferenceString 830 ) 831 { 832 PAGED_CODE_LOCKED(); 833 return ((PFN_WDFDEVICECREATEDEVICEINTERFACE) WdfVersion.Functions.pfnWdfDeviceCreateDeviceInterface)(DriverGlobals, Device, InterfaceClassGUID, ReferenceString); 834 } 835 836 _IRQL_requires_max_(PASSIVE_LEVEL) 837 WDFAPI 838 VOID 839 VFWDFEXPORT(WdfDeviceSetDeviceInterfaceState)( 840 _In_ 841 PWDF_DRIVER_GLOBALS DriverGlobals, 842 _In_ 843 WDFDEVICE Device, 844 _In_ 845 CONST GUID* InterfaceClassGUID, 846 _In_opt_ 847 PCUNICODE_STRING ReferenceString, 848 _In_ 849 BOOLEAN IsInterfaceEnabled 850 ) 851 { 852 PAGED_CODE_LOCKED(); 853 ((PFN_WDFDEVICESETDEVICEINTERFACESTATE) WdfVersion.Functions.pfnWdfDeviceSetDeviceInterfaceState)(DriverGlobals, Device, InterfaceClassGUID, ReferenceString, IsInterfaceEnabled); 854 } 855 856 _Must_inspect_result_ 857 _IRQL_requires_max_(PASSIVE_LEVEL) 858 WDFAPI 859 NTSTATUS 860 VFWDFEXPORT(WdfDeviceRetrieveDeviceInterfaceString)( 861 _In_ 862 PWDF_DRIVER_GLOBALS DriverGlobals, 863 _In_ 864 WDFDEVICE Device, 865 _In_ 866 CONST GUID* InterfaceClassGUID, 867 _In_opt_ 868 PCUNICODE_STRING ReferenceString, 869 _In_ 870 WDFSTRING String 871 ) 872 { 873 PAGED_CODE_LOCKED(); 874 return ((PFN_WDFDEVICERETRIEVEDEVICEINTERFACESTRING) WdfVersion.Functions.pfnWdfDeviceRetrieveDeviceInterfaceString)(DriverGlobals, Device, InterfaceClassGUID, ReferenceString, String); 875 } 876 877 _Must_inspect_result_ 878 _IRQL_requires_max_(PASSIVE_LEVEL) 879 WDFAPI 880 NTSTATUS 881 VFWDFEXPORT(WdfDeviceCreateSymbolicLink)( 882 _In_ 883 PWDF_DRIVER_GLOBALS DriverGlobals, 884 _In_ 885 WDFDEVICE Device, 886 _In_ 887 PCUNICODE_STRING SymbolicLinkName 888 ) 889 { 890 PAGED_CODE_LOCKED(); 891 return ((PFN_WDFDEVICECREATESYMBOLICLINK) WdfVersion.Functions.pfnWdfDeviceCreateSymbolicLink)(DriverGlobals, Device, SymbolicLinkName); 892 } 893 894 _Must_inspect_result_ 895 _IRQL_requires_max_(PASSIVE_LEVEL) 896 WDFAPI 897 NTSTATUS 898 VFWDFEXPORT(WdfDeviceQueryProperty)( 899 _In_ 900 PWDF_DRIVER_GLOBALS DriverGlobals, 901 _In_ 902 WDFDEVICE Device, 903 _In_ 904 DEVICE_REGISTRY_PROPERTY DeviceProperty, 905 _In_ 906 ULONG BufferLength, 907 _Out_writes_bytes_all_(BufferLength) 908 PVOID PropertyBuffer, 909 _Out_ 910 PULONG ResultLength 911 ) 912 { 913 PAGED_CODE_LOCKED(); 914 return ((PFN_WDFDEVICEQUERYPROPERTY) WdfVersion.Functions.pfnWdfDeviceQueryProperty)(DriverGlobals, Device, DeviceProperty, BufferLength, PropertyBuffer, ResultLength); 915 } 916 917 _Must_inspect_result_ 918 _IRQL_requires_max_(PASSIVE_LEVEL) 919 WDFAPI 920 NTSTATUS 921 VFWDFEXPORT(WdfDeviceAllocAndQueryProperty)( 922 _In_ 923 PWDF_DRIVER_GLOBALS DriverGlobals, 924 _In_ 925 WDFDEVICE Device, 926 _In_ 927 DEVICE_REGISTRY_PROPERTY DeviceProperty, 928 _In_ 929 _Strict_type_match_ 930 POOL_TYPE PoolType, 931 _In_opt_ 932 PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, 933 _Out_ 934 WDFMEMORY* PropertyMemory 935 ) 936 { 937 PAGED_CODE_LOCKED(); 938 return ((PFN_WDFDEVICEALLOCANDQUERYPROPERTY) WdfVersion.Functions.pfnWdfDeviceAllocAndQueryProperty)(DriverGlobals, Device, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory); 939 } 940 941 _IRQL_requires_max_(DISPATCH_LEVEL) 942 WDFAPI 943 VOID 944 VFWDFEXPORT(WdfDeviceSetPnpCapabilities)( 945 _In_ 946 PWDF_DRIVER_GLOBALS DriverGlobals, 947 _In_ 948 WDFDEVICE Device, 949 _In_ 950 PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities 951 ) 952 { 953 PAGED_CODE_LOCKED(); 954 ((PFN_WDFDEVICESETPNPCAPABILITIES) WdfVersion.Functions.pfnWdfDeviceSetPnpCapabilities)(DriverGlobals, Device, PnpCapabilities); 955 } 956 957 _IRQL_requires_max_(DISPATCH_LEVEL) 958 WDFAPI 959 VOID 960 VFWDFEXPORT(WdfDeviceSetPowerCapabilities)( 961 _In_ 962 PWDF_DRIVER_GLOBALS DriverGlobals, 963 _In_ 964 WDFDEVICE Device, 965 _In_ 966 PWDF_DEVICE_POWER_CAPABILITIES PowerCapabilities 967 ) 968 { 969 PAGED_CODE_LOCKED(); 970 ((PFN_WDFDEVICESETPOWERCAPABILITIES) WdfVersion.Functions.pfnWdfDeviceSetPowerCapabilities)(DriverGlobals, Device, PowerCapabilities); 971 } 972 973 _IRQL_requires_max_(DISPATCH_LEVEL) 974 WDFAPI 975 VOID 976 VFWDFEXPORT(WdfDeviceSetFailed)( 977 _In_ 978 PWDF_DRIVER_GLOBALS DriverGlobals, 979 _In_ 980 WDFDEVICE Device, 981 _In_ 982 WDF_DEVICE_FAILED_ACTION FailedAction 983 ) 984 { 985 PAGED_CODE_LOCKED(); 986 ((PFN_WDFDEVICESETFAILED) WdfVersion.Functions.pfnWdfDeviceSetFailed)(DriverGlobals, Device, FailedAction); 987 } 988 989 _Must_inspect_result_ 990 _When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) 991 _When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) 992 WDFAPI 993 NTSTATUS 994 VFWDFEXPORT(WdfDeviceStopIdleNoTrack)( 995 _In_ 996 PWDF_DRIVER_GLOBALS DriverGlobals, 997 _In_ 998 WDFDEVICE Device, 999 _In_ 1000 BOOLEAN WaitForD0 1001 ) 1002 { 1003 PAGED_CODE_LOCKED(); 1004 return ((PFN_WDFDEVICESTOPIDLENOTRACK) WdfVersion.Functions.pfnWdfDeviceStopIdleNoTrack)(DriverGlobals, Device, WaitForD0); 1005 } 1006 1007 _IRQL_requires_max_(DISPATCH_LEVEL) 1008 WDFAPI 1009 VOID 1010 VFWDFEXPORT(WdfDeviceResumeIdleNoTrack)( 1011 _In_ 1012 PWDF_DRIVER_GLOBALS DriverGlobals, 1013 _In_ 1014 WDFDEVICE Device 1015 ) 1016 { 1017 PAGED_CODE_LOCKED(); 1018 ((PFN_WDFDEVICERESUMEIDLENOTRACK) WdfVersion.Functions.pfnWdfDeviceResumeIdleNoTrack)(DriverGlobals, Device); 1019 } 1020 1021 _Must_inspect_result_ 1022 _When_(WaitForD0 == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) 1023 _When_(WaitForD0 != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) 1024 WDFAPI 1025 NTSTATUS 1026 VFWDFEXPORT(WdfDeviceStopIdleActual)( 1027 _In_ 1028 PWDF_DRIVER_GLOBALS DriverGlobals, 1029 _In_ 1030 WDFDEVICE Device, 1031 _In_ 1032 BOOLEAN WaitForD0, 1033 _In_opt_ 1034 PVOID Tag, 1035 _In_ 1036 LONG Line, 1037 _In_z_ 1038 PCHAR File 1039 ) 1040 { 1041 PAGED_CODE_LOCKED(); 1042 return ((PFN_WDFDEVICESTOPIDLEACTUAL) WdfVersion.Functions.pfnWdfDeviceStopIdleActual)(DriverGlobals, Device, WaitForD0, Tag, Line, File); 1043 } 1044 1045 _IRQL_requires_max_(DISPATCH_LEVEL) 1046 WDFAPI 1047 VOID 1048 VFWDFEXPORT(WdfDeviceResumeIdleActual)( 1049 _In_ 1050 PWDF_DRIVER_GLOBALS DriverGlobals, 1051 _In_ 1052 WDFDEVICE Device, 1053 _In_opt_ 1054 PVOID Tag, 1055 _In_ 1056 LONG Line, 1057 _In_z_ 1058 PCHAR File 1059 ) 1060 { 1061 PAGED_CODE_LOCKED(); 1062 ((PFN_WDFDEVICERESUMEIDLEACTUAL) WdfVersion.Functions.pfnWdfDeviceResumeIdleActual)(DriverGlobals, Device, Tag, Line, File); 1063 } 1064 1065 _IRQL_requires_max_(DISPATCH_LEVEL) 1066 WDFAPI 1067 WDFFILEOBJECT 1068 VFWDFEXPORT(WdfDeviceGetFileObject)( 1069 _In_ 1070 PWDF_DRIVER_GLOBALS DriverGlobals, 1071 _In_ 1072 WDFDEVICE Device, 1073 _In_ 1074 PFILE_OBJECT FileObject 1075 ) 1076 { 1077 PAGED_CODE_LOCKED(); 1078 return ((PFN_WDFDEVICEGETFILEOBJECT) WdfVersion.Functions.pfnWdfDeviceGetFileObject)(DriverGlobals, Device, FileObject); 1079 } 1080 1081 _IRQL_requires_max_(DISPATCH_LEVEL) 1082 WDFAPI 1083 WDFQUEUE 1084 VFWDFEXPORT(WdfDeviceGetDefaultQueue)( 1085 _In_ 1086 PWDF_DRIVER_GLOBALS DriverGlobals, 1087 _In_ 1088 WDFDEVICE Device 1089 ) 1090 { 1091 PAGED_CODE_LOCKED(); 1092 return ((PFN_WDFDEVICEGETDEFAULTQUEUE) WdfVersion.Functions.pfnWdfDeviceGetDefaultQueue)(DriverGlobals, Device); 1093 } 1094 1095 _Must_inspect_result_ 1096 _IRQL_requires_max_(DISPATCH_LEVEL) 1097 WDFAPI 1098 NTSTATUS 1099 VFWDFEXPORT(WdfDeviceConfigureRequestDispatching)( 1100 _In_ 1101 PWDF_DRIVER_GLOBALS DriverGlobals, 1102 _In_ 1103 WDFDEVICE Device, 1104 _In_ 1105 WDFQUEUE Queue, 1106 _In_ 1107 _Strict_type_match_ 1108 WDF_REQUEST_TYPE RequestType 1109 ) 1110 { 1111 PAGED_CODE_LOCKED(); 1112 return ((PFN_WDFDEVICECONFIGUREREQUESTDISPATCHING) WdfVersion.Functions.pfnWdfDeviceConfigureRequestDispatching)(DriverGlobals, Device, Queue, RequestType); 1113 } 1114 1115 _Must_inspect_result_ 1116 _IRQL_requires_max_(DISPATCH_LEVEL) 1117 WDFAPI 1118 NTSTATUS 1119 VFWDFEXPORT(WdfDeviceConfigureWdmIrpDispatchCallback)( 1120 _In_ 1121 PWDF_DRIVER_GLOBALS DriverGlobals, 1122 _In_ 1123 WDFDEVICE Device, 1124 _In_opt_ 1125 WDFDRIVER Driver, 1126 _In_ 1127 UCHAR MajorFunction, 1128 _In_ 1129 PFN_WDFDEVICE_WDM_IRP_DISPATCH EvtDeviceWdmIrpDisptach, 1130 _In_opt_ 1131 WDFCONTEXT DriverContext 1132 ) 1133 { 1134 PAGED_CODE_LOCKED(); 1135 return ((PFN_WDFDEVICECONFIGUREWDMIRPDISPATCHCALLBACK) WdfVersion.Functions.pfnWdfDeviceConfigureWdmIrpDispatchCallback)(DriverGlobals, Device, Driver, MajorFunction, EvtDeviceWdmIrpDisptach, DriverContext); 1136 } 1137 1138 _IRQL_requires_max_(DISPATCH_LEVEL) 1139 WDFAPI 1140 POWER_ACTION 1141 VFWDFEXPORT(WdfDeviceGetSystemPowerAction)( 1142 _In_ 1143 PWDF_DRIVER_GLOBALS DriverGlobals, 1144 _In_ 1145 WDFDEVICE Device 1146 ) 1147 { 1148 PAGED_CODE_LOCKED(); 1149 return ((PFN_WDFDEVICEGETSYSTEMPOWERACTION) WdfVersion.Functions.pfnWdfDeviceGetSystemPowerAction)(DriverGlobals, Device); 1150 } 1151 1152 _IRQL_requires_max_(DISPATCH_LEVEL) 1153 WDFAPI 1154 VOID 1155 VFWDFEXPORT(WdfDeviceInitSetReleaseHardwareOrderOnFailure)( 1156 _In_ 1157 PWDF_DRIVER_GLOBALS DriverGlobals, 1158 _In_ 1159 PWDFDEVICE_INIT DeviceInit, 1160 _In_ 1161 WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE ReleaseHardwareOrderOnFailure 1162 ) 1163 { 1164 PAGED_CODE_LOCKED(); 1165 ((PFN_WDFDEVICEINITSETRELEASEHARDWAREORDERONFAILURE) WdfVersion.Functions.pfnWdfDeviceInitSetReleaseHardwareOrderOnFailure)(DriverGlobals, DeviceInit, ReleaseHardwareOrderOnFailure); 1166 } 1167 1168 _IRQL_requires_max_(PASSIVE_LEVEL) 1169 WDFAPI 1170 VOID 1171 VFWDFEXPORT(WdfDeviceInitSetIoTypeEx)( 1172 _In_ 1173 PWDF_DRIVER_GLOBALS DriverGlobals, 1174 _In_ 1175 PWDFDEVICE_INIT DeviceInit, 1176 _In_ 1177 PWDF_IO_TYPE_CONFIG IoTypeConfig 1178 ) 1179 { 1180 PAGED_CODE_LOCKED(); 1181 ((PFN_WDFDEVICEINITSETIOTYPEEX) WdfVersion.Functions.pfnWdfDeviceInitSetIoTypeEx)(DriverGlobals, DeviceInit, IoTypeConfig); 1182 } 1183 1184 _IRQL_requires_max_(PASSIVE_LEVEL) 1185 WDFAPI 1186 NTSTATUS 1187 VFWDFEXPORT(WdfDevicePostEvent)( 1188 _In_ 1189 PWDF_DRIVER_GLOBALS DriverGlobals, 1190 _In_ 1191 WDFDEVICE Device, 1192 _In_ 1193 REFGUID EventGuid, 1194 _In_ 1195 WDF_EVENT_TYPE WdfEventType, 1196 _In_reads_bytes_(DataSizeCb) 1197 BYTE* Data, 1198 _In_ 1199 ULONG DataSizeCb 1200 ) 1201 { 1202 PAGED_CODE_LOCKED(); 1203 return ((PFN_WDFDEVICEPOSTEVENT) WdfVersion.Functions.pfnWdfDevicePostEvent)(DriverGlobals, Device, EventGuid, WdfEventType, Data, DataSizeCb); 1204 } 1205 1206 _Must_inspect_result_ 1207 _IRQL_requires_max_(PASSIVE_LEVEL) 1208 WDFAPI 1209 NTSTATUS 1210 VFWDFEXPORT(WdfDeviceMapIoSpace)( 1211 _In_ 1212 PWDF_DRIVER_GLOBALS DriverGlobals, 1213 _In_ 1214 WDFDEVICE Device, 1215 _In_ 1216 PHYSICAL_ADDRESS PhysicalAddress, 1217 _In_ 1218 SIZE_T NumberOfBytes, 1219 _In_ 1220 MEMORY_CACHING_TYPE CacheType, 1221 _Out_ 1222 PVOID* PseudoBaseAddress 1223 ) 1224 { 1225 PAGED_CODE_LOCKED(); 1226 return ((PFN_WDFDEVICEMAPIOSPACE) WdfVersion.Functions.pfnWdfDeviceMapIoSpace)(DriverGlobals, Device, PhysicalAddress, NumberOfBytes, CacheType, PseudoBaseAddress); 1227 } 1228 1229 _IRQL_requires_max_(PASSIVE_LEVEL) 1230 WDFAPI 1231 VOID 1232 VFWDFEXPORT(WdfDeviceUnmapIoSpace)( 1233 _In_ 1234 PWDF_DRIVER_GLOBALS DriverGlobals, 1235 _In_ 1236 WDFDEVICE Device, 1237 _In_ 1238 PVOID PseudoBaseAddress, 1239 _In_ 1240 SIZE_T NumberOfBytes 1241 ) 1242 { 1243 PAGED_CODE_LOCKED(); 1244 ((PFN_WDFDEVICEUNMAPIOSPACE) WdfVersion.Functions.pfnWdfDeviceUnmapIoSpace)(DriverGlobals, Device, PseudoBaseAddress, NumberOfBytes); 1245 } 1246 1247 _IRQL_requires_max_(PASSIVE_LEVEL) 1248 WDFAPI 1249 PVOID 1250 VFWDFEXPORT(WdfDeviceGetHardwareRegisterMappedAddress)( 1251 _In_ 1252 PWDF_DRIVER_GLOBALS DriverGlobals, 1253 _In_ 1254 WDFDEVICE Device, 1255 _In_ 1256 PVOID PseudoBaseAddress 1257 ) 1258 { 1259 PAGED_CODE_LOCKED(); 1260 return ((PFN_WDFDEVICEGETHARDWAREREGISTERMAPPEDADDRESS) WdfVersion.Functions.pfnWdfDeviceGetHardwareRegisterMappedAddress)(DriverGlobals, Device, PseudoBaseAddress); 1261 } 1262 1263 _IRQL_requires_max_(PASSIVE_LEVEL) 1264 WDFAPI 1265 SIZE_T 1266 VFWDFEXPORT(WdfDeviceReadFromHardware)( 1267 _In_ 1268 PWDF_DRIVER_GLOBALS DriverGlobals, 1269 _In_ 1270 WDFDEVICE Device, 1271 _In_ 1272 WDF_DEVICE_HWACCESS_TARGET_TYPE Type, 1273 _In_ 1274 WDF_DEVICE_HWACCESS_TARGET_SIZE Size, 1275 _In_ 1276 PVOID TargetAddress, 1277 _Out_writes_all_opt_(Count) 1278 PVOID Buffer, 1279 _In_opt_ 1280 ULONG Count 1281 ) 1282 { 1283 PAGED_CODE_LOCKED(); 1284 return ((PFN_WDFDEVICEREADFROMHARDWARE) WdfVersion.Functions.pfnWdfDeviceReadFromHardware)(DriverGlobals, Device, Type, Size, TargetAddress, Buffer, Count); 1285 } 1286 1287 _IRQL_requires_max_(PASSIVE_LEVEL) 1288 WDFAPI 1289 VOID 1290 VFWDFEXPORT(WdfDeviceWriteToHardware)( 1291 _In_ 1292 PWDF_DRIVER_GLOBALS DriverGlobals, 1293 _In_ 1294 WDFDEVICE Device, 1295 _In_ 1296 WDF_DEVICE_HWACCESS_TARGET_TYPE Type, 1297 _In_ 1298 WDF_DEVICE_HWACCESS_TARGET_SIZE Size, 1299 _In_ 1300 PVOID TargetAddress, 1301 _In_ 1302 SIZE_T Value, 1303 _In_reads_opt_(Count) 1304 PVOID Buffer, 1305 _In_opt_ 1306 ULONG Count 1307 ) 1308 { 1309 PAGED_CODE_LOCKED(); 1310 ((PFN_WDFDEVICEWRITETOHARDWARE) WdfVersion.Functions.pfnWdfDeviceWriteToHardware)(DriverGlobals, Device, Type, Size, TargetAddress, Value, Buffer, Count); 1311 } 1312 1313 _IRQL_requires_max_(PASSIVE_LEVEL) 1314 WDFAPI 1315 NTSTATUS 1316 VFWDFEXPORT(WdfDeviceAssignInterfaceProperty)( 1317 _In_ 1318 PWDF_DRIVER_GLOBALS DriverGlobals, 1319 _In_ 1320 WDFDEVICE Device, 1321 _In_ 1322 PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, 1323 _In_ 1324 DEVPROPTYPE Type, 1325 _In_ 1326 ULONG BufferLength, 1327 _In_reads_bytes_opt_(BufferLength) 1328 PVOID PropertyBuffer 1329 ) 1330 { 1331 PAGED_CODE_LOCKED(); 1332 return ((PFN_WDFDEVICEASSIGNINTERFACEPROPERTY) WdfVersion.Functions.pfnWdfDeviceAssignInterfaceProperty)(DriverGlobals, Device, PropertyData, Type, BufferLength, PropertyBuffer); 1333 } 1334 1335 _IRQL_requires_max_(PASSIVE_LEVEL) 1336 WDFAPI 1337 NTSTATUS 1338 VFWDFEXPORT(WdfDeviceAllocAndQueryInterfaceProperty)( 1339 _In_ 1340 PWDF_DRIVER_GLOBALS DriverGlobals, 1341 _In_ 1342 WDFDEVICE Device, 1343 _In_ 1344 PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, 1345 _In_ 1346 POOL_TYPE PoolType, 1347 _In_opt_ 1348 PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, 1349 _Out_ 1350 WDFMEMORY* PropertyMemory, 1351 _Out_ 1352 PDEVPROPTYPE Type 1353 ) 1354 { 1355 PAGED_CODE_LOCKED(); 1356 return ((PFN_WDFDEVICEALLOCANDQUERYINTERFACEPROPERTY) WdfVersion.Functions.pfnWdfDeviceAllocAndQueryInterfaceProperty)(DriverGlobals, Device, PropertyData, PoolType, PropertyMemoryAttributes, PropertyMemory, Type); 1357 } 1358 1359 _IRQL_requires_max_(PASSIVE_LEVEL) 1360 WDFAPI 1361 NTSTATUS 1362 VFWDFEXPORT(WdfDeviceQueryInterfaceProperty)( 1363 _In_ 1364 PWDF_DRIVER_GLOBALS DriverGlobals, 1365 _In_ 1366 WDFDEVICE Device, 1367 _In_ 1368 PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData, 1369 _In_ 1370 ULONG BufferLength, 1371 _Out_writes_bytes_opt_(BufferLength) 1372 PVOID PropertyBuffer, 1373 _Out_ 1374 PULONG ResultLength, 1375 _Out_ 1376 PDEVPROPTYPE Type 1377 ) 1378 { 1379 PAGED_CODE_LOCKED(); 1380 return ((PFN_WDFDEVICEQUERYINTERFACEPROPERTY) WdfVersion.Functions.pfnWdfDeviceQueryInterfaceProperty)(DriverGlobals, Device, PropertyData, BufferLength, PropertyBuffer, ResultLength, Type); 1381 } 1382 1383 _IRQL_requires_max_(PASSIVE_LEVEL) 1384 WDFAPI 1385 VOID 1386 VFWDFEXPORT(WdfDeviceGetDeviceStackIoType)( 1387 _In_ 1388 PWDF_DRIVER_GLOBALS DriverGlobals, 1389 _In_ 1390 WDFDEVICE Device, 1391 _Out_ 1392 WDF_DEVICE_IO_TYPE* ReadWriteIoType, 1393 _Out_ 1394 WDF_DEVICE_IO_TYPE* IoControlIoType 1395 ) 1396 { 1397 PAGED_CODE_LOCKED(); 1398 ((PFN_WDFDEVICEGETDEVICESTACKIOTYPE) WdfVersion.Functions.pfnWdfDeviceGetDeviceStackIoType)(DriverGlobals, Device, ReadWriteIoType, IoControlIoType); 1399 } 1400 1401 _Must_inspect_result_ 1402 _IRQL_requires_max_(APC_LEVEL) 1403 WDFAPI 1404 NTSTATUS 1405 VFWDFEXPORT(WdfDeviceQueryPropertyEx)( 1406 _In_ 1407 PWDF_DRIVER_GLOBALS DriverGlobals, 1408 _In_ 1409 WDFDEVICE Device, 1410 _In_ 1411 PWDF_DEVICE_PROPERTY_DATA DeviceProperty, 1412 _In_ 1413 ULONG BufferLength, 1414 _Out_ 1415 PVOID PropertyBuffer, 1416 _Out_ 1417 PULONG RequiredSize, 1418 _Out_ 1419 PDEVPROPTYPE Type 1420 ) 1421 { 1422 PAGED_CODE_LOCKED(); 1423 return ((PFN_WDFDEVICEQUERYPROPERTYEX) WdfVersion.Functions.pfnWdfDeviceQueryPropertyEx)(DriverGlobals, Device, DeviceProperty, BufferLength, PropertyBuffer, RequiredSize, Type); 1424 } 1425 1426 _Must_inspect_result_ 1427 _IRQL_requires_max_(APC_LEVEL) 1428 WDFAPI 1429 NTSTATUS 1430 VFWDFEXPORT(WdfDeviceAllocAndQueryPropertyEx)( 1431 _In_ 1432 PWDF_DRIVER_GLOBALS DriverGlobals, 1433 _In_ 1434 WDFDEVICE Device, 1435 _In_ 1436 PWDF_DEVICE_PROPERTY_DATA DeviceProperty, 1437 _In_ 1438 _Strict_type_match_ 1439 POOL_TYPE PoolType, 1440 _In_opt_ 1441 PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, 1442 _Out_ 1443 WDFMEMORY* PropertyMemory, 1444 _Out_ 1445 PDEVPROPTYPE Type 1446 ) 1447 { 1448 PAGED_CODE_LOCKED(); 1449 return ((PFN_WDFDEVICEALLOCANDQUERYPROPERTYEX) WdfVersion.Functions.pfnWdfDeviceAllocAndQueryPropertyEx)(DriverGlobals, Device, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory, Type); 1450 } 1451 1452 _Must_inspect_result_ 1453 _IRQL_requires_max_(APC_LEVEL) 1454 WDFAPI 1455 NTSTATUS 1456 VFWDFEXPORT(WdfDeviceAssignProperty)( 1457 _In_ 1458 PWDF_DRIVER_GLOBALS DriverGlobals, 1459 _In_ 1460 WDFDEVICE Device, 1461 _In_ 1462 PWDF_DEVICE_PROPERTY_DATA DeviceProperty, 1463 _In_ 1464 DEVPROPTYPE Type, 1465 _In_ 1466 ULONG Size, 1467 _In_opt_ 1468 PVOID Data 1469 ) 1470 { 1471 PAGED_CODE_LOCKED(); 1472 return ((PFN_WDFDEVICEASSIGNPROPERTY) WdfVersion.Functions.pfnWdfDeviceAssignProperty)(DriverGlobals, Device, DeviceProperty, Type, Size, Data); 1473 } 1474 1475 _IRQL_requires_max_(DISPATCH_LEVEL) 1476 WDFAPI 1477 WDFIOTARGET 1478 VFWDFEXPORT(WdfDeviceGetSelfIoTarget)( 1479 _In_ 1480 PWDF_DRIVER_GLOBALS DriverGlobals, 1481 _In_ 1482 WDFDEVICE Device 1483 ) 1484 { 1485 PAGED_CODE_LOCKED(); 1486 return ((PFN_WDFDEVICEGETSELFIOTARGET) WdfVersion.Functions.pfnWdfDeviceGetSelfIoTarget)(DriverGlobals, Device); 1487 } 1488 1489 _IRQL_requires_max_(DISPATCH_LEVEL) 1490 WDFAPI 1491 VOID 1492 VFWDFEXPORT(WdfDeviceInitAllowSelfIoTarget)( 1493 _In_ 1494 PWDF_DRIVER_GLOBALS DriverGlobals, 1495 _In_ 1496 PWDFDEVICE_INIT DeviceInit 1497 ) 1498 { 1499 PAGED_CODE_LOCKED(); 1500 ((PFN_WDFDEVICEINITALLOWSELFIOTARGET) WdfVersion.Functions.pfnWdfDeviceInitAllowSelfIoTarget)(DriverGlobals, DeviceInit); 1501 } 1502 1503 _Must_inspect_result_ 1504 _IRQL_requires_max_(PASSIVE_LEVEL) 1505 WDFAPI 1506 NTSTATUS 1507 VFWDFEXPORT(WdfDriverCreate)( 1508 _In_ 1509 PWDF_DRIVER_GLOBALS DriverGlobals, 1510 _In_ 1511 PDRIVER_OBJECT DriverObject, 1512 _In_ 1513 PCUNICODE_STRING RegistryPath, 1514 _In_opt_ 1515 PWDF_OBJECT_ATTRIBUTES DriverAttributes, 1516 _In_ 1517 PWDF_DRIVER_CONFIG DriverConfig, 1518 _Out_opt_ 1519 WDFDRIVER* Driver 1520 ) 1521 { 1522 PAGED_CODE_LOCKED(); 1523 return ((PFN_WDFDRIVERCREATE) WdfVersion.Functions.pfnWdfDriverCreate)(DriverGlobals, DriverObject, RegistryPath, DriverAttributes, DriverConfig, Driver); 1524 } 1525 1526 _IRQL_requires_max_(PASSIVE_LEVEL) 1527 WDFAPI 1528 PWSTR 1529 VFWDFEXPORT(WdfDriverGetRegistryPath)( 1530 _In_ 1531 PWDF_DRIVER_GLOBALS DriverGlobals, 1532 _In_ 1533 WDFDRIVER Driver 1534 ) 1535 { 1536 PAGED_CODE_LOCKED(); 1537 return ((PFN_WDFDRIVERGETREGISTRYPATH) WdfVersion.Functions.pfnWdfDriverGetRegistryPath)(DriverGlobals, Driver); 1538 } 1539 1540 _Must_inspect_result_ 1541 _IRQL_requires_max_(PASSIVE_LEVEL) 1542 WDFAPI 1543 NTSTATUS 1544 VFWDFEXPORT(WdfDriverOpenParametersRegistryKey)( 1545 _In_ 1546 PWDF_DRIVER_GLOBALS DriverGlobals, 1547 _In_ 1548 WDFDRIVER Driver, 1549 _In_ 1550 ACCESS_MASK DesiredAccess, 1551 _In_opt_ 1552 PWDF_OBJECT_ATTRIBUTES KeyAttributes, 1553 _Out_ 1554 WDFKEY* Key 1555 ) 1556 { 1557 PAGED_CODE_LOCKED(); 1558 return ((PFN_WDFDRIVEROPENPARAMETERSREGISTRYKEY) WdfVersion.Functions.pfnWdfDriverOpenParametersRegistryKey)(DriverGlobals, Driver, DesiredAccess, KeyAttributes, Key); 1559 } 1560 1561 _Must_inspect_result_ 1562 _IRQL_requires_max_(PASSIVE_LEVEL) 1563 WDFAPI 1564 NTSTATUS 1565 VFWDFEXPORT(WdfDriverRetrieveVersionString)( 1566 _In_ 1567 PWDF_DRIVER_GLOBALS DriverGlobals, 1568 _In_ 1569 WDFDRIVER Driver, 1570 _In_ 1571 WDFSTRING String 1572 ) 1573 { 1574 PAGED_CODE_LOCKED(); 1575 return ((PFN_WDFDRIVERRETRIEVEVERSIONSTRING) WdfVersion.Functions.pfnWdfDriverRetrieveVersionString)(DriverGlobals, Driver, String); 1576 } 1577 1578 _Must_inspect_result_ 1579 _IRQL_requires_max_(PASSIVE_LEVEL) 1580 WDFAPI 1581 BOOLEAN 1582 VFWDFEXPORT(WdfDriverIsVersionAvailable)( 1583 _In_ 1584 PWDF_DRIVER_GLOBALS DriverGlobals, 1585 _In_ 1586 WDFDRIVER Driver, 1587 _In_ 1588 PWDF_DRIVER_VERSION_AVAILABLE_PARAMS VersionAvailableParams 1589 ) 1590 { 1591 PAGED_CODE_LOCKED(); 1592 return ((PFN_WDFDRIVERISVERSIONAVAILABLE) WdfVersion.Functions.pfnWdfDriverIsVersionAvailable)(DriverGlobals, Driver, VersionAvailableParams); 1593 } 1594 1595 _Must_inspect_result_ 1596 _IRQL_requires_max_(PASSIVE_LEVEL) 1597 WDFAPI 1598 NTSTATUS 1599 VFWDFEXPORT(WdfFdoInitOpenRegistryKey)( 1600 _In_ 1601 PWDF_DRIVER_GLOBALS DriverGlobals, 1602 _In_ 1603 PWDFDEVICE_INIT DeviceInit, 1604 _In_ 1605 ULONG DeviceInstanceKeyType, 1606 _In_ 1607 ACCESS_MASK DesiredAccess, 1608 _In_opt_ 1609 PWDF_OBJECT_ATTRIBUTES KeyAttributes, 1610 _Out_ 1611 WDFKEY* Key 1612 ) 1613 { 1614 PAGED_CODE_LOCKED(); 1615 return ((PFN_WDFFDOINITOPENREGISTRYKEY) WdfVersion.Functions.pfnWdfFdoInitOpenRegistryKey)(DriverGlobals, DeviceInit, DeviceInstanceKeyType, DesiredAccess, KeyAttributes, Key); 1616 } 1617 1618 _Must_inspect_result_ 1619 _IRQL_requires_max_(PASSIVE_LEVEL) 1620 WDFAPI 1621 NTSTATUS 1622 VFWDFEXPORT(WdfFdoInitQueryProperty)( 1623 _In_ 1624 PWDF_DRIVER_GLOBALS DriverGlobals, 1625 _In_ 1626 PWDFDEVICE_INIT DeviceInit, 1627 _In_ 1628 DEVICE_REGISTRY_PROPERTY DeviceProperty, 1629 _In_ 1630 ULONG BufferLength, 1631 _Out_writes_bytes_all_opt_(BufferLength) 1632 PVOID PropertyBuffer, 1633 _Out_ 1634 PULONG ResultLength 1635 ) 1636 { 1637 PAGED_CODE_LOCKED(); 1638 return ((PFN_WDFFDOINITQUERYPROPERTY) WdfVersion.Functions.pfnWdfFdoInitQueryProperty)(DriverGlobals, DeviceInit, DeviceProperty, BufferLength, PropertyBuffer, ResultLength); 1639 } 1640 1641 _Must_inspect_result_ 1642 _IRQL_requires_max_(PASSIVE_LEVEL) 1643 WDFAPI 1644 NTSTATUS 1645 VFWDFEXPORT(WdfFdoInitAllocAndQueryProperty)( 1646 _In_ 1647 PWDF_DRIVER_GLOBALS DriverGlobals, 1648 _In_ 1649 PWDFDEVICE_INIT DeviceInit, 1650 _In_ 1651 DEVICE_REGISTRY_PROPERTY DeviceProperty, 1652 _In_ 1653 _Strict_type_match_ 1654 POOL_TYPE PoolType, 1655 _In_opt_ 1656 PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, 1657 _Out_ 1658 WDFMEMORY* PropertyMemory 1659 ) 1660 { 1661 PAGED_CODE_LOCKED(); 1662 return ((PFN_WDFFDOINITALLOCANDQUERYPROPERTY) WdfVersion.Functions.pfnWdfFdoInitAllocAndQueryProperty)(DriverGlobals, DeviceInit, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory); 1663 } 1664 1665 _Must_inspect_result_ 1666 _IRQL_requires_max_(PASSIVE_LEVEL) 1667 WDFAPI 1668 NTSTATUS 1669 VFWDFEXPORT(WdfFdoInitQueryPropertyEx)( 1670 _In_ 1671 PWDF_DRIVER_GLOBALS DriverGlobals, 1672 _In_ 1673 PWDFDEVICE_INIT DeviceInit, 1674 _In_ 1675 PWDF_DEVICE_PROPERTY_DATA DeviceProperty, 1676 _In_ 1677 ULONG BufferLength, 1678 _Out_ 1679 PVOID PropertyBuffer, 1680 _Out_ 1681 PULONG ResultLength, 1682 _Out_ 1683 PDEVPROPTYPE Type 1684 ) 1685 { 1686 PAGED_CODE_LOCKED(); 1687 return ((PFN_WDFFDOINITQUERYPROPERTYEX) WdfVersion.Functions.pfnWdfFdoInitQueryPropertyEx)(DriverGlobals, DeviceInit, DeviceProperty, BufferLength, PropertyBuffer, ResultLength, Type); 1688 } 1689 1690 _Must_inspect_result_ 1691 _IRQL_requires_max_(PASSIVE_LEVEL) 1692 WDFAPI 1693 NTSTATUS 1694 VFWDFEXPORT(WdfFdoInitAllocAndQueryPropertyEx)( 1695 _In_ 1696 PWDF_DRIVER_GLOBALS DriverGlobals, 1697 _In_ 1698 PWDFDEVICE_INIT DeviceInit, 1699 _In_ 1700 PWDF_DEVICE_PROPERTY_DATA DeviceProperty, 1701 _In_ 1702 _Strict_type_match_ 1703 POOL_TYPE PoolType, 1704 _In_opt_ 1705 PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, 1706 _Out_ 1707 WDFMEMORY* PropertyMemory, 1708 _Out_ 1709 PDEVPROPTYPE Type 1710 ) 1711 { 1712 PAGED_CODE_LOCKED(); 1713 return ((PFN_WDFFDOINITALLOCANDQUERYPROPERTYEX) WdfVersion.Functions.pfnWdfFdoInitAllocAndQueryPropertyEx)(DriverGlobals, DeviceInit, DeviceProperty, PoolType, PropertyMemoryAttributes, PropertyMemory, Type); 1714 } 1715 1716 _IRQL_requires_max_(PASSIVE_LEVEL) 1717 WDFAPI 1718 VOID 1719 VFWDFEXPORT(WdfFdoInitSetFilter)( 1720 _In_ 1721 PWDF_DRIVER_GLOBALS DriverGlobals, 1722 _In_ 1723 PWDFDEVICE_INIT DeviceInit 1724 ) 1725 { 1726 PAGED_CODE_LOCKED(); 1727 ((PFN_WDFFDOINITSETFILTER) WdfVersion.Functions.pfnWdfFdoInitSetFilter)(DriverGlobals, DeviceInit); 1728 } 1729 1730 _IRQL_requires_max_(PASSIVE_LEVEL) 1731 WDFAPI 1732 PUNICODE_STRING 1733 VFWDFEXPORT(WdfFileObjectGetFileName)( 1734 _In_ 1735 PWDF_DRIVER_GLOBALS DriverGlobals, 1736 _In_ 1737 WDFFILEOBJECT FileObject 1738 ) 1739 { 1740 PAGED_CODE_LOCKED(); 1741 return ((PFN_WDFFILEOBJECTGETFILENAME) WdfVersion.Functions.pfnWdfFileObjectGetFileName)(DriverGlobals, FileObject); 1742 } 1743 1744 _IRQL_requires_max_(DISPATCH_LEVEL) 1745 WDFAPI 1746 WDFDEVICE 1747 VFWDFEXPORT(WdfFileObjectGetDevice)( 1748 _In_ 1749 PWDF_DRIVER_GLOBALS DriverGlobals, 1750 _In_ 1751 WDFFILEOBJECT FileObject 1752 ) 1753 { 1754 PAGED_CODE_LOCKED(); 1755 return ((PFN_WDFFILEOBJECTGETDEVICE) WdfVersion.Functions.pfnWdfFileObjectGetDevice)(DriverGlobals, FileObject); 1756 } 1757 1758 _IRQL_requires_max_(PASSIVE_LEVEL) 1759 WDFAPI 1760 ULONG 1761 VFWDFEXPORT(WdfFileObjectGetInitiatorProcessId)( 1762 _In_ 1763 PWDF_DRIVER_GLOBALS DriverGlobals, 1764 _In_ 1765 WDFFILEOBJECT FileObject 1766 ) 1767 { 1768 PAGED_CODE_LOCKED(); 1769 return ((PFN_WDFFILEOBJECTGETINITIATORPROCESSID) WdfVersion.Functions.pfnWdfFileObjectGetInitiatorProcessId)(DriverGlobals, FileObject); 1770 } 1771 1772 _IRQL_requires_max_(PASSIVE_LEVEL) 1773 WDFAPI 1774 WDFFILEOBJECT 1775 VFWDFEXPORT(WdfFileObjectGetRelatedFileObject)( 1776 _In_ 1777 PWDF_DRIVER_GLOBALS DriverGlobals, 1778 _In_ 1779 WDFFILEOBJECT FileObject 1780 ) 1781 { 1782 PAGED_CODE_LOCKED(); 1783 return ((PFN_WDFFILEOBJECTGETRELATEDFILEOBJECT) WdfVersion.Functions.pfnWdfFileObjectGetRelatedFileObject)(DriverGlobals, FileObject); 1784 } 1785 1786 _IRQL_requires_max_(PASSIVE_LEVEL) 1787 WDFAPI 1788 VOID 1789 VFWDFEXPORT(WdfDeviceInitEnableHidInterface)( 1790 _In_ 1791 PWDF_DRIVER_GLOBALS DriverGlobals, 1792 _In_ 1793 PWDFDEVICE_INIT DeviceInit 1794 ) 1795 { 1796 PAGED_CODE_LOCKED(); 1797 ((PFN_WDFDEVICEINITENABLEHIDINTERFACE) WdfVersion.Functions.pfnWdfDeviceInitEnableHidInterface)(DriverGlobals, DeviceInit); 1798 } 1799 1800 _Must_inspect_result_ 1801 _IRQL_requires_max_(PASSIVE_LEVEL) 1802 WDFAPI 1803 NTSTATUS 1804 VFWDFEXPORT(WdfDeviceHidNotifyPresence)( 1805 _In_ 1806 PWDF_DRIVER_GLOBALS DriverGlobals, 1807 _In_ 1808 WDFDEVICE Device, 1809 _In_ 1810 BOOLEAN IsPresent 1811 ) 1812 { 1813 PAGED_CODE_LOCKED(); 1814 return ((PFN_WDFDEVICEHIDNOTIFYPRESENCE) WdfVersion.Functions.pfnWdfDeviceHidNotifyPresence)(DriverGlobals, Device, IsPresent); 1815 } 1816 1817 _Must_inspect_result_ 1818 _IRQL_requires_max_(DISPATCH_LEVEL) 1819 WDFAPI 1820 NTSTATUS 1821 VFWDFEXPORT(WdfInterruptCreate)( 1822 _In_ 1823 PWDF_DRIVER_GLOBALS DriverGlobals, 1824 _In_ 1825 WDFDEVICE Device, 1826 _In_ 1827 PWDF_INTERRUPT_CONFIG Configuration, 1828 _In_opt_ 1829 PWDF_OBJECT_ATTRIBUTES Attributes, 1830 _Out_ 1831 WDFINTERRUPT* Interrupt 1832 ) 1833 { 1834 PAGED_CODE_LOCKED(); 1835 return ((PFN_WDFINTERRUPTCREATE) WdfVersion.Functions.pfnWdfInterruptCreate)(DriverGlobals, Device, Configuration, Attributes, Interrupt); 1836 } 1837 1838 WDFAPI 1839 BOOLEAN 1840 VFWDFEXPORT(WdfInterruptQueueDpcForIsr)( 1841 _In_ 1842 PWDF_DRIVER_GLOBALS DriverGlobals, 1843 _In_ 1844 WDFINTERRUPT Interrupt 1845 ) 1846 { 1847 PAGED_CODE_LOCKED(); 1848 return ((PFN_WDFINTERRUPTQUEUEDPCFORISR) WdfVersion.Functions.pfnWdfInterruptQueueDpcForIsr)(DriverGlobals, Interrupt); 1849 } 1850 1851 WDFAPI 1852 BOOLEAN 1853 VFWDFEXPORT(WdfInterruptQueueWorkItemForIsr)( 1854 _In_ 1855 PWDF_DRIVER_GLOBALS DriverGlobals, 1856 _In_ 1857 WDFINTERRUPT Interrupt 1858 ) 1859 { 1860 PAGED_CODE_LOCKED(); 1861 return ((PFN_WDFINTERRUPTQUEUEWORKITEMFORISR) WdfVersion.Functions.pfnWdfInterruptQueueWorkItemForIsr)(DriverGlobals, Interrupt); 1862 } 1863 1864 _IRQL_requires_max_(DISPATCH_LEVEL) 1865 WDFAPI 1866 BOOLEAN 1867 VFWDFEXPORT(WdfInterruptSynchronize)( 1868 _In_ 1869 PWDF_DRIVER_GLOBALS DriverGlobals, 1870 _In_ 1871 WDFINTERRUPT Interrupt, 1872 _In_ 1873 PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, 1874 _In_ 1875 WDFCONTEXT Context 1876 ) 1877 { 1878 PAGED_CODE_LOCKED(); 1879 return ((PFN_WDFINTERRUPTSYNCHRONIZE) WdfVersion.Functions.pfnWdfInterruptSynchronize)(DriverGlobals, Interrupt, Callback, Context); 1880 } 1881 1882 _IRQL_requires_max_(DISPATCH_LEVEL + 1) 1883 WDFAPI 1884 VOID 1885 VFWDFEXPORT(WdfInterruptAcquireLock)( 1886 _In_ 1887 PWDF_DRIVER_GLOBALS DriverGlobals, 1888 _In_ 1889 _Requires_lock_not_held_(_Curr_) 1890 _Acquires_lock_(_Curr_) 1891 WDFINTERRUPT Interrupt 1892 ) 1893 { 1894 PAGED_CODE_LOCKED(); 1895 ((PFN_WDFINTERRUPTACQUIRELOCK) WdfVersion.Functions.pfnWdfInterruptAcquireLock)(DriverGlobals, Interrupt); 1896 } 1897 1898 _IRQL_requires_max_(DISPATCH_LEVEL + 1) 1899 WDFAPI 1900 VOID 1901 VFWDFEXPORT(WdfInterruptReleaseLock)( 1902 _In_ 1903 PWDF_DRIVER_GLOBALS DriverGlobals, 1904 _In_ 1905 _Requires_lock_held_(_Curr_) 1906 _Releases_lock_(_Curr_) 1907 WDFINTERRUPT Interrupt 1908 ) 1909 { 1910 PAGED_CODE_LOCKED(); 1911 ((PFN_WDFINTERRUPTRELEASELOCK) WdfVersion.Functions.pfnWdfInterruptReleaseLock)(DriverGlobals, Interrupt); 1912 } 1913 1914 _IRQL_requires_max_(PASSIVE_LEVEL) 1915 WDFAPI 1916 VOID 1917 VFWDFEXPORT(WdfInterruptEnable)( 1918 _In_ 1919 PWDF_DRIVER_GLOBALS DriverGlobals, 1920 _In_ 1921 WDFINTERRUPT Interrupt 1922 ) 1923 { 1924 PAGED_CODE_LOCKED(); 1925 ((PFN_WDFINTERRUPTENABLE) WdfVersion.Functions.pfnWdfInterruptEnable)(DriverGlobals, Interrupt); 1926 } 1927 1928 _IRQL_requires_max_(PASSIVE_LEVEL) 1929 WDFAPI 1930 VOID 1931 VFWDFEXPORT(WdfInterruptDisable)( 1932 _In_ 1933 PWDF_DRIVER_GLOBALS DriverGlobals, 1934 _In_ 1935 WDFINTERRUPT Interrupt 1936 ) 1937 { 1938 PAGED_CODE_LOCKED(); 1939 ((PFN_WDFINTERRUPTDISABLE) WdfVersion.Functions.pfnWdfInterruptDisable)(DriverGlobals, Interrupt); 1940 } 1941 1942 _IRQL_requires_max_(DISPATCH_LEVEL) 1943 WDFAPI 1944 VOID 1945 VFWDFEXPORT(WdfInterruptGetInfo)( 1946 _In_ 1947 PWDF_DRIVER_GLOBALS DriverGlobals, 1948 _In_ 1949 WDFINTERRUPT Interrupt, 1950 _Out_ 1951 PWDF_INTERRUPT_INFO Info 1952 ) 1953 { 1954 PAGED_CODE_LOCKED(); 1955 ((PFN_WDFINTERRUPTGETINFO) WdfVersion.Functions.pfnWdfInterruptGetInfo)(DriverGlobals, Interrupt, Info); 1956 } 1957 1958 _IRQL_requires_max_(DISPATCH_LEVEL) 1959 WDFAPI 1960 VOID 1961 VFWDFEXPORT(WdfInterruptSetPolicy)( 1962 _In_ 1963 PWDF_DRIVER_GLOBALS DriverGlobals, 1964 _In_ 1965 WDFINTERRUPT Interrupt, 1966 _In_ 1967 WDF_INTERRUPT_POLICY Policy, 1968 _In_ 1969 WDF_INTERRUPT_PRIORITY Priority, 1970 _In_ 1971 KAFFINITY TargetProcessorSet 1972 ) 1973 { 1974 PAGED_CODE_LOCKED(); 1975 ((PFN_WDFINTERRUPTSETPOLICY) WdfVersion.Functions.pfnWdfInterruptSetPolicy)(DriverGlobals, Interrupt, Policy, Priority, TargetProcessorSet); 1976 } 1977 1978 _IRQL_requires_max_(DISPATCH_LEVEL) 1979 WDFAPI 1980 VOID 1981 VFWDFEXPORT(WdfInterruptSetExtendedPolicy)( 1982 _In_ 1983 PWDF_DRIVER_GLOBALS DriverGlobals, 1984 _In_ 1985 WDFINTERRUPT Interrupt, 1986 _In_ 1987 PWDF_INTERRUPT_EXTENDED_POLICY PolicyAndGroup 1988 ) 1989 { 1990 PAGED_CODE_LOCKED(); 1991 ((PFN_WDFINTERRUPTSETEXTENDEDPOLICY) WdfVersion.Functions.pfnWdfInterruptSetExtendedPolicy)(DriverGlobals, Interrupt, PolicyAndGroup); 1992 } 1993 1994 WDFAPI 1995 WDFDEVICE 1996 VFWDFEXPORT(WdfInterruptGetDevice)( 1997 _In_ 1998 PWDF_DRIVER_GLOBALS DriverGlobals, 1999 _In_ 2000 WDFINTERRUPT Interrupt 2001 ) 2002 { 2003 PAGED_CODE_LOCKED(); 2004 return ((PFN_WDFINTERRUPTGETDEVICE) WdfVersion.Functions.pfnWdfInterruptGetDevice)(DriverGlobals, Interrupt); 2005 } 2006 2007 _Must_inspect_result_ 2008 _Post_satisfies_(return == 1 || return == 0) 2009 _IRQL_requires_max_(PASSIVE_LEVEL) 2010 WDFAPI 2011 BOOLEAN 2012 VFWDFEXPORT(WdfInterruptTryToAcquireLock)( 2013 _In_ 2014 PWDF_DRIVER_GLOBALS DriverGlobals, 2015 _In_ 2016 _Requires_lock_not_held_(_Curr_) 2017 _When_(return!=0, _Acquires_lock_(_Curr_)) 2018 WDFINTERRUPT Interrupt 2019 ) 2020 { 2021 PAGED_CODE_LOCKED(); 2022 return ((PFN_WDFINTERRUPTTRYTOACQUIRELOCK) WdfVersion.Functions.pfnWdfInterruptTryToAcquireLock)(DriverGlobals, Interrupt); 2023 } 2024 2025 _Must_inspect_result_ 2026 _IRQL_requires_max_(DISPATCH_LEVEL) 2027 WDFAPI 2028 NTSTATUS 2029 VFWDFEXPORT(WdfIoQueueCreate)( 2030 _In_ 2031 PWDF_DRIVER_GLOBALS DriverGlobals, 2032 _In_ 2033 WDFDEVICE Device, 2034 _In_ 2035 PWDF_IO_QUEUE_CONFIG Config, 2036 _In_opt_ 2037 PWDF_OBJECT_ATTRIBUTES QueueAttributes, 2038 _Out_opt_ 2039 WDFQUEUE* Queue 2040 ) 2041 { 2042 VF_HOOK_PROCESS_INFO hookInfo; 2043 NTSTATUS status; 2044 2045 PAGED_CODE_LOCKED(); 2046 RtlZeroMemory(&hookInfo, sizeof(VF_HOOK_PROCESS_INFO)); 2047 2048 status = AddEventHooksWdfIoQueueCreate( 2049 &hookInfo, 2050 DriverGlobals, 2051 Device, 2052 Config, 2053 QueueAttributes, 2054 Queue); 2055 2056 UNREFERENCED_PARAMETER(status); 2057 2058 if (hookInfo.DonotCallKmdfLib) { 2059 return hookInfo.DdiCallStatus; 2060 } 2061 2062 return ((PFN_WDFIOQUEUECREATE) WdfVersion.Functions.pfnWdfIoQueueCreate)(DriverGlobals, Device, Config, QueueAttributes, Queue); 2063 } 2064 2065 _IRQL_requires_max_(DISPATCH_LEVEL) 2066 WDFAPI 2067 WDF_IO_QUEUE_STATE 2068 VFWDFEXPORT(WdfIoQueueGetState)( 2069 _In_ 2070 PWDF_DRIVER_GLOBALS DriverGlobals, 2071 _In_ 2072 WDFQUEUE Queue, 2073 _Out_opt_ 2074 PULONG QueueRequests, 2075 _Out_opt_ 2076 PULONG DriverRequests 2077 ) 2078 { 2079 PAGED_CODE_LOCKED(); 2080 return ((PFN_WDFIOQUEUEGETSTATE) WdfVersion.Functions.pfnWdfIoQueueGetState)(DriverGlobals, Queue, QueueRequests, DriverRequests); 2081 } 2082 2083 _IRQL_requires_max_(DISPATCH_LEVEL) 2084 WDFAPI 2085 VOID 2086 VFWDFEXPORT(WdfIoQueueStart)( 2087 _In_ 2088 PWDF_DRIVER_GLOBALS DriverGlobals, 2089 _In_ 2090 WDFQUEUE Queue 2091 ) 2092 { 2093 PAGED_CODE_LOCKED(); 2094 ((PFN_WDFIOQUEUESTART) WdfVersion.Functions.pfnWdfIoQueueStart)(DriverGlobals, Queue); 2095 } 2096 2097 _IRQL_requires_max_(DISPATCH_LEVEL) 2098 WDFAPI 2099 VOID 2100 VFWDFEXPORT(WdfIoQueueStop)( 2101 _In_ 2102 PWDF_DRIVER_GLOBALS DriverGlobals, 2103 _In_ 2104 WDFQUEUE Queue, 2105 _When_(Context != 0, _In_) 2106 _When_(Context == 0, _In_opt_) 2107 PFN_WDF_IO_QUEUE_STATE StopComplete, 2108 _When_(StopComplete != 0, _In_) 2109 _When_(StopComplete == 0, _In_opt_) 2110 WDFCONTEXT Context 2111 ) 2112 { 2113 PAGED_CODE_LOCKED(); 2114 ((PFN_WDFIOQUEUESTOP) WdfVersion.Functions.pfnWdfIoQueueStop)(DriverGlobals, Queue, StopComplete, Context); 2115 } 2116 2117 _IRQL_requires_max_(PASSIVE_LEVEL) 2118 WDFAPI 2119 VOID 2120 VFWDFEXPORT(WdfIoQueueStopSynchronously)( 2121 _In_ 2122 PWDF_DRIVER_GLOBALS DriverGlobals, 2123 _In_ 2124 WDFQUEUE Queue 2125 ) 2126 { 2127 PAGED_CODE_LOCKED(); 2128 ((PFN_WDFIOQUEUESTOPSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoQueueStopSynchronously)(DriverGlobals, Queue); 2129 } 2130 2131 _IRQL_requires_max_(DISPATCH_LEVEL) 2132 WDFAPI 2133 WDFDEVICE 2134 VFWDFEXPORT(WdfIoQueueGetDevice)( 2135 _In_ 2136 PWDF_DRIVER_GLOBALS DriverGlobals, 2137 _In_ 2138 WDFQUEUE Queue 2139 ) 2140 { 2141 PAGED_CODE_LOCKED(); 2142 return ((PFN_WDFIOQUEUEGETDEVICE) WdfVersion.Functions.pfnWdfIoQueueGetDevice)(DriverGlobals, Queue); 2143 } 2144 2145 _Must_inspect_result_ 2146 _IRQL_requires_max_(DISPATCH_LEVEL) 2147 WDFAPI 2148 NTSTATUS 2149 VFWDFEXPORT(WdfIoQueueRetrieveNextRequest)( 2150 _In_ 2151 PWDF_DRIVER_GLOBALS DriverGlobals, 2152 _In_ 2153 WDFQUEUE Queue, 2154 _Out_ 2155 WDFREQUEST* OutRequest 2156 ) 2157 { 2158 PAGED_CODE_LOCKED(); 2159 NTSTATUS rtn = ((PFN_WDFIOQUEUERETRIEVENEXTREQUEST) WdfVersion.Functions.pfnWdfIoQueueRetrieveNextRequest)(DriverGlobals, Queue, OutRequest); 2160 if (rtn == STATUS_SUCCESS) { 2161 PerfIoStart(*OutRequest); 2162 } 2163 return rtn; 2164 } 2165 2166 _Must_inspect_result_ 2167 _IRQL_requires_max_(DISPATCH_LEVEL) 2168 WDFAPI 2169 NTSTATUS 2170 VFWDFEXPORT(WdfIoQueueRetrieveRequestByFileObject)( 2171 _In_ 2172 PWDF_DRIVER_GLOBALS DriverGlobals, 2173 _In_ 2174 WDFQUEUE Queue, 2175 _In_ 2176 WDFFILEOBJECT FileObject, 2177 _Out_ 2178 WDFREQUEST* OutRequest 2179 ) 2180 { 2181 PAGED_CODE_LOCKED(); 2182 NTSTATUS rtn = ((PFN_WDFIOQUEUERETRIEVEREQUESTBYFILEOBJECT) WdfVersion.Functions.pfnWdfIoQueueRetrieveRequestByFileObject)(DriverGlobals, Queue, FileObject, OutRequest); 2183 if (rtn == STATUS_SUCCESS) { 2184 PerfIoStart(*OutRequest); 2185 } 2186 return rtn; 2187 } 2188 2189 _Must_inspect_result_ 2190 _IRQL_requires_max_(DISPATCH_LEVEL) 2191 WDFAPI 2192 NTSTATUS 2193 VFWDFEXPORT(WdfIoQueueFindRequest)( 2194 _In_ 2195 PWDF_DRIVER_GLOBALS DriverGlobals, 2196 _In_ 2197 WDFQUEUE Queue, 2198 _In_opt_ 2199 WDFREQUEST FoundRequest, 2200 _In_opt_ 2201 WDFFILEOBJECT FileObject, 2202 _Inout_opt_ 2203 PWDF_REQUEST_PARAMETERS Parameters, 2204 _Out_ 2205 WDFREQUEST* OutRequest 2206 ) 2207 { 2208 PAGED_CODE_LOCKED(); 2209 return ((PFN_WDFIOQUEUEFINDREQUEST) WdfVersion.Functions.pfnWdfIoQueueFindRequest)(DriverGlobals, Queue, FoundRequest, FileObject, Parameters, OutRequest); 2210 } 2211 2212 _Must_inspect_result_ 2213 _IRQL_requires_max_(DISPATCH_LEVEL) 2214 WDFAPI 2215 NTSTATUS 2216 VFWDFEXPORT(WdfIoQueueRetrieveFoundRequest)( 2217 _In_ 2218 PWDF_DRIVER_GLOBALS DriverGlobals, 2219 _In_ 2220 WDFQUEUE Queue, 2221 _In_ 2222 WDFREQUEST FoundRequest, 2223 _Out_ 2224 WDFREQUEST* OutRequest 2225 ) 2226 { 2227 PAGED_CODE_LOCKED(); 2228 NTSTATUS rtn = ((PFN_WDFIOQUEUERETRIEVEFOUNDREQUEST) WdfVersion.Functions.pfnWdfIoQueueRetrieveFoundRequest)(DriverGlobals, Queue, FoundRequest, OutRequest); 2229 if (rtn == STATUS_SUCCESS) { 2230 PerfIoStart(*OutRequest); 2231 } 2232 return rtn; 2233 } 2234 2235 _IRQL_requires_max_(PASSIVE_LEVEL) 2236 WDFAPI 2237 VOID 2238 VFWDFEXPORT(WdfIoQueueDrainSynchronously)( 2239 _In_ 2240 PWDF_DRIVER_GLOBALS DriverGlobals, 2241 _In_ 2242 WDFQUEUE Queue 2243 ) 2244 { 2245 PAGED_CODE_LOCKED(); 2246 ((PFN_WDFIOQUEUEDRAINSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoQueueDrainSynchronously)(DriverGlobals, Queue); 2247 } 2248 2249 _IRQL_requires_max_(DISPATCH_LEVEL) 2250 WDFAPI 2251 VOID 2252 VFWDFEXPORT(WdfIoQueueDrain)( 2253 _In_ 2254 PWDF_DRIVER_GLOBALS DriverGlobals, 2255 _In_ 2256 WDFQUEUE Queue, 2257 _When_(Context != 0, _In_) 2258 _When_(Context == 0, _In_opt_) 2259 PFN_WDF_IO_QUEUE_STATE DrainComplete, 2260 _When_(DrainComplete != 0, _In_) 2261 _When_(DrainComplete == 0, _In_opt_) 2262 WDFCONTEXT Context 2263 ) 2264 { 2265 PAGED_CODE_LOCKED(); 2266 ((PFN_WDFIOQUEUEDRAIN) WdfVersion.Functions.pfnWdfIoQueueDrain)(DriverGlobals, Queue, DrainComplete, Context); 2267 } 2268 2269 _IRQL_requires_max_(PASSIVE_LEVEL) 2270 WDFAPI 2271 VOID 2272 VFWDFEXPORT(WdfIoQueuePurgeSynchronously)( 2273 _In_ 2274 PWDF_DRIVER_GLOBALS DriverGlobals, 2275 _In_ 2276 WDFQUEUE Queue 2277 ) 2278 { 2279 PAGED_CODE_LOCKED(); 2280 ((PFN_WDFIOQUEUEPURGESYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoQueuePurgeSynchronously)(DriverGlobals, Queue); 2281 } 2282 2283 _IRQL_requires_max_(DISPATCH_LEVEL) 2284 WDFAPI 2285 VOID 2286 VFWDFEXPORT(WdfIoQueuePurge)( 2287 _In_ 2288 PWDF_DRIVER_GLOBALS DriverGlobals, 2289 _In_ 2290 WDFQUEUE Queue, 2291 _When_(Context != 0, _In_) 2292 _When_(Context == 0, _In_opt_) 2293 PFN_WDF_IO_QUEUE_STATE PurgeComplete, 2294 _When_(PurgeComplete != 0, _In_) 2295 _When_(PurgeComplete == 0, _In_opt_) 2296 WDFCONTEXT Context 2297 ) 2298 { 2299 PAGED_CODE_LOCKED(); 2300 ((PFN_WDFIOQUEUEPURGE) WdfVersion.Functions.pfnWdfIoQueuePurge)(DriverGlobals, Queue, PurgeComplete, Context); 2301 } 2302 2303 _Must_inspect_result_ 2304 _IRQL_requires_max_(DISPATCH_LEVEL) 2305 WDFAPI 2306 NTSTATUS 2307 VFWDFEXPORT(WdfIoQueueReadyNotify)( 2308 _In_ 2309 PWDF_DRIVER_GLOBALS DriverGlobals, 2310 _In_ 2311 WDFQUEUE Queue, 2312 _In_opt_ 2313 PFN_WDF_IO_QUEUE_STATE QueueReady, 2314 _In_opt_ 2315 WDFCONTEXT Context 2316 ) 2317 { 2318 PAGED_CODE_LOCKED(); 2319 return ((PFN_WDFIOQUEUEREADYNOTIFY) WdfVersion.Functions.pfnWdfIoQueueReadyNotify)(DriverGlobals, Queue, QueueReady, Context); 2320 } 2321 2322 _IRQL_requires_max_(DISPATCH_LEVEL) 2323 WDFAPI 2324 VOID 2325 VFWDFEXPORT(WdfIoQueueStopAndPurge)( 2326 _In_ 2327 PWDF_DRIVER_GLOBALS DriverGlobals, 2328 _In_ 2329 WDFQUEUE Queue, 2330 _When_(Context != 0, _In_) 2331 _When_(Context == 0, _In_opt_) 2332 PFN_WDF_IO_QUEUE_STATE StopAndPurgeComplete, 2333 _When_(StopAndPurgeComplete != 0, _In_) 2334 _When_(StopAndPurgeComplete == 0, _In_opt_) 2335 WDFCONTEXT Context 2336 ) 2337 { 2338 PAGED_CODE_LOCKED(); 2339 ((PFN_WDFIOQUEUESTOPANDPURGE) WdfVersion.Functions.pfnWdfIoQueueStopAndPurge)(DriverGlobals, Queue, StopAndPurgeComplete, Context); 2340 } 2341 2342 _IRQL_requires_max_(PASSIVE_LEVEL) 2343 WDFAPI 2344 VOID 2345 VFWDFEXPORT(WdfIoQueueStopAndPurgeSynchronously)( 2346 _In_ 2347 PWDF_DRIVER_GLOBALS DriverGlobals, 2348 _In_ 2349 WDFQUEUE Queue 2350 ) 2351 { 2352 PAGED_CODE_LOCKED(); 2353 ((PFN_WDFIOQUEUESTOPANDPURGESYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoQueueStopAndPurgeSynchronously)(DriverGlobals, Queue); 2354 } 2355 2356 _Must_inspect_result_ 2357 _IRQL_requires_max_(PASSIVE_LEVEL) 2358 WDFAPI 2359 NTSTATUS 2360 VFWDFEXPORT(WdfIoTargetCreate)( 2361 _In_ 2362 PWDF_DRIVER_GLOBALS DriverGlobals, 2363 _In_ 2364 WDFDEVICE Device, 2365 _In_opt_ 2366 PWDF_OBJECT_ATTRIBUTES IoTargetAttributes, 2367 _Out_ 2368 WDFIOTARGET* IoTarget 2369 ) 2370 { 2371 PAGED_CODE_LOCKED(); 2372 return ((PFN_WDFIOTARGETCREATE) WdfVersion.Functions.pfnWdfIoTargetCreate)(DriverGlobals, Device, IoTargetAttributes, IoTarget); 2373 } 2374 2375 _Must_inspect_result_ 2376 _IRQL_requires_max_(PASSIVE_LEVEL) 2377 WDFAPI 2378 NTSTATUS 2379 VFWDFEXPORT(WdfIoTargetOpen)( 2380 _In_ 2381 PWDF_DRIVER_GLOBALS DriverGlobals, 2382 _In_ 2383 WDFIOTARGET IoTarget, 2384 _In_ 2385 PWDF_IO_TARGET_OPEN_PARAMS OpenParams 2386 ) 2387 { 2388 PAGED_CODE_LOCKED(); 2389 return ((PFN_WDFIOTARGETOPEN) WdfVersion.Functions.pfnWdfIoTargetOpen)(DriverGlobals, IoTarget, OpenParams); 2390 } 2391 2392 _IRQL_requires_max_(PASSIVE_LEVEL) 2393 WDFAPI 2394 VOID 2395 VFWDFEXPORT(WdfIoTargetCloseForQueryRemove)( 2396 _In_ 2397 PWDF_DRIVER_GLOBALS DriverGlobals, 2398 _In_ 2399 WDFIOTARGET IoTarget 2400 ) 2401 { 2402 PAGED_CODE_LOCKED(); 2403 ((PFN_WDFIOTARGETCLOSEFORQUERYREMOVE) WdfVersion.Functions.pfnWdfIoTargetCloseForQueryRemove)(DriverGlobals, IoTarget); 2404 } 2405 2406 _IRQL_requires_max_(PASSIVE_LEVEL) 2407 WDFAPI 2408 VOID 2409 VFWDFEXPORT(WdfIoTargetClose)( 2410 _In_ 2411 PWDF_DRIVER_GLOBALS DriverGlobals, 2412 _In_ 2413 WDFIOTARGET IoTarget 2414 ) 2415 { 2416 PAGED_CODE_LOCKED(); 2417 ((PFN_WDFIOTARGETCLOSE) WdfVersion.Functions.pfnWdfIoTargetClose)(DriverGlobals, IoTarget); 2418 } 2419 2420 _Must_inspect_result_ 2421 _IRQL_requires_max_(DISPATCH_LEVEL) 2422 WDFAPI 2423 NTSTATUS 2424 VFWDFEXPORT(WdfIoTargetStart)( 2425 _In_ 2426 PWDF_DRIVER_GLOBALS DriverGlobals, 2427 _In_ 2428 WDFIOTARGET IoTarget 2429 ) 2430 { 2431 PAGED_CODE_LOCKED(); 2432 return ((PFN_WDFIOTARGETSTART) WdfVersion.Functions.pfnWdfIoTargetStart)(DriverGlobals, IoTarget); 2433 } 2434 2435 _When_(Action == 3, _IRQL_requires_max_(DISPATCH_LEVEL)) 2436 _When_(Action == 0 || Action == 1 || Action == 2, _IRQL_requires_max_(PASSIVE_LEVEL)) 2437 WDFAPI 2438 VOID 2439 VFWDFEXPORT(WdfIoTargetStop)( 2440 _In_ 2441 PWDF_DRIVER_GLOBALS DriverGlobals, 2442 _In_ 2443 WDFIOTARGET IoTarget, 2444 _In_ 2445 _Strict_type_match_ 2446 WDF_IO_TARGET_SENT_IO_ACTION Action 2447 ) 2448 { 2449 PAGED_CODE_LOCKED(); 2450 ((PFN_WDFIOTARGETSTOP) WdfVersion.Functions.pfnWdfIoTargetStop)(DriverGlobals, IoTarget, Action); 2451 } 2452 2453 _When_(Action == 2, _IRQL_requires_max_(DISPATCH_LEVEL)) 2454 _When_(Action == 0 || Action == 1, _IRQL_requires_max_(PASSIVE_LEVEL)) 2455 WDFAPI 2456 VOID 2457 VFWDFEXPORT(WdfIoTargetPurge)( 2458 _In_ 2459 PWDF_DRIVER_GLOBALS DriverGlobals, 2460 _In_ 2461 WDFIOTARGET IoTarget, 2462 _In_ 2463 _Strict_type_match_ 2464 WDF_IO_TARGET_PURGE_IO_ACTION Action 2465 ) 2466 { 2467 PAGED_CODE_LOCKED(); 2468 ((PFN_WDFIOTARGETPURGE) WdfVersion.Functions.pfnWdfIoTargetPurge)(DriverGlobals, IoTarget, Action); 2469 } 2470 2471 _IRQL_requires_max_(DISPATCH_LEVEL) 2472 WDFAPI 2473 WDF_IO_TARGET_STATE 2474 VFWDFEXPORT(WdfIoTargetGetState)( 2475 _In_ 2476 PWDF_DRIVER_GLOBALS DriverGlobals, 2477 _In_ 2478 WDFIOTARGET IoTarget 2479 ) 2480 { 2481 PAGED_CODE_LOCKED(); 2482 return ((PFN_WDFIOTARGETGETSTATE) WdfVersion.Functions.pfnWdfIoTargetGetState)(DriverGlobals, IoTarget); 2483 } 2484 2485 _IRQL_requires_max_(DISPATCH_LEVEL) 2486 WDFAPI 2487 WDFDEVICE 2488 VFWDFEXPORT(WdfIoTargetGetDevice)( 2489 _In_ 2490 PWDF_DRIVER_GLOBALS DriverGlobals, 2491 _In_ 2492 WDFIOTARGET IoTarget 2493 ) 2494 { 2495 PAGED_CODE_LOCKED(); 2496 return ((PFN_WDFIOTARGETGETDEVICE) WdfVersion.Functions.pfnWdfIoTargetGetDevice)(DriverGlobals, IoTarget); 2497 } 2498 2499 _IRQL_requires_max_(DISPATCH_LEVEL) 2500 WDFAPI 2501 HANDLE 2502 VFWDFEXPORT(WdfIoTargetWdmGetTargetFileHandle)( 2503 _In_ 2504 PWDF_DRIVER_GLOBALS DriverGlobals, 2505 _In_ 2506 WDFIOTARGET IoTarget 2507 ) 2508 { 2509 PAGED_CODE_LOCKED(); 2510 return ((PFN_WDFIOTARGETWDMGETTARGETFILEHANDLE) WdfVersion.Functions.pfnWdfIoTargetWdmGetTargetFileHandle)(DriverGlobals, IoTarget); 2511 } 2512 2513 _Must_inspect_result_ 2514 _IRQL_requires_max_(PASSIVE_LEVEL) 2515 WDFAPI 2516 NTSTATUS 2517 VFWDFEXPORT(WdfIoTargetSendReadSynchronously)( 2518 _In_ 2519 PWDF_DRIVER_GLOBALS DriverGlobals, 2520 _In_ 2521 WDFIOTARGET IoTarget, 2522 _In_opt_ 2523 WDFREQUEST Request, 2524 _In_opt_ 2525 PWDF_MEMORY_DESCRIPTOR OutputBuffer, 2526 _In_opt_ 2527 PLONGLONG DeviceOffset, 2528 _In_opt_ 2529 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 2530 _Out_opt_ 2531 PULONG_PTR BytesRead 2532 ) 2533 { 2534 PAGED_CODE_LOCKED(); 2535 return ((PFN_WDFIOTARGETSENDREADSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoTargetSendReadSynchronously)(DriverGlobals, IoTarget, Request, OutputBuffer, DeviceOffset, RequestOptions, BytesRead); 2536 } 2537 2538 _Must_inspect_result_ 2539 _IRQL_requires_max_(DISPATCH_LEVEL) 2540 WDFAPI 2541 NTSTATUS 2542 VFWDFEXPORT(WdfIoTargetFormatRequestForRead)( 2543 _In_ 2544 PWDF_DRIVER_GLOBALS DriverGlobals, 2545 _In_ 2546 WDFIOTARGET IoTarget, 2547 _In_ 2548 WDFREQUEST Request, 2549 _In_opt_ 2550 WDFMEMORY OutputBuffer, 2551 _In_opt_ 2552 PWDFMEMORY_OFFSET OutputBufferOffset, 2553 _In_opt_ 2554 PLONGLONG DeviceOffset 2555 ) 2556 { 2557 PAGED_CODE_LOCKED(); 2558 return ((PFN_WDFIOTARGETFORMATREQUESTFORREAD) WdfVersion.Functions.pfnWdfIoTargetFormatRequestForRead)(DriverGlobals, IoTarget, Request, OutputBuffer, OutputBufferOffset, DeviceOffset); 2559 } 2560 2561 _Must_inspect_result_ 2562 _IRQL_requires_max_(PASSIVE_LEVEL) 2563 WDFAPI 2564 NTSTATUS 2565 VFWDFEXPORT(WdfIoTargetSendWriteSynchronously)( 2566 _In_ 2567 PWDF_DRIVER_GLOBALS DriverGlobals, 2568 _In_ 2569 WDFIOTARGET IoTarget, 2570 _In_opt_ 2571 WDFREQUEST Request, 2572 _In_opt_ 2573 PWDF_MEMORY_DESCRIPTOR InputBuffer, 2574 _In_opt_ 2575 PLONGLONG DeviceOffset, 2576 _In_opt_ 2577 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 2578 _Out_opt_ 2579 PULONG_PTR BytesWritten 2580 ) 2581 { 2582 PAGED_CODE_LOCKED(); 2583 return ((PFN_WDFIOTARGETSENDWRITESYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoTargetSendWriteSynchronously)(DriverGlobals, IoTarget, Request, InputBuffer, DeviceOffset, RequestOptions, BytesWritten); 2584 } 2585 2586 _Must_inspect_result_ 2587 _IRQL_requires_max_(DISPATCH_LEVEL) 2588 WDFAPI 2589 NTSTATUS 2590 VFWDFEXPORT(WdfIoTargetFormatRequestForWrite)( 2591 _In_ 2592 PWDF_DRIVER_GLOBALS DriverGlobals, 2593 _In_ 2594 WDFIOTARGET IoTarget, 2595 _In_ 2596 WDFREQUEST Request, 2597 _In_opt_ 2598 WDFMEMORY InputBuffer, 2599 _In_opt_ 2600 PWDFMEMORY_OFFSET InputBufferOffset, 2601 _In_opt_ 2602 PLONGLONG DeviceOffset 2603 ) 2604 { 2605 PAGED_CODE_LOCKED(); 2606 return ((PFN_WDFIOTARGETFORMATREQUESTFORWRITE) WdfVersion.Functions.pfnWdfIoTargetFormatRequestForWrite)(DriverGlobals, IoTarget, Request, InputBuffer, InputBufferOffset, DeviceOffset); 2607 } 2608 2609 _Must_inspect_result_ 2610 _IRQL_requires_max_(PASSIVE_LEVEL) 2611 WDFAPI 2612 NTSTATUS 2613 VFWDFEXPORT(WdfIoTargetSendIoctlSynchronously)( 2614 _In_ 2615 PWDF_DRIVER_GLOBALS DriverGlobals, 2616 _In_ 2617 WDFIOTARGET IoTarget, 2618 _In_opt_ 2619 WDFREQUEST Request, 2620 _In_ 2621 ULONG IoctlCode, 2622 _In_opt_ 2623 PWDF_MEMORY_DESCRIPTOR InputBuffer, 2624 _In_opt_ 2625 PWDF_MEMORY_DESCRIPTOR OutputBuffer, 2626 _In_opt_ 2627 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 2628 _Out_opt_ 2629 PULONG_PTR BytesReturned 2630 ) 2631 { 2632 PAGED_CODE_LOCKED(); 2633 return ((PFN_WDFIOTARGETSENDIOCTLSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfIoTargetSendIoctlSynchronously)(DriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, OutputBuffer, RequestOptions, BytesReturned); 2634 } 2635 2636 _Must_inspect_result_ 2637 _IRQL_requires_max_(DISPATCH_LEVEL) 2638 WDFAPI 2639 NTSTATUS 2640 VFWDFEXPORT(WdfIoTargetFormatRequestForIoctl)( 2641 _In_ 2642 PWDF_DRIVER_GLOBALS DriverGlobals, 2643 _In_ 2644 WDFIOTARGET IoTarget, 2645 _In_ 2646 WDFREQUEST Request, 2647 _In_ 2648 ULONG IoctlCode, 2649 _In_opt_ 2650 WDFMEMORY InputBuffer, 2651 _In_opt_ 2652 PWDFMEMORY_OFFSET InputBufferOffset, 2653 _In_opt_ 2654 WDFMEMORY OutputBuffer, 2655 _In_opt_ 2656 PWDFMEMORY_OFFSET OutputBufferOffset 2657 ) 2658 { 2659 PAGED_CODE_LOCKED(); 2660 return ((PFN_WDFIOTARGETFORMATREQUESTFORIOCTL) WdfVersion.Functions.pfnWdfIoTargetFormatRequestForIoctl)(DriverGlobals, IoTarget, Request, IoctlCode, InputBuffer, InputBufferOffset, OutputBuffer, OutputBufferOffset); 2661 } 2662 2663 _IRQL_requires_max_(DISPATCH_LEVEL) 2664 WDFAPI 2665 NTSTATUS 2666 VFWDFEXPORT(WdfIoTargetSelfAssignDefaultIoQueue)( 2667 _In_ 2668 PWDF_DRIVER_GLOBALS DriverGlobals, 2669 _In_ 2670 WDFIOTARGET IoTarget, 2671 _In_ 2672 WDFQUEUE Queue 2673 ) 2674 { 2675 PAGED_CODE_LOCKED(); 2676 return ((PFN_WDFIOTARGETSELFASSIGNDEFAULTIOQUEUE) WdfVersion.Functions.pfnWdfIoTargetSelfAssignDefaultIoQueue)(DriverGlobals, IoTarget, Queue); 2677 } 2678 2679 _Must_inspect_result_ 2680 _When_(PoolType == 1 || PoolType == 257, _IRQL_requires_max_(APC_LEVEL)) 2681 _When_(PoolType == 0 || PoolType == 256, _IRQL_requires_max_(DISPATCH_LEVEL)) 2682 WDFAPI 2683 NTSTATUS 2684 VFWDFEXPORT(WdfMemoryCreate)( 2685 _In_ 2686 PWDF_DRIVER_GLOBALS DriverGlobals, 2687 _In_opt_ 2688 PWDF_OBJECT_ATTRIBUTES Attributes, 2689 _In_ 2690 _Strict_type_match_ 2691 POOL_TYPE PoolType, 2692 _In_opt_ 2693 ULONG PoolTag, 2694 _In_ 2695 _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) 2696 size_t BufferSize, 2697 _Out_ 2698 WDFMEMORY* Memory, 2699 _Outptr_opt_result_bytebuffer_(BufferSize) 2700 PVOID* Buffer 2701 ) 2702 { 2703 PAGED_CODE_LOCKED(); 2704 return ((PFN_WDFMEMORYCREATE) WdfVersion.Functions.pfnWdfMemoryCreate)(DriverGlobals, Attributes, PoolType, PoolTag, BufferSize, Memory, Buffer); 2705 } 2706 2707 _Must_inspect_result_ 2708 _IRQL_requires_max_(DISPATCH_LEVEL) 2709 WDFAPI 2710 NTSTATUS 2711 VFWDFEXPORT(WdfMemoryCreatePreallocated)( 2712 _In_ 2713 PWDF_DRIVER_GLOBALS DriverGlobals, 2714 _In_opt_ 2715 PWDF_OBJECT_ATTRIBUTES Attributes, 2716 _In_ __drv_aliasesMem 2717 PVOID Buffer, 2718 _In_ 2719 _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) 2720 size_t BufferSize, 2721 _Out_ 2722 WDFMEMORY* Memory 2723 ) 2724 { 2725 PAGED_CODE_LOCKED(); 2726 return ((PFN_WDFMEMORYCREATEPREALLOCATED) WdfVersion.Functions.pfnWdfMemoryCreatePreallocated)(DriverGlobals, Attributes, Buffer, BufferSize, Memory); 2727 } 2728 2729 _IRQL_requires_max_(DISPATCH_LEVEL) 2730 WDFAPI 2731 PVOID 2732 VFWDFEXPORT(WdfMemoryGetBuffer)( 2733 _In_ 2734 PWDF_DRIVER_GLOBALS DriverGlobals, 2735 _In_ 2736 WDFMEMORY Memory, 2737 _Out_opt_ 2738 size_t* BufferSize 2739 ) 2740 { 2741 PAGED_CODE_LOCKED(); 2742 return ((PFN_WDFMEMORYGETBUFFER) WdfVersion.Functions.pfnWdfMemoryGetBuffer)(DriverGlobals, Memory, BufferSize); 2743 } 2744 2745 _Must_inspect_result_ 2746 _IRQL_requires_max_(DISPATCH_LEVEL) 2747 WDFAPI 2748 NTSTATUS 2749 VFWDFEXPORT(WdfMemoryAssignBuffer)( 2750 _In_ 2751 PWDF_DRIVER_GLOBALS DriverGlobals, 2752 _In_ 2753 WDFMEMORY Memory, 2754 _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) 2755 PVOID Buffer, 2756 _In_ 2757 _When_(BufferSize == 0, __drv_reportError(BufferSize cannot be zero)) 2758 size_t BufferSize 2759 ) 2760 { 2761 PAGED_CODE_LOCKED(); 2762 return ((PFN_WDFMEMORYASSIGNBUFFER) WdfVersion.Functions.pfnWdfMemoryAssignBuffer)(DriverGlobals, Memory, Buffer, BufferSize); 2763 } 2764 2765 _Must_inspect_result_ 2766 _IRQL_requires_max_(DISPATCH_LEVEL) 2767 WDFAPI 2768 NTSTATUS 2769 VFWDFEXPORT(WdfMemoryCopyToBuffer)( 2770 _In_ 2771 PWDF_DRIVER_GLOBALS DriverGlobals, 2772 _In_ 2773 WDFMEMORY SourceMemory, 2774 _In_ 2775 size_t SourceOffset, 2776 _Out_writes_bytes_( NumBytesToCopyTo ) 2777 PVOID Buffer, 2778 _In_ 2779 _When_(NumBytesToCopyTo == 0, __drv_reportError(NumBytesToCopyTo cannot be zero)) 2780 size_t NumBytesToCopyTo 2781 ) 2782 { 2783 PAGED_CODE_LOCKED(); 2784 return ((PFN_WDFMEMORYCOPYTOBUFFER) WdfVersion.Functions.pfnWdfMemoryCopyToBuffer)(DriverGlobals, SourceMemory, SourceOffset, Buffer, NumBytesToCopyTo); 2785 } 2786 2787 _Must_inspect_result_ 2788 _IRQL_requires_max_(DISPATCH_LEVEL) 2789 WDFAPI 2790 NTSTATUS 2791 VFWDFEXPORT(WdfMemoryCopyFromBuffer)( 2792 _In_ 2793 PWDF_DRIVER_GLOBALS DriverGlobals, 2794 _In_ 2795 WDFMEMORY DestinationMemory, 2796 _In_ 2797 size_t DestinationOffset, 2798 _In_ 2799 PVOID Buffer, 2800 _In_ 2801 _When_(NumBytesToCopyFrom == 0, __drv_reportError(NumBytesToCopyFrom cannot be zero)) 2802 size_t NumBytesToCopyFrom 2803 ) 2804 { 2805 PAGED_CODE_LOCKED(); 2806 return ((PFN_WDFMEMORYCOPYFROMBUFFER) WdfVersion.Functions.pfnWdfMemoryCopyFromBuffer)(DriverGlobals, DestinationMemory, DestinationOffset, Buffer, NumBytesToCopyFrom); 2807 } 2808 2809 WDFAPI 2810 PVOID 2811 FASTCALL 2812 VFWDFEXPORT(WdfObjectGetTypedContextWorker)( 2813 _In_ 2814 PWDF_DRIVER_GLOBALS DriverGlobals, 2815 _In_ 2816 WDFOBJECT Handle, 2817 _In_ 2818 PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo 2819 ) 2820 { 2821 PAGED_CODE_LOCKED(); 2822 return ((PFN_WDFOBJECTGETTYPEDCONTEXTWORKER) WdfVersion.Functions.pfnWdfObjectGetTypedContextWorker)(DriverGlobals, Handle, TypeInfo); 2823 } 2824 2825 WDFAPI 2826 NTSTATUS 2827 VFWDFEXPORT(WdfObjectAllocateContext)( 2828 _In_ 2829 PWDF_DRIVER_GLOBALS DriverGlobals, 2830 _In_ 2831 WDFOBJECT Handle, 2832 _In_ 2833 PWDF_OBJECT_ATTRIBUTES ContextAttributes, 2834 _Outptr_opt_ 2835 PVOID* Context 2836 ) 2837 { 2838 PAGED_CODE_LOCKED(); 2839 return ((PFN_WDFOBJECTALLOCATECONTEXT) WdfVersion.Functions.pfnWdfObjectAllocateContext)(DriverGlobals, Handle, ContextAttributes, Context); 2840 } 2841 2842 WDFAPI 2843 WDFOBJECT 2844 FASTCALL 2845 VFWDFEXPORT(WdfObjectContextGetObject)( 2846 _In_ 2847 PWDF_DRIVER_GLOBALS DriverGlobals, 2848 _In_ 2849 PVOID ContextPointer 2850 ) 2851 { 2852 PAGED_CODE_LOCKED(); 2853 return ((PFN_WDFOBJECTCONTEXTGETOBJECT) WdfVersion.Functions.pfnWdfObjectContextGetObject)(DriverGlobals, ContextPointer); 2854 } 2855 2856 WDFAPI 2857 VOID 2858 VFWDFEXPORT(WdfObjectReferenceActual)( 2859 _In_ 2860 PWDF_DRIVER_GLOBALS DriverGlobals, 2861 _In_ 2862 WDFOBJECT Handle, 2863 _In_opt_ 2864 PVOID Tag, 2865 _In_ 2866 LONG Line, 2867 _In_z_ 2868 PCHAR File 2869 ) 2870 { 2871 PAGED_CODE_LOCKED(); 2872 ((PFN_WDFOBJECTREFERENCEACTUAL) WdfVersion.Functions.pfnWdfObjectReferenceActual)(DriverGlobals, Handle, Tag, Line, File); 2873 } 2874 2875 WDFAPI 2876 VOID 2877 VFWDFEXPORT(WdfObjectDereferenceActual)( 2878 _In_ 2879 PWDF_DRIVER_GLOBALS DriverGlobals, 2880 _In_ 2881 WDFOBJECT Handle, 2882 _In_opt_ 2883 PVOID Tag, 2884 _In_ 2885 LONG Line, 2886 _In_z_ 2887 PCHAR File 2888 ) 2889 { 2890 PAGED_CODE_LOCKED(); 2891 ((PFN_WDFOBJECTDEREFERENCEACTUAL) WdfVersion.Functions.pfnWdfObjectDereferenceActual)(DriverGlobals, Handle, Tag, Line, File); 2892 } 2893 2894 _Must_inspect_result_ 2895 _IRQL_requires_max_(DISPATCH_LEVEL) 2896 WDFAPI 2897 NTSTATUS 2898 VFWDFEXPORT(WdfObjectCreate)( 2899 _In_ 2900 PWDF_DRIVER_GLOBALS DriverGlobals, 2901 _In_opt_ 2902 PWDF_OBJECT_ATTRIBUTES Attributes, 2903 _Out_ 2904 WDFOBJECT* Object 2905 ) 2906 { 2907 PAGED_CODE_LOCKED(); 2908 return ((PFN_WDFOBJECTCREATE) WdfVersion.Functions.pfnWdfObjectCreate)(DriverGlobals, Attributes, Object); 2909 } 2910 2911 _IRQL_requires_max_(DISPATCH_LEVEL) 2912 WDFAPI 2913 VOID 2914 VFWDFEXPORT(WdfObjectDelete)( 2915 _In_ 2916 PWDF_DRIVER_GLOBALS DriverGlobals, 2917 _In_ 2918 WDFOBJECT Object 2919 ) 2920 { 2921 PAGED_CODE_LOCKED(); 2922 ((PFN_WDFOBJECTDELETE) WdfVersion.Functions.pfnWdfObjectDelete)(DriverGlobals, Object); 2923 } 2924 2925 _Must_inspect_result_ 2926 _IRQL_requires_max_(DISPATCH_LEVEL) 2927 WDFAPI 2928 NTSTATUS 2929 VFWDFEXPORT(WdfObjectQuery)( 2930 _In_ 2931 PWDF_DRIVER_GLOBALS DriverGlobals, 2932 _In_ 2933 WDFOBJECT Object, 2934 _In_ 2935 CONST GUID* Guid, 2936 _In_ 2937 ULONG QueryBufferLength, 2938 _Out_writes_bytes_(QueryBufferLength) 2939 PVOID QueryBuffer 2940 ) 2941 { 2942 PAGED_CODE_LOCKED(); 2943 return ((PFN_WDFOBJECTQUERY) WdfVersion.Functions.pfnWdfObjectQuery)(DriverGlobals, Object, Guid, QueryBufferLength, QueryBuffer); 2944 } 2945 2946 _Must_inspect_result_ 2947 _IRQL_requires_max_(PASSIVE_LEVEL) 2948 WDFAPI 2949 NTSTATUS 2950 VFWDFEXPORT(WdfRegistryOpenKey)( 2951 _In_ 2952 PWDF_DRIVER_GLOBALS DriverGlobals, 2953 _In_opt_ 2954 WDFKEY ParentKey, 2955 _In_ 2956 PCUNICODE_STRING KeyName, 2957 _In_ 2958 ACCESS_MASK DesiredAccess, 2959 _In_opt_ 2960 PWDF_OBJECT_ATTRIBUTES KeyAttributes, 2961 _Out_ 2962 WDFKEY* Key 2963 ) 2964 { 2965 PAGED_CODE_LOCKED(); 2966 return ((PFN_WDFREGISTRYOPENKEY) WdfVersion.Functions.pfnWdfRegistryOpenKey)(DriverGlobals, ParentKey, KeyName, DesiredAccess, KeyAttributes, Key); 2967 } 2968 2969 _Must_inspect_result_ 2970 _IRQL_requires_max_(PASSIVE_LEVEL) 2971 WDFAPI 2972 NTSTATUS 2973 VFWDFEXPORT(WdfRegistryCreateKey)( 2974 _In_ 2975 PWDF_DRIVER_GLOBALS DriverGlobals, 2976 _In_opt_ 2977 WDFKEY ParentKey, 2978 _In_ 2979 PCUNICODE_STRING KeyName, 2980 _In_ 2981 ACCESS_MASK DesiredAccess, 2982 _In_ 2983 ULONG CreateOptions, 2984 _Out_opt_ 2985 PULONG CreateDisposition, 2986 _In_opt_ 2987 PWDF_OBJECT_ATTRIBUTES KeyAttributes, 2988 _Out_ 2989 WDFKEY* Key 2990 ) 2991 { 2992 PAGED_CODE_LOCKED(); 2993 return ((PFN_WDFREGISTRYCREATEKEY) WdfVersion.Functions.pfnWdfRegistryCreateKey)(DriverGlobals, ParentKey, KeyName, DesiredAccess, CreateOptions, CreateDisposition, KeyAttributes, Key); 2994 } 2995 2996 _IRQL_requires_max_(PASSIVE_LEVEL) 2997 WDFAPI 2998 VOID 2999 VFWDFEXPORT(WdfRegistryClose)( 3000 _In_ 3001 PWDF_DRIVER_GLOBALS DriverGlobals, 3002 _In_ 3003 WDFKEY Key 3004 ) 3005 { 3006 PAGED_CODE_LOCKED(); 3007 ((PFN_WDFREGISTRYCLOSE) WdfVersion.Functions.pfnWdfRegistryClose)(DriverGlobals, Key); 3008 } 3009 3010 _IRQL_requires_max_(PASSIVE_LEVEL) 3011 WDFAPI 3012 HANDLE 3013 VFWDFEXPORT(WdfRegistryWdmGetHandle)( 3014 _In_ 3015 PWDF_DRIVER_GLOBALS DriverGlobals, 3016 _In_ 3017 WDFKEY Key 3018 ) 3019 { 3020 PAGED_CODE_LOCKED(); 3021 return ((PFN_WDFREGISTRYWDMGETHANDLE) WdfVersion.Functions.pfnWdfRegistryWdmGetHandle)(DriverGlobals, Key); 3022 } 3023 3024 _Must_inspect_result_ 3025 _IRQL_requires_max_(PASSIVE_LEVEL) 3026 WDFAPI 3027 NTSTATUS 3028 VFWDFEXPORT(WdfRegistryRemoveKey)( 3029 _In_ 3030 PWDF_DRIVER_GLOBALS DriverGlobals, 3031 _In_ 3032 WDFKEY Key 3033 ) 3034 { 3035 PAGED_CODE_LOCKED(); 3036 return ((PFN_WDFREGISTRYREMOVEKEY) WdfVersion.Functions.pfnWdfRegistryRemoveKey)(DriverGlobals, Key); 3037 } 3038 3039 _Must_inspect_result_ 3040 _IRQL_requires_max_(PASSIVE_LEVEL) 3041 WDFAPI 3042 NTSTATUS 3043 VFWDFEXPORT(WdfRegistryRemoveValue)( 3044 _In_ 3045 PWDF_DRIVER_GLOBALS DriverGlobals, 3046 _In_ 3047 WDFKEY Key, 3048 _In_ 3049 PCUNICODE_STRING ValueName 3050 ) 3051 { 3052 PAGED_CODE_LOCKED(); 3053 return ((PFN_WDFREGISTRYREMOVEVALUE) WdfVersion.Functions.pfnWdfRegistryRemoveValue)(DriverGlobals, Key, ValueName); 3054 } 3055 3056 _Must_inspect_result_ 3057 _IRQL_requires_max_(PASSIVE_LEVEL) 3058 WDFAPI 3059 NTSTATUS 3060 VFWDFEXPORT(WdfRegistryQueryValue)( 3061 _In_ 3062 PWDF_DRIVER_GLOBALS DriverGlobals, 3063 _In_ 3064 WDFKEY Key, 3065 _In_ 3066 PCUNICODE_STRING ValueName, 3067 _In_ 3068 ULONG ValueLength, 3069 _Out_writes_bytes_opt_( ValueLength) 3070 PVOID Value, 3071 _Out_opt_ 3072 PULONG ValueLengthQueried, 3073 _Out_opt_ 3074 PULONG ValueType 3075 ) 3076 { 3077 PAGED_CODE_LOCKED(); 3078 return ((PFN_WDFREGISTRYQUERYVALUE) WdfVersion.Functions.pfnWdfRegistryQueryValue)(DriverGlobals, Key, ValueName, ValueLength, Value, ValueLengthQueried, ValueType); 3079 } 3080 3081 _Must_inspect_result_ 3082 _IRQL_requires_max_(PASSIVE_LEVEL) 3083 WDFAPI 3084 NTSTATUS 3085 VFWDFEXPORT(WdfRegistryQueryMemory)( 3086 _In_ 3087 PWDF_DRIVER_GLOBALS DriverGlobals, 3088 _In_ 3089 WDFKEY Key, 3090 _In_ 3091 PCUNICODE_STRING ValueName, 3092 _In_ 3093 _Strict_type_match_ 3094 POOL_TYPE PoolType, 3095 _In_opt_ 3096 PWDF_OBJECT_ATTRIBUTES MemoryAttributes, 3097 _Out_ 3098 WDFMEMORY* Memory, 3099 _Out_opt_ 3100 PULONG ValueType 3101 ) 3102 { 3103 PAGED_CODE_LOCKED(); 3104 return ((PFN_WDFREGISTRYQUERYMEMORY) WdfVersion.Functions.pfnWdfRegistryQueryMemory)(DriverGlobals, Key, ValueName, PoolType, MemoryAttributes, Memory, ValueType); 3105 } 3106 3107 _Must_inspect_result_ 3108 _IRQL_requires_max_(PASSIVE_LEVEL) 3109 WDFAPI 3110 NTSTATUS 3111 VFWDFEXPORT(WdfRegistryQueryMultiString)( 3112 _In_ 3113 PWDF_DRIVER_GLOBALS DriverGlobals, 3114 _In_ 3115 WDFKEY Key, 3116 _In_ 3117 PCUNICODE_STRING ValueName, 3118 _In_opt_ 3119 PWDF_OBJECT_ATTRIBUTES StringsAttributes, 3120 _In_ 3121 WDFCOLLECTION Collection 3122 ) 3123 { 3124 PAGED_CODE_LOCKED(); 3125 return ((PFN_WDFREGISTRYQUERYMULTISTRING) WdfVersion.Functions.pfnWdfRegistryQueryMultiString)(DriverGlobals, Key, ValueName, StringsAttributes, Collection); 3126 } 3127 3128 _Must_inspect_result_ 3129 _IRQL_requires_max_(PASSIVE_LEVEL) 3130 WDFAPI 3131 NTSTATUS 3132 VFWDFEXPORT(WdfRegistryQueryUnicodeString)( 3133 _In_ 3134 PWDF_DRIVER_GLOBALS DriverGlobals, 3135 _In_ 3136 WDFKEY Key, 3137 _In_ 3138 PCUNICODE_STRING ValueName, 3139 _Out_opt_ 3140 PUSHORT ValueByteLength, 3141 _Inout_opt_ 3142 PUNICODE_STRING Value 3143 ) 3144 { 3145 PAGED_CODE_LOCKED(); 3146 return ((PFN_WDFREGISTRYQUERYUNICODESTRING) WdfVersion.Functions.pfnWdfRegistryQueryUnicodeString)(DriverGlobals, Key, ValueName, ValueByteLength, Value); 3147 } 3148 3149 _Must_inspect_result_ 3150 _IRQL_requires_max_(PASSIVE_LEVEL) 3151 WDFAPI 3152 NTSTATUS 3153 VFWDFEXPORT(WdfRegistryQueryString)( 3154 _In_ 3155 PWDF_DRIVER_GLOBALS DriverGlobals, 3156 _In_ 3157 WDFKEY Key, 3158 _In_ 3159 PCUNICODE_STRING ValueName, 3160 _In_ 3161 WDFSTRING String 3162 ) 3163 { 3164 PAGED_CODE_LOCKED(); 3165 return ((PFN_WDFREGISTRYQUERYSTRING) WdfVersion.Functions.pfnWdfRegistryQueryString)(DriverGlobals, Key, ValueName, String); 3166 } 3167 3168 _Must_inspect_result_ 3169 _IRQL_requires_max_(PASSIVE_LEVEL) 3170 WDFAPI 3171 NTSTATUS 3172 VFWDFEXPORT(WdfRegistryQueryULong)( 3173 _In_ 3174 PWDF_DRIVER_GLOBALS DriverGlobals, 3175 _In_ 3176 WDFKEY Key, 3177 _In_ 3178 PCUNICODE_STRING ValueName, 3179 _Out_ 3180 PULONG Value 3181 ) 3182 { 3183 PAGED_CODE_LOCKED(); 3184 return ((PFN_WDFREGISTRYQUERYULONG) WdfVersion.Functions.pfnWdfRegistryQueryULong)(DriverGlobals, Key, ValueName, Value); 3185 } 3186 3187 _Must_inspect_result_ 3188 _IRQL_requires_max_(PASSIVE_LEVEL) 3189 WDFAPI 3190 NTSTATUS 3191 VFWDFEXPORT(WdfRegistryAssignValue)( 3192 _In_ 3193 PWDF_DRIVER_GLOBALS DriverGlobals, 3194 _In_ 3195 WDFKEY Key, 3196 _In_ 3197 PCUNICODE_STRING ValueName, 3198 _In_ 3199 ULONG ValueType, 3200 _In_ 3201 ULONG ValueLength, 3202 _In_reads_( ValueLength) 3203 PVOID Value 3204 ) 3205 { 3206 PAGED_CODE_LOCKED(); 3207 return ((PFN_WDFREGISTRYASSIGNVALUE) WdfVersion.Functions.pfnWdfRegistryAssignValue)(DriverGlobals, Key, ValueName, ValueType, ValueLength, Value); 3208 } 3209 3210 _Must_inspect_result_ 3211 _IRQL_requires_max_(PASSIVE_LEVEL) 3212 WDFAPI 3213 NTSTATUS 3214 VFWDFEXPORT(WdfRegistryAssignMemory)( 3215 _In_ 3216 PWDF_DRIVER_GLOBALS DriverGlobals, 3217 _In_ 3218 WDFKEY Key, 3219 _In_ 3220 PCUNICODE_STRING ValueName, 3221 _In_ 3222 ULONG ValueType, 3223 _In_ 3224 WDFMEMORY Memory, 3225 _In_opt_ 3226 PWDFMEMORY_OFFSET MemoryOffsets 3227 ) 3228 { 3229 PAGED_CODE_LOCKED(); 3230 return ((PFN_WDFREGISTRYASSIGNMEMORY) WdfVersion.Functions.pfnWdfRegistryAssignMemory)(DriverGlobals, Key, ValueName, ValueType, Memory, MemoryOffsets); 3231 } 3232 3233 _Must_inspect_result_ 3234 _IRQL_requires_max_(PASSIVE_LEVEL) 3235 WDFAPI 3236 NTSTATUS 3237 VFWDFEXPORT(WdfRegistryAssignMultiString)( 3238 _In_ 3239 PWDF_DRIVER_GLOBALS DriverGlobals, 3240 _In_ 3241 WDFKEY Key, 3242 _In_ 3243 PCUNICODE_STRING ValueName, 3244 _In_ 3245 WDFCOLLECTION StringsCollection 3246 ) 3247 { 3248 PAGED_CODE_LOCKED(); 3249 return ((PFN_WDFREGISTRYASSIGNMULTISTRING) WdfVersion.Functions.pfnWdfRegistryAssignMultiString)(DriverGlobals, Key, ValueName, StringsCollection); 3250 } 3251 3252 _Must_inspect_result_ 3253 _IRQL_requires_max_(PASSIVE_LEVEL) 3254 WDFAPI 3255 NTSTATUS 3256 VFWDFEXPORT(WdfRegistryAssignUnicodeString)( 3257 _In_ 3258 PWDF_DRIVER_GLOBALS DriverGlobals, 3259 _In_ 3260 WDFKEY Key, 3261 _In_ 3262 PCUNICODE_STRING ValueName, 3263 _In_ 3264 PCUNICODE_STRING Value 3265 ) 3266 { 3267 PAGED_CODE_LOCKED(); 3268 return ((PFN_WDFREGISTRYASSIGNUNICODESTRING) WdfVersion.Functions.pfnWdfRegistryAssignUnicodeString)(DriverGlobals, Key, ValueName, Value); 3269 } 3270 3271 _Must_inspect_result_ 3272 _IRQL_requires_max_(PASSIVE_LEVEL) 3273 WDFAPI 3274 NTSTATUS 3275 VFWDFEXPORT(WdfRegistryAssignString)( 3276 _In_ 3277 PWDF_DRIVER_GLOBALS DriverGlobals, 3278 _In_ 3279 WDFKEY Key, 3280 _In_ 3281 PCUNICODE_STRING ValueName, 3282 _In_ 3283 WDFSTRING String 3284 ) 3285 { 3286 PAGED_CODE_LOCKED(); 3287 return ((PFN_WDFREGISTRYASSIGNSTRING) WdfVersion.Functions.pfnWdfRegistryAssignString)(DriverGlobals, Key, ValueName, String); 3288 } 3289 3290 _Must_inspect_result_ 3291 _IRQL_requires_max_(PASSIVE_LEVEL) 3292 WDFAPI 3293 NTSTATUS 3294 VFWDFEXPORT(WdfRegistryAssignULong)( 3295 _In_ 3296 PWDF_DRIVER_GLOBALS DriverGlobals, 3297 _In_ 3298 WDFKEY Key, 3299 _In_ 3300 PCUNICODE_STRING ValueName, 3301 _In_ 3302 ULONG Value 3303 ) 3304 { 3305 PAGED_CODE_LOCKED(); 3306 return ((PFN_WDFREGISTRYASSIGNULONG) WdfVersion.Functions.pfnWdfRegistryAssignULong)(DriverGlobals, Key, ValueName, Value); 3307 } 3308 3309 _Must_inspect_result_ 3310 _IRQL_requires_max_(DISPATCH_LEVEL) 3311 WDFAPI 3312 NTSTATUS 3313 VFWDFEXPORT(WdfRequestCreate)( 3314 _In_ 3315 PWDF_DRIVER_GLOBALS DriverGlobals, 3316 _In_opt_ 3317 PWDF_OBJECT_ATTRIBUTES RequestAttributes, 3318 _In_opt_ 3319 WDFIOTARGET IoTarget, 3320 _Out_ 3321 WDFREQUEST* Request 3322 ) 3323 { 3324 PAGED_CODE_LOCKED(); 3325 return ((PFN_WDFREQUESTCREATE) WdfVersion.Functions.pfnWdfRequestCreate)(DriverGlobals, RequestAttributes, IoTarget, Request); 3326 } 3327 3328 _IRQL_requires_max_(DISPATCH_LEVEL) 3329 WDFAPI 3330 NTSTATUS 3331 VFWDFEXPORT(WdfRequestReuse)( 3332 _In_ 3333 PWDF_DRIVER_GLOBALS DriverGlobals, 3334 _In_ 3335 WDFREQUEST Request, 3336 _In_ 3337 PWDF_REQUEST_REUSE_PARAMS ReuseParams 3338 ) 3339 { 3340 PAGED_CODE_LOCKED(); 3341 return ((PFN_WDFREQUESTREUSE) WdfVersion.Functions.pfnWdfRequestReuse)(DriverGlobals, Request, ReuseParams); 3342 } 3343 3344 _Must_inspect_result_ 3345 _IRQL_requires_max_(DISPATCH_LEVEL) 3346 WDFAPI 3347 NTSTATUS 3348 VFWDFEXPORT(WdfRequestChangeTarget)( 3349 _In_ 3350 PWDF_DRIVER_GLOBALS DriverGlobals, 3351 _In_ 3352 WDFREQUEST Request, 3353 _In_ 3354 WDFIOTARGET IoTarget 3355 ) 3356 { 3357 PAGED_CODE_LOCKED(); 3358 return ((PFN_WDFREQUESTCHANGETARGET) WdfVersion.Functions.pfnWdfRequestChangeTarget)(DriverGlobals, Request, IoTarget); 3359 } 3360 3361 _IRQL_requires_max_(DISPATCH_LEVEL) 3362 WDFAPI 3363 VOID 3364 VFWDFEXPORT(WdfRequestFormatRequestUsingCurrentType)( 3365 _In_ 3366 PWDF_DRIVER_GLOBALS DriverGlobals, 3367 _In_ 3368 WDFREQUEST Request 3369 ) 3370 { 3371 PAGED_CODE_LOCKED(); 3372 ((PFN_WDFREQUESTFORMATREQUESTUSINGCURRENTTYPE) WdfVersion.Functions.pfnWdfRequestFormatRequestUsingCurrentType)(DriverGlobals, Request); 3373 } 3374 3375 _IRQL_requires_max_(DISPATCH_LEVEL) 3376 _When_(Options->Flags & WDF_REQUEST_SEND_OPTION_SYNCHRONOUS == 0, _Must_inspect_result_) 3377 WDFAPI 3378 BOOLEAN 3379 VFWDFEXPORT(WdfRequestSend)( 3380 _In_ 3381 PWDF_DRIVER_GLOBALS DriverGlobals, 3382 _In_ 3383 WDFREQUEST Request, 3384 _In_ 3385 WDFIOTARGET Target, 3386 _In_opt_ 3387 PWDF_REQUEST_SEND_OPTIONS Options 3388 ) 3389 { 3390 PAGED_CODE_LOCKED(); 3391 return ((PFN_WDFREQUESTSEND) WdfVersion.Functions.pfnWdfRequestSend)(DriverGlobals, Request, Target, Options); 3392 } 3393 3394 _Must_inspect_result_ 3395 _IRQL_requires_max_(DISPATCH_LEVEL) 3396 WDFAPI 3397 NTSTATUS 3398 VFWDFEXPORT(WdfRequestGetStatus)( 3399 _In_ 3400 PWDF_DRIVER_GLOBALS DriverGlobals, 3401 _In_ 3402 WDFREQUEST Request 3403 ) 3404 { 3405 PAGED_CODE_LOCKED(); 3406 return ((PFN_WDFREQUESTGETSTATUS) WdfVersion.Functions.pfnWdfRequestGetStatus)(DriverGlobals, Request); 3407 } 3408 3409 _IRQL_requires_max_(DISPATCH_LEVEL) 3410 WDFAPI 3411 VOID 3412 VFWDFEXPORT(WdfRequestMarkCancelable)( 3413 _In_ 3414 PWDF_DRIVER_GLOBALS DriverGlobals, 3415 _In_ 3416 WDFREQUEST Request, 3417 _In_ 3418 PFN_WDF_REQUEST_CANCEL EvtRequestCancel 3419 ) 3420 { 3421 PAGED_CODE_LOCKED(); 3422 ((PFN_WDFREQUESTMARKCANCELABLE) WdfVersion.Functions.pfnWdfRequestMarkCancelable)(DriverGlobals, Request, EvtRequestCancel); 3423 } 3424 3425 _Must_inspect_result_ 3426 _IRQL_requires_max_(DISPATCH_LEVEL) 3427 WDFAPI 3428 NTSTATUS 3429 VFWDFEXPORT(WdfRequestMarkCancelableEx)( 3430 _In_ 3431 PWDF_DRIVER_GLOBALS DriverGlobals, 3432 _In_ 3433 WDFREQUEST Request, 3434 _In_ 3435 PFN_WDF_REQUEST_CANCEL EvtRequestCancel 3436 ) 3437 { 3438 PAGED_CODE_LOCKED(); 3439 return ((PFN_WDFREQUESTMARKCANCELABLEEX) WdfVersion.Functions.pfnWdfRequestMarkCancelableEx)(DriverGlobals, Request, EvtRequestCancel); 3440 } 3441 3442 _Must_inspect_result_ 3443 _IRQL_requires_max_(DISPATCH_LEVEL) 3444 WDFAPI 3445 NTSTATUS 3446 VFWDFEXPORT(WdfRequestUnmarkCancelable)( 3447 _In_ 3448 PWDF_DRIVER_GLOBALS DriverGlobals, 3449 _In_ 3450 WDFREQUEST Request 3451 ) 3452 { 3453 PAGED_CODE_LOCKED(); 3454 return ((PFN_WDFREQUESTUNMARKCANCELABLE) WdfVersion.Functions.pfnWdfRequestUnmarkCancelable)(DriverGlobals, Request); 3455 } 3456 3457 _Must_inspect_result_ 3458 _IRQL_requires_max_(DISPATCH_LEVEL) 3459 WDFAPI 3460 BOOLEAN 3461 VFWDFEXPORT(WdfRequestIsCanceled)( 3462 _In_ 3463 PWDF_DRIVER_GLOBALS DriverGlobals, 3464 _In_ 3465 WDFREQUEST Request 3466 ) 3467 { 3468 PAGED_CODE_LOCKED(); 3469 return ((PFN_WDFREQUESTISCANCELED) WdfVersion.Functions.pfnWdfRequestIsCanceled)(DriverGlobals, Request); 3470 } 3471 3472 _IRQL_requires_max_(DISPATCH_LEVEL) 3473 WDFAPI 3474 BOOLEAN 3475 VFWDFEXPORT(WdfRequestCancelSentRequest)( 3476 _In_ 3477 PWDF_DRIVER_GLOBALS DriverGlobals, 3478 _In_ 3479 WDFREQUEST Request 3480 ) 3481 { 3482 PAGED_CODE_LOCKED(); 3483 return ((PFN_WDFREQUESTCANCELSENTREQUEST) WdfVersion.Functions.pfnWdfRequestCancelSentRequest)(DriverGlobals, Request); 3484 } 3485 3486 _Must_inspect_result_ 3487 _IRQL_requires_max_(APC_LEVEL) 3488 WDFAPI 3489 BOOLEAN 3490 VFWDFEXPORT(WdfRequestIsFrom32BitProcess)( 3491 _In_ 3492 PWDF_DRIVER_GLOBALS DriverGlobals, 3493 _In_ 3494 WDFREQUEST Request 3495 ) 3496 { 3497 PAGED_CODE_LOCKED(); 3498 return ((PFN_WDFREQUESTISFROM32BITPROCESS) WdfVersion.Functions.pfnWdfRequestIsFrom32BitProcess)(DriverGlobals, Request); 3499 } 3500 3501 _IRQL_requires_max_(DISPATCH_LEVEL) 3502 WDFAPI 3503 VOID 3504 VFWDFEXPORT(WdfRequestSetCompletionRoutine)( 3505 _In_ 3506 PWDF_DRIVER_GLOBALS DriverGlobals, 3507 _In_ 3508 WDFREQUEST Request, 3509 _In_opt_ 3510 PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine, 3511 _In_opt_ __drv_aliasesMem 3512 WDFCONTEXT CompletionContext 3513 ) 3514 { 3515 PAGED_CODE_LOCKED(); 3516 ((PFN_WDFREQUESTSETCOMPLETIONROUTINE) WdfVersion.Functions.pfnWdfRequestSetCompletionRoutine)(DriverGlobals, Request, CompletionRoutine, CompletionContext); 3517 } 3518 3519 _IRQL_requires_max_(DISPATCH_LEVEL) 3520 WDFAPI 3521 VOID 3522 VFWDFEXPORT(WdfRequestGetCompletionParams)( 3523 _In_ 3524 PWDF_DRIVER_GLOBALS DriverGlobals, 3525 _In_ 3526 WDFREQUEST Request, 3527 _Out_ 3528 PWDF_REQUEST_COMPLETION_PARAMS Params 3529 ) 3530 { 3531 PAGED_CODE_LOCKED(); 3532 ((PFN_WDFREQUESTGETCOMPLETIONPARAMS) WdfVersion.Functions.pfnWdfRequestGetCompletionParams)(DriverGlobals, Request, Params); 3533 } 3534 3535 _Must_inspect_result_ 3536 _IRQL_requires_max_(DISPATCH_LEVEL) 3537 WDFAPI 3538 NTSTATUS 3539 VFWDFEXPORT(WdfRequestAllocateTimer)( 3540 _In_ 3541 PWDF_DRIVER_GLOBALS DriverGlobals, 3542 _In_ 3543 WDFREQUEST Request 3544 ) 3545 { 3546 PAGED_CODE_LOCKED(); 3547 return ((PFN_WDFREQUESTALLOCATETIMER) WdfVersion.Functions.pfnWdfRequestAllocateTimer)(DriverGlobals, Request); 3548 } 3549 3550 _IRQL_requires_max_(DISPATCH_LEVEL) 3551 WDFAPI 3552 VOID 3553 VFWDFEXPORT(WdfRequestComplete)( 3554 _In_ 3555 PWDF_DRIVER_GLOBALS DriverGlobals, 3556 _In_ 3557 WDFREQUEST Request, 3558 _In_ 3559 NTSTATUS Status 3560 ) 3561 { 3562 PAGED_CODE_LOCKED(); 3563 PerfIoComplete(Request); 3564 ((PFN_WDFREQUESTCOMPLETE) WdfVersion.Functions.pfnWdfRequestComplete)(DriverGlobals, Request, Status); 3565 } 3566 3567 _IRQL_requires_max_(DISPATCH_LEVEL) 3568 WDFAPI 3569 VOID 3570 VFWDFEXPORT(WdfRequestCompleteWithInformation)( 3571 _In_ 3572 PWDF_DRIVER_GLOBALS DriverGlobals, 3573 _In_ 3574 WDFREQUEST Request, 3575 _In_ 3576 NTSTATUS Status, 3577 _In_ 3578 ULONG_PTR Information 3579 ) 3580 { 3581 PAGED_CODE_LOCKED(); 3582 PerfIoComplete(Request); 3583 ((PFN_WDFREQUESTCOMPLETEWITHINFORMATION) WdfVersion.Functions.pfnWdfRequestCompleteWithInformation)(DriverGlobals, Request, Status, Information); 3584 } 3585 3586 _IRQL_requires_max_(DISPATCH_LEVEL) 3587 WDFAPI 3588 VOID 3589 VFWDFEXPORT(WdfRequestGetParameters)( 3590 _In_ 3591 PWDF_DRIVER_GLOBALS DriverGlobals, 3592 _In_ 3593 WDFREQUEST Request, 3594 _Out_ 3595 PWDF_REQUEST_PARAMETERS Parameters 3596 ) 3597 { 3598 PAGED_CODE_LOCKED(); 3599 ((PFN_WDFREQUESTGETPARAMETERS) WdfVersion.Functions.pfnWdfRequestGetParameters)(DriverGlobals, Request, Parameters); 3600 } 3601 3602 _Must_inspect_result_ 3603 _IRQL_requires_max_(DISPATCH_LEVEL) 3604 WDFAPI 3605 NTSTATUS 3606 VFWDFEXPORT(WdfRequestRetrieveInputMemory)( 3607 _In_ 3608 PWDF_DRIVER_GLOBALS DriverGlobals, 3609 _In_ 3610 WDFREQUEST Request, 3611 _Out_ 3612 WDFMEMORY* Memory 3613 ) 3614 { 3615 PAGED_CODE_LOCKED(); 3616 return ((PFN_WDFREQUESTRETRIEVEINPUTMEMORY) WdfVersion.Functions.pfnWdfRequestRetrieveInputMemory)(DriverGlobals, Request, Memory); 3617 } 3618 3619 _Must_inspect_result_ 3620 _IRQL_requires_max_(DISPATCH_LEVEL) 3621 WDFAPI 3622 NTSTATUS 3623 VFWDFEXPORT(WdfRequestRetrieveOutputMemory)( 3624 _In_ 3625 PWDF_DRIVER_GLOBALS DriverGlobals, 3626 _In_ 3627 WDFREQUEST Request, 3628 _Out_ 3629 WDFMEMORY* Memory 3630 ) 3631 { 3632 PAGED_CODE_LOCKED(); 3633 return ((PFN_WDFREQUESTRETRIEVEOUTPUTMEMORY) WdfVersion.Functions.pfnWdfRequestRetrieveOutputMemory)(DriverGlobals, Request, Memory); 3634 } 3635 3636 _Must_inspect_result_ 3637 _IRQL_requires_max_(DISPATCH_LEVEL) 3638 WDFAPI 3639 NTSTATUS 3640 VFWDFEXPORT(WdfRequestRetrieveInputBuffer)( 3641 _In_ 3642 PWDF_DRIVER_GLOBALS DriverGlobals, 3643 _In_ 3644 WDFREQUEST Request, 3645 _In_ 3646 size_t MinimumRequiredLength, 3647 _Outptr_result_bytebuffer_(*Length) 3648 PVOID* Buffer, 3649 _Out_opt_ 3650 size_t* Length 3651 ) 3652 { 3653 PAGED_CODE_LOCKED(); 3654 return ((PFN_WDFREQUESTRETRIEVEINPUTBUFFER) WdfVersion.Functions.pfnWdfRequestRetrieveInputBuffer)(DriverGlobals, Request, MinimumRequiredLength, Buffer, Length); 3655 } 3656 3657 _Must_inspect_result_ 3658 _IRQL_requires_max_(DISPATCH_LEVEL) 3659 WDFAPI 3660 NTSTATUS 3661 VFWDFEXPORT(WdfRequestRetrieveOutputBuffer)( 3662 _In_ 3663 PWDF_DRIVER_GLOBALS DriverGlobals, 3664 _In_ 3665 WDFREQUEST Request, 3666 _In_ 3667 size_t MinimumRequiredSize, 3668 _Outptr_result_bytebuffer_(*Length) 3669 PVOID* Buffer, 3670 _Out_opt_ 3671 size_t* Length 3672 ) 3673 { 3674 PAGED_CODE_LOCKED(); 3675 return ((PFN_WDFREQUESTRETRIEVEOUTPUTBUFFER) WdfVersion.Functions.pfnWdfRequestRetrieveOutputBuffer)(DriverGlobals, Request, MinimumRequiredSize, Buffer, Length); 3676 } 3677 3678 _IRQL_requires_max_(DISPATCH_LEVEL) 3679 WDFAPI 3680 VOID 3681 VFWDFEXPORT(WdfRequestSetInformation)( 3682 _In_ 3683 PWDF_DRIVER_GLOBALS DriverGlobals, 3684 _In_ 3685 WDFREQUEST Request, 3686 _In_ 3687 ULONG_PTR Information 3688 ) 3689 { 3690 PAGED_CODE_LOCKED(); 3691 ((PFN_WDFREQUESTSETINFORMATION) WdfVersion.Functions.pfnWdfRequestSetInformation)(DriverGlobals, Request, Information); 3692 } 3693 3694 _IRQL_requires_max_(DISPATCH_LEVEL) 3695 WDFAPI 3696 ULONG_PTR 3697 VFWDFEXPORT(WdfRequestGetInformation)( 3698 _In_ 3699 PWDF_DRIVER_GLOBALS DriverGlobals, 3700 _In_ 3701 WDFREQUEST Request 3702 ) 3703 { 3704 PAGED_CODE_LOCKED(); 3705 return ((PFN_WDFREQUESTGETINFORMATION) WdfVersion.Functions.pfnWdfRequestGetInformation)(DriverGlobals, Request); 3706 } 3707 3708 _IRQL_requires_max_(DISPATCH_LEVEL) 3709 WDFAPI 3710 WDFFILEOBJECT 3711 VFWDFEXPORT(WdfRequestGetFileObject)( 3712 _In_ 3713 PWDF_DRIVER_GLOBALS DriverGlobals, 3714 _In_ 3715 WDFREQUEST Request 3716 ) 3717 { 3718 PAGED_CODE_LOCKED(); 3719 return ((PFN_WDFREQUESTGETFILEOBJECT) WdfVersion.Functions.pfnWdfRequestGetFileObject)(DriverGlobals, Request); 3720 } 3721 3722 _IRQL_requires_max_(DISPATCH_LEVEL) 3723 WDFAPI 3724 KPROCESSOR_MODE 3725 VFWDFEXPORT(WdfRequestGetRequestorMode)( 3726 _In_ 3727 PWDF_DRIVER_GLOBALS DriverGlobals, 3728 _In_ 3729 WDFREQUEST Request 3730 ) 3731 { 3732 PAGED_CODE_LOCKED(); 3733 return ((PFN_WDFREQUESTGETREQUESTORMODE) WdfVersion.Functions.pfnWdfRequestGetRequestorMode)(DriverGlobals, Request); 3734 } 3735 3736 _Must_inspect_result_ 3737 _IRQL_requires_max_(DISPATCH_LEVEL) 3738 WDFAPI 3739 NTSTATUS 3740 VFWDFEXPORT(WdfRequestForwardToIoQueue)( 3741 _In_ 3742 PWDF_DRIVER_GLOBALS DriverGlobals, 3743 _In_ 3744 WDFREQUEST Request, 3745 _In_ 3746 WDFQUEUE DestinationQueue 3747 ) 3748 { 3749 PAGED_CODE_LOCKED(); 3750 return ((PFN_WDFREQUESTFORWARDTOIOQUEUE) WdfVersion.Functions.pfnWdfRequestForwardToIoQueue)(DriverGlobals, Request, DestinationQueue); 3751 } 3752 3753 _IRQL_requires_max_(DISPATCH_LEVEL) 3754 WDFAPI 3755 WDFQUEUE 3756 VFWDFEXPORT(WdfRequestGetIoQueue)( 3757 _In_ 3758 PWDF_DRIVER_GLOBALS DriverGlobals, 3759 _In_ 3760 WDFREQUEST Request 3761 ) 3762 { 3763 PAGED_CODE_LOCKED(); 3764 return ((PFN_WDFREQUESTGETIOQUEUE) WdfVersion.Functions.pfnWdfRequestGetIoQueue)(DriverGlobals, Request); 3765 } 3766 3767 _Must_inspect_result_ 3768 _IRQL_requires_max_(DISPATCH_LEVEL) 3769 WDFAPI 3770 NTSTATUS 3771 VFWDFEXPORT(WdfRequestRequeue)( 3772 _In_ 3773 PWDF_DRIVER_GLOBALS DriverGlobals, 3774 _In_ 3775 WDFREQUEST Request 3776 ) 3777 { 3778 PAGED_CODE_LOCKED(); 3779 return ((PFN_WDFREQUESTREQUEUE) WdfVersion.Functions.pfnWdfRequestRequeue)(DriverGlobals, Request); 3780 } 3781 3782 _IRQL_requires_max_(DISPATCH_LEVEL) 3783 WDFAPI 3784 VOID 3785 VFWDFEXPORT(WdfRequestStopAcknowledge)( 3786 _In_ 3787 PWDF_DRIVER_GLOBALS DriverGlobals, 3788 _In_ 3789 WDFREQUEST Request, 3790 _In_ 3791 BOOLEAN Requeue 3792 ) 3793 { 3794 PAGED_CODE_LOCKED(); 3795 ((PFN_WDFREQUESTSTOPACKNOWLEDGE) WdfVersion.Functions.pfnWdfRequestStopAcknowledge)(DriverGlobals, Request, Requeue); 3796 } 3797 3798 _Must_inspect_result_ 3799 _IRQL_requires_max_(PASSIVE_LEVEL) 3800 WDFAPI 3801 NTSTATUS 3802 VFWDFEXPORT(WdfRequestImpersonate)( 3803 _In_ 3804 PWDF_DRIVER_GLOBALS DriverGlobals, 3805 _In_ 3806 WDFREQUEST Request, 3807 _In_ 3808 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, 3809 _In_ 3810 PFN_WDF_REQUEST_IMPERSONATE EvtRequestImpersonate, 3811 _In_opt_ 3812 PVOID Context 3813 ) 3814 { 3815 PAGED_CODE_LOCKED(); 3816 return ((PFN_WDFREQUESTIMPERSONATE) WdfVersion.Functions.pfnWdfRequestImpersonate)(DriverGlobals, Request, ImpersonationLevel, EvtRequestImpersonate, Context); 3817 } 3818 3819 _IRQL_requires_max_(PASSIVE_LEVEL) 3820 WDFAPI 3821 ULONG 3822 VFWDFEXPORT(WdfRequestGetRequestorProcessId)( 3823 _In_ 3824 PWDF_DRIVER_GLOBALS DriverGlobals, 3825 _In_ 3826 WDFREQUEST Request 3827 ) 3828 { 3829 PAGED_CODE_LOCKED(); 3830 return ((PFN_WDFREQUESTGETREQUESTORPROCESSID) WdfVersion.Functions.pfnWdfRequestGetRequestorProcessId)(DriverGlobals, Request); 3831 } 3832 3833 _IRQL_requires_max_(PASSIVE_LEVEL) 3834 WDFAPI 3835 BOOLEAN 3836 VFWDFEXPORT(WdfRequestIsFromUserModeDriver)( 3837 _In_ 3838 PWDF_DRIVER_GLOBALS DriverGlobals, 3839 _In_ 3840 WDFREQUEST Request 3841 ) 3842 { 3843 PAGED_CODE_LOCKED(); 3844 return ((PFN_WDFREQUESTISFROMUSERMODEDRIVER) WdfVersion.Functions.pfnWdfRequestIsFromUserModeDriver)(DriverGlobals, Request); 3845 } 3846 3847 _IRQL_requires_max_(PASSIVE_LEVEL) 3848 WDFAPI 3849 VOID 3850 VFWDFEXPORT(WdfRequestSetUserModeDriverInitiatedIo)( 3851 _In_ 3852 PWDF_DRIVER_GLOBALS DriverGlobals, 3853 _In_ 3854 WDFREQUEST Request, 3855 _In_ 3856 BOOLEAN IsUserModeDriverInitiated 3857 ) 3858 { 3859 PAGED_CODE_LOCKED(); 3860 ((PFN_WDFREQUESTSETUSERMODEDRIVERINITIATEDIO) WdfVersion.Functions.pfnWdfRequestSetUserModeDriverInitiatedIo)(DriverGlobals, Request, IsUserModeDriverInitiated); 3861 } 3862 3863 _IRQL_requires_max_(PASSIVE_LEVEL) 3864 WDFAPI 3865 BOOLEAN 3866 VFWDFEXPORT(WdfRequestGetUserModeDriverInitiatedIo)( 3867 _In_ 3868 PWDF_DRIVER_GLOBALS DriverGlobals, 3869 _In_ 3870 WDFREQUEST Request 3871 ) 3872 { 3873 PAGED_CODE_LOCKED(); 3874 return ((PFN_WDFREQUESTGETUSERMODEDRIVERINITIATEDIO) WdfVersion.Functions.pfnWdfRequestGetUserModeDriverInitiatedIo)(DriverGlobals, Request); 3875 } 3876 3877 _IRQL_requires_max_(PASSIVE_LEVEL) 3878 WDFAPI 3879 VOID 3880 VFWDFEXPORT(WdfRequestSetActivityId)( 3881 _In_ 3882 PWDF_DRIVER_GLOBALS DriverGlobals, 3883 _In_ 3884 WDFREQUEST Request, 3885 _In_ 3886 LPGUID ActivityId 3887 ) 3888 { 3889 PAGED_CODE_LOCKED(); 3890 ((PFN_WDFREQUESTSETACTIVITYID) WdfVersion.Functions.pfnWdfRequestSetActivityId)(DriverGlobals, Request, ActivityId); 3891 } 3892 3893 _IRQL_requires_max_(PASSIVE_LEVEL) 3894 WDFAPI 3895 NTSTATUS 3896 VFWDFEXPORT(WdfRequestRetrieveActivityId)( 3897 _In_ 3898 PWDF_DRIVER_GLOBALS DriverGlobals, 3899 _In_ 3900 WDFREQUEST Request, 3901 _Out_ 3902 LPGUID ActivityId 3903 ) 3904 { 3905 PAGED_CODE_LOCKED(); 3906 return ((PFN_WDFREQUESTRETRIEVEACTIVITYID) WdfVersion.Functions.pfnWdfRequestRetrieveActivityId)(DriverGlobals, Request, ActivityId); 3907 } 3908 3909 _IRQL_requires_max_(PASSIVE_LEVEL) 3910 WDFAPI 3911 WDF_DEVICE_IO_TYPE 3912 VFWDFEXPORT(WdfRequestGetEffectiveIoType)( 3913 _In_ 3914 PWDF_DRIVER_GLOBALS DriverGlobals, 3915 _In_ 3916 WDFREQUEST Request 3917 ) 3918 { 3919 PAGED_CODE_LOCKED(); 3920 return ((PFN_WDFREQUESTGETEFFECTIVEIOTYPE) WdfVersion.Functions.pfnWdfRequestGetEffectiveIoType)(DriverGlobals, Request); 3921 } 3922 3923 _IRQL_requires_max_(DISPATCH_LEVEL) 3924 WDFAPI 3925 ULONG 3926 VFWDFEXPORT(WdfCmResourceListGetCount)( 3927 _In_ 3928 PWDF_DRIVER_GLOBALS DriverGlobals, 3929 _In_ 3930 WDFCMRESLIST List 3931 ) 3932 { 3933 PAGED_CODE_LOCKED(); 3934 return ((PFN_WDFCMRESOURCELISTGETCOUNT) WdfVersion.Functions.pfnWdfCmResourceListGetCount)(DriverGlobals, List); 3935 } 3936 3937 _IRQL_requires_max_(DISPATCH_LEVEL) 3938 WDFAPI 3939 PCM_PARTIAL_RESOURCE_DESCRIPTOR 3940 VFWDFEXPORT(WdfCmResourceListGetDescriptor)( 3941 _In_ 3942 PWDF_DRIVER_GLOBALS DriverGlobals, 3943 _In_ 3944 WDFCMRESLIST List, 3945 _In_ 3946 ULONG Index 3947 ) 3948 { 3949 PAGED_CODE_LOCKED(); 3950 return ((PFN_WDFCMRESOURCELISTGETDESCRIPTOR) WdfVersion.Functions.pfnWdfCmResourceListGetDescriptor)(DriverGlobals, List, Index); 3951 } 3952 3953 _Must_inspect_result_ 3954 _IRQL_requires_max_(PASSIVE_LEVEL) 3955 WDFAPI 3956 NTSTATUS 3957 VFWDFEXPORT(WdfStringCreate)( 3958 _In_ 3959 PWDF_DRIVER_GLOBALS DriverGlobals, 3960 _In_opt_ 3961 PCUNICODE_STRING UnicodeString, 3962 _In_opt_ 3963 PWDF_OBJECT_ATTRIBUTES StringAttributes, 3964 _Out_ 3965 WDFSTRING* String 3966 ) 3967 { 3968 PAGED_CODE_LOCKED(); 3969 return ((PFN_WDFSTRINGCREATE) WdfVersion.Functions.pfnWdfStringCreate)(DriverGlobals, UnicodeString, StringAttributes, String); 3970 } 3971 3972 _IRQL_requires_max_(PASSIVE_LEVEL) 3973 WDFAPI 3974 VOID 3975 VFWDFEXPORT(WdfStringGetUnicodeString)( 3976 _In_ 3977 PWDF_DRIVER_GLOBALS DriverGlobals, 3978 _In_ 3979 WDFSTRING String, 3980 _Out_ 3981 PUNICODE_STRING UnicodeString 3982 ) 3983 { 3984 PAGED_CODE_LOCKED(); 3985 ((PFN_WDFSTRINGGETUNICODESTRING) WdfVersion.Functions.pfnWdfStringGetUnicodeString)(DriverGlobals, String, UnicodeString); 3986 } 3987 3988 _IRQL_requires_max_(DISPATCH_LEVEL) 3989 WDFAPI 3990 VOID 3991 VFWDFEXPORT(WdfObjectAcquireLock)( 3992 _In_ 3993 PWDF_DRIVER_GLOBALS DriverGlobals, 3994 _In_ 3995 _Requires_lock_not_held_(_Curr_) 3996 _Acquires_lock_(_Curr_) 3997 WDFOBJECT Object 3998 ) 3999 { 4000 PAGED_CODE_LOCKED(); 4001 ((PFN_WDFOBJECTACQUIRELOCK) WdfVersion.Functions.pfnWdfObjectAcquireLock)(DriverGlobals, Object); 4002 } 4003 4004 _IRQL_requires_max_(DISPATCH_LEVEL) 4005 WDFAPI 4006 VOID 4007 VFWDFEXPORT(WdfObjectReleaseLock)( 4008 _In_ 4009 PWDF_DRIVER_GLOBALS DriverGlobals, 4010 _In_ 4011 _Requires_lock_held_(_Curr_) 4012 _Releases_lock_(_Curr_) 4013 WDFOBJECT Object 4014 ) 4015 { 4016 PAGED_CODE_LOCKED(); 4017 ((PFN_WDFOBJECTRELEASELOCK) WdfVersion.Functions.pfnWdfObjectReleaseLock)(DriverGlobals, Object); 4018 } 4019 4020 _Must_inspect_result_ 4021 _IRQL_requires_max_(DISPATCH_LEVEL) 4022 WDFAPI 4023 NTSTATUS 4024 VFWDFEXPORT(WdfWaitLockCreate)( 4025 _In_ 4026 PWDF_DRIVER_GLOBALS DriverGlobals, 4027 _In_opt_ 4028 PWDF_OBJECT_ATTRIBUTES LockAttributes, 4029 _Out_ 4030 WDFWAITLOCK* Lock 4031 ) 4032 { 4033 PAGED_CODE_LOCKED(); 4034 return ((PFN_WDFWAITLOCKCREATE) WdfVersion.Functions.pfnWdfWaitLockCreate)(DriverGlobals, LockAttributes, Lock); 4035 } 4036 4037 _When_(Timeout == NULL, _IRQL_requires_max_(PASSIVE_LEVEL)) 4038 _When_(Timeout != NULL && *Timeout == 0, _IRQL_requires_max_(DISPATCH_LEVEL)) 4039 _When_(Timeout != NULL && *Timeout != 0, _IRQL_requires_max_(PASSIVE_LEVEL)) 4040 _Always_(_When_(Timeout == NULL, _Acquires_lock_(Lock))) 4041 _When_(Timeout != NULL && return == STATUS_SUCCESS, _Acquires_lock_(Lock)) 4042 _When_(Timeout != NULL, _Must_inspect_result_) 4043 WDFAPI 4044 NTSTATUS 4045 VFWDFEXPORT(WdfWaitLockAcquire)( 4046 _In_ 4047 PWDF_DRIVER_GLOBALS DriverGlobals, 4048 _In_ 4049 _Requires_lock_not_held_(_Curr_) 4050 WDFWAITLOCK Lock, 4051 _In_opt_ 4052 PLONGLONG Timeout 4053 ) 4054 { 4055 PAGED_CODE_LOCKED(); 4056 return ((PFN_WDFWAITLOCKACQUIRE) WdfVersion.Functions.pfnWdfWaitLockAcquire)(DriverGlobals, Lock, Timeout); 4057 } 4058 4059 _IRQL_requires_max_(DISPATCH_LEVEL) 4060 WDFAPI 4061 VOID 4062 VFWDFEXPORT(WdfWaitLockRelease)( 4063 _In_ 4064 PWDF_DRIVER_GLOBALS DriverGlobals, 4065 _In_ 4066 _Requires_lock_held_(_Curr_) 4067 _Releases_lock_(_Curr_) 4068 WDFWAITLOCK Lock 4069 ) 4070 { 4071 PAGED_CODE_LOCKED(); 4072 ((PFN_WDFWAITLOCKRELEASE) WdfVersion.Functions.pfnWdfWaitLockRelease)(DriverGlobals, Lock); 4073 } 4074 4075 _Must_inspect_result_ 4076 _IRQL_requires_max_(DISPATCH_LEVEL) 4077 WDFAPI 4078 NTSTATUS 4079 VFWDFEXPORT(WdfSpinLockCreate)( 4080 _In_ 4081 PWDF_DRIVER_GLOBALS DriverGlobals, 4082 _In_opt_ 4083 PWDF_OBJECT_ATTRIBUTES SpinLockAttributes, 4084 _Out_ 4085 WDFSPINLOCK* SpinLock 4086 ) 4087 { 4088 PAGED_CODE_LOCKED(); 4089 return ((PFN_WDFSPINLOCKCREATE) WdfVersion.Functions.pfnWdfSpinLockCreate)(DriverGlobals, SpinLockAttributes, SpinLock); 4090 } 4091 4092 _IRQL_requires_max_(DISPATCH_LEVEL) 4093 _IRQL_raises_(DISPATCH_LEVEL) 4094 WDFAPI 4095 VOID 4096 VFWDFEXPORT(WdfSpinLockAcquire)( 4097 _In_ 4098 PWDF_DRIVER_GLOBALS DriverGlobals, 4099 _In_ 4100 _Requires_lock_not_held_(_Curr_) 4101 _Acquires_lock_(_Curr_) 4102 _IRQL_saves_ 4103 WDFSPINLOCK SpinLock 4104 ) 4105 { 4106 PAGED_CODE_LOCKED(); 4107 ((PFN_WDFSPINLOCKACQUIRE) WdfVersion.Functions.pfnWdfSpinLockAcquire)(DriverGlobals, SpinLock); 4108 } 4109 4110 _IRQL_requires_max_(DISPATCH_LEVEL) 4111 _IRQL_requires_min_(DISPATCH_LEVEL) 4112 WDFAPI 4113 VOID 4114 VFWDFEXPORT(WdfSpinLockRelease)( 4115 _In_ 4116 PWDF_DRIVER_GLOBALS DriverGlobals, 4117 _In_ 4118 _Requires_lock_held_(_Curr_) 4119 _Releases_lock_(_Curr_) 4120 _IRQL_restores_ 4121 WDFSPINLOCK SpinLock 4122 ) 4123 { 4124 PAGED_CODE_LOCKED(); 4125 ((PFN_WDFSPINLOCKRELEASE) WdfVersion.Functions.pfnWdfSpinLockRelease)(DriverGlobals, SpinLock); 4126 } 4127 4128 _Must_inspect_result_ 4129 _IRQL_requires_max_(DISPATCH_LEVEL) 4130 WDFAPI 4131 NTSTATUS 4132 VFWDFEXPORT(WdfTimerCreate)( 4133 _In_ 4134 PWDF_DRIVER_GLOBALS DriverGlobals, 4135 _In_ 4136 PWDF_TIMER_CONFIG Config, 4137 _In_ 4138 PWDF_OBJECT_ATTRIBUTES Attributes, 4139 _Out_ 4140 WDFTIMER* Timer 4141 ) 4142 { 4143 PAGED_CODE_LOCKED(); 4144 return ((PFN_WDFTIMERCREATE) WdfVersion.Functions.pfnWdfTimerCreate)(DriverGlobals, Config, Attributes, Timer); 4145 } 4146 4147 _IRQL_requires_max_(DISPATCH_LEVEL) 4148 WDFAPI 4149 BOOLEAN 4150 VFWDFEXPORT(WdfTimerStart)( 4151 _In_ 4152 PWDF_DRIVER_GLOBALS DriverGlobals, 4153 _In_ 4154 WDFTIMER Timer, 4155 _In_ 4156 LONGLONG DueTime 4157 ) 4158 { 4159 PAGED_CODE_LOCKED(); 4160 return ((PFN_WDFTIMERSTART) WdfVersion.Functions.pfnWdfTimerStart)(DriverGlobals, Timer, DueTime); 4161 } 4162 4163 _When_(Wait == __true, _IRQL_requires_max_(PASSIVE_LEVEL)) 4164 _When_(Wait == __false, _IRQL_requires_max_(DISPATCH_LEVEL)) 4165 WDFAPI 4166 BOOLEAN 4167 VFWDFEXPORT(WdfTimerStop)( 4168 _In_ 4169 PWDF_DRIVER_GLOBALS DriverGlobals, 4170 _In_ 4171 WDFTIMER Timer, 4172 _In_ 4173 BOOLEAN Wait 4174 ) 4175 { 4176 PAGED_CODE_LOCKED(); 4177 return ((PFN_WDFTIMERSTOP) WdfVersion.Functions.pfnWdfTimerStop)(DriverGlobals, Timer, Wait); 4178 } 4179 4180 _IRQL_requires_max_(DISPATCH_LEVEL) 4181 WDFAPI 4182 WDFOBJECT 4183 VFWDFEXPORT(WdfTimerGetParentObject)( 4184 _In_ 4185 PWDF_DRIVER_GLOBALS DriverGlobals, 4186 _In_ 4187 WDFTIMER Timer 4188 ) 4189 { 4190 PAGED_CODE_LOCKED(); 4191 return ((PFN_WDFTIMERGETPARENTOBJECT) WdfVersion.Functions.pfnWdfTimerGetParentObject)(DriverGlobals, Timer); 4192 } 4193 4194 _Must_inspect_result_ 4195 _IRQL_requires_max_(PASSIVE_LEVEL) 4196 WDFAPI 4197 NTSTATUS 4198 VFWDFEXPORT(WdfUsbTargetDeviceCreate)( 4199 _In_ 4200 PWDF_DRIVER_GLOBALS DriverGlobals, 4201 _In_ 4202 WDFDEVICE Device, 4203 _In_opt_ 4204 PWDF_OBJECT_ATTRIBUTES Attributes, 4205 _Out_ 4206 WDFUSBDEVICE* UsbDevice 4207 ) 4208 { 4209 PAGED_CODE_LOCKED(); 4210 return ((PFN_WDFUSBTARGETDEVICECREATE) WdfVersion.Functions.pfnWdfUsbTargetDeviceCreate)(DriverGlobals, Device, Attributes, UsbDevice); 4211 } 4212 4213 _Must_inspect_result_ 4214 _IRQL_requires_max_(PASSIVE_LEVEL) 4215 WDFAPI 4216 NTSTATUS 4217 VFWDFEXPORT(WdfUsbTargetDeviceCreateWithParameters)( 4218 _In_ 4219 PWDF_DRIVER_GLOBALS DriverGlobals, 4220 _In_ 4221 WDFDEVICE Device, 4222 _In_ 4223 PWDF_USB_DEVICE_CREATE_CONFIG Config, 4224 _In_opt_ 4225 PWDF_OBJECT_ATTRIBUTES Attributes, 4226 _Out_ 4227 WDFUSBDEVICE* UsbDevice 4228 ) 4229 { 4230 PAGED_CODE_LOCKED(); 4231 return ((PFN_WDFUSBTARGETDEVICECREATEWITHPARAMETERS) WdfVersion.Functions.pfnWdfUsbTargetDeviceCreateWithParameters)(DriverGlobals, Device, Config, Attributes, UsbDevice); 4232 } 4233 4234 _Must_inspect_result_ 4235 _IRQL_requires_max_(DISPATCH_LEVEL) 4236 WDFAPI 4237 NTSTATUS 4238 VFWDFEXPORT(WdfUsbTargetDeviceRetrieveInformation)( 4239 _In_ 4240 PWDF_DRIVER_GLOBALS DriverGlobals, 4241 _In_ 4242 WDFUSBDEVICE UsbDevice, 4243 _Out_ 4244 PWDF_USB_DEVICE_INFORMATION Information 4245 ) 4246 { 4247 PAGED_CODE_LOCKED(); 4248 return ((PFN_WDFUSBTARGETDEVICERETRIEVEINFORMATION) WdfVersion.Functions.pfnWdfUsbTargetDeviceRetrieveInformation)(DriverGlobals, UsbDevice, Information); 4249 } 4250 4251 _IRQL_requires_max_(PASSIVE_LEVEL) 4252 WDFAPI 4253 VOID 4254 VFWDFEXPORT(WdfUsbTargetDeviceGetDeviceDescriptor)( 4255 _In_ 4256 PWDF_DRIVER_GLOBALS DriverGlobals, 4257 _In_ 4258 WDFUSBDEVICE UsbDevice, 4259 _Out_ 4260 PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor 4261 ) 4262 { 4263 PAGED_CODE_LOCKED(); 4264 ((PFN_WDFUSBTARGETDEVICEGETDEVICEDESCRIPTOR) WdfVersion.Functions.pfnWdfUsbTargetDeviceGetDeviceDescriptor)(DriverGlobals, UsbDevice, UsbDeviceDescriptor); 4265 } 4266 4267 _Must_inspect_result_ 4268 _IRQL_requires_max_(PASSIVE_LEVEL) 4269 WDFAPI 4270 NTSTATUS 4271 VFWDFEXPORT(WdfUsbTargetDeviceRetrieveConfigDescriptor)( 4272 _In_ 4273 PWDF_DRIVER_GLOBALS DriverGlobals, 4274 _In_ 4275 WDFUSBDEVICE UsbDevice, 4276 _Out_writes_bytes_to_opt_(*ConfigDescriptorLength,*ConfigDescriptorLength) 4277 PVOID ConfigDescriptor, 4278 _Inout_ 4279 PUSHORT ConfigDescriptorLength 4280 ) 4281 { 4282 PAGED_CODE_LOCKED(); 4283 #pragma prefast(suppress: __WARNING_HIGH_PRIORITY_OVERFLOW_POSTCONDITION, "This is a verifier DDI hook routine and all it does is call original routine.") 4284 return ((PFN_WDFUSBTARGETDEVICERETRIEVECONFIGDESCRIPTOR) WdfVersion.Functions.pfnWdfUsbTargetDeviceRetrieveConfigDescriptor)(DriverGlobals, UsbDevice, ConfigDescriptor, ConfigDescriptorLength); 4285 } 4286 4287 _Must_inspect_result_ 4288 _IRQL_requires_max_(PASSIVE_LEVEL) 4289 WDFAPI 4290 NTSTATUS 4291 VFWDFEXPORT(WdfUsbTargetDeviceQueryString)( 4292 _In_ 4293 PWDF_DRIVER_GLOBALS DriverGlobals, 4294 _In_ 4295 WDFUSBDEVICE UsbDevice, 4296 _In_opt_ 4297 WDFREQUEST Request, 4298 _In_opt_ 4299 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 4300 _Out_writes_opt_(*NumCharacters) 4301 PUSHORT String, 4302 _Inout_ 4303 PUSHORT NumCharacters, 4304 _In_ 4305 UCHAR StringIndex, 4306 _In_opt_ 4307 USHORT LangID 4308 ) 4309 { 4310 PAGED_CODE_LOCKED(); 4311 return ((PFN_WDFUSBTARGETDEVICEQUERYSTRING) WdfVersion.Functions.pfnWdfUsbTargetDeviceQueryString)(DriverGlobals, UsbDevice, Request, RequestOptions, String, NumCharacters, StringIndex, LangID); 4312 } 4313 4314 _Must_inspect_result_ 4315 _IRQL_requires_max_(PASSIVE_LEVEL) 4316 WDFAPI 4317 NTSTATUS 4318 VFWDFEXPORT(WdfUsbTargetDeviceAllocAndQueryString)( 4319 _In_ 4320 PWDF_DRIVER_GLOBALS DriverGlobals, 4321 _In_ 4322 WDFUSBDEVICE UsbDevice, 4323 _In_opt_ 4324 PWDF_OBJECT_ATTRIBUTES StringMemoryAttributes, 4325 _Out_ 4326 WDFMEMORY* StringMemory, 4327 _Out_opt_ 4328 PUSHORT NumCharacters, 4329 _In_ 4330 UCHAR StringIndex, 4331 _In_opt_ 4332 USHORT LangID 4333 ) 4334 { 4335 PAGED_CODE_LOCKED(); 4336 return ((PFN_WDFUSBTARGETDEVICEALLOCANDQUERYSTRING) WdfVersion.Functions.pfnWdfUsbTargetDeviceAllocAndQueryString)(DriverGlobals, UsbDevice, StringMemoryAttributes, StringMemory, NumCharacters, StringIndex, LangID); 4337 } 4338 4339 _Must_inspect_result_ 4340 _IRQL_requires_max_(DISPATCH_LEVEL) 4341 WDFAPI 4342 NTSTATUS 4343 VFWDFEXPORT(WdfUsbTargetDeviceFormatRequestForString)( 4344 _In_ 4345 PWDF_DRIVER_GLOBALS DriverGlobals, 4346 _In_ 4347 WDFUSBDEVICE UsbDevice, 4348 _In_ 4349 WDFREQUEST Request, 4350 _In_ 4351 WDFMEMORY Memory, 4352 _In_opt_ 4353 PWDFMEMORY_OFFSET Offset, 4354 _In_ 4355 UCHAR StringIndex, 4356 _In_opt_ 4357 USHORT LangID 4358 ) 4359 { 4360 PAGED_CODE_LOCKED(); 4361 return ((PFN_WDFUSBTARGETDEVICEFORMATREQUESTFORSTRING) WdfVersion.Functions.pfnWdfUsbTargetDeviceFormatRequestForString)(DriverGlobals, UsbDevice, Request, Memory, Offset, StringIndex, LangID); 4362 } 4363 4364 _IRQL_requires_max_(DISPATCH_LEVEL) 4365 WDFAPI 4366 UCHAR 4367 VFWDFEXPORT(WdfUsbTargetDeviceGetNumInterfaces)( 4368 _In_ 4369 PWDF_DRIVER_GLOBALS DriverGlobals, 4370 _In_ 4371 WDFUSBDEVICE UsbDevice 4372 ) 4373 { 4374 PAGED_CODE_LOCKED(); 4375 return ((PFN_WDFUSBTARGETDEVICEGETNUMINTERFACES) WdfVersion.Functions.pfnWdfUsbTargetDeviceGetNumInterfaces)(DriverGlobals, UsbDevice); 4376 } 4377 4378 _Must_inspect_result_ 4379 _IRQL_requires_max_(PASSIVE_LEVEL) 4380 WDFAPI 4381 NTSTATUS 4382 VFWDFEXPORT(WdfUsbTargetDeviceSelectConfig)( 4383 _In_ 4384 PWDF_DRIVER_GLOBALS DriverGlobals, 4385 _In_ 4386 WDFUSBDEVICE UsbDevice, 4387 _In_opt_ 4388 PWDF_OBJECT_ATTRIBUTES PipeAttributes, 4389 _Inout_ 4390 PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params 4391 ) 4392 { 4393 PAGED_CODE_LOCKED(); 4394 return ((PFN_WDFUSBTARGETDEVICESELECTCONFIG) WdfVersion.Functions.pfnWdfUsbTargetDeviceSelectConfig)(DriverGlobals, UsbDevice, PipeAttributes, Params); 4395 } 4396 4397 _Must_inspect_result_ 4398 _IRQL_requires_max_(PASSIVE_LEVEL) 4399 WDFAPI 4400 NTSTATUS 4401 VFWDFEXPORT(WdfUsbTargetDeviceSendControlTransferSynchronously)( 4402 _In_ 4403 PWDF_DRIVER_GLOBALS DriverGlobals, 4404 _In_ 4405 WDFUSBDEVICE UsbDevice, 4406 _In_opt_ 4407 WDFREQUEST Request, 4408 _In_opt_ 4409 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 4410 _In_ 4411 PWDF_USB_CONTROL_SETUP_PACKET SetupPacket, 4412 _In_opt_ 4413 PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, 4414 _Out_opt_ 4415 PULONG BytesTransferred 4416 ) 4417 { 4418 PAGED_CODE_LOCKED(); 4419 return ((PFN_WDFUSBTARGETDEVICESENDCONTROLTRANSFERSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfUsbTargetDeviceSendControlTransferSynchronously)(DriverGlobals, UsbDevice, Request, RequestOptions, SetupPacket, MemoryDescriptor, BytesTransferred); 4420 } 4421 4422 _Must_inspect_result_ 4423 _IRQL_requires_max_(DISPATCH_LEVEL) 4424 WDFAPI 4425 NTSTATUS 4426 VFWDFEXPORT(WdfUsbTargetDeviceFormatRequestForControlTransfer)( 4427 _In_ 4428 PWDF_DRIVER_GLOBALS DriverGlobals, 4429 _In_ 4430 WDFUSBDEVICE UsbDevice, 4431 _In_ 4432 WDFREQUEST Request, 4433 _In_ 4434 PWDF_USB_CONTROL_SETUP_PACKET SetupPacket, 4435 _In_opt_ 4436 WDFMEMORY TransferMemory, 4437 _In_opt_ 4438 PWDFMEMORY_OFFSET TransferOffset 4439 ) 4440 { 4441 PAGED_CODE_LOCKED(); 4442 return ((PFN_WDFUSBTARGETDEVICEFORMATREQUESTFORCONTROLTRANSFER) WdfVersion.Functions.pfnWdfUsbTargetDeviceFormatRequestForControlTransfer)(DriverGlobals, UsbDevice, Request, SetupPacket, TransferMemory, TransferOffset); 4443 } 4444 4445 _Must_inspect_result_ 4446 _IRQL_requires_max_(PASSIVE_LEVEL) 4447 WDFAPI 4448 NTSTATUS 4449 VFWDFEXPORT(WdfUsbTargetDeviceResetPortSynchronously)( 4450 _In_ 4451 PWDF_DRIVER_GLOBALS DriverGlobals, 4452 _In_ 4453 WDFUSBDEVICE UsbDevice 4454 ) 4455 { 4456 PAGED_CODE_LOCKED(); 4457 return ((PFN_WDFUSBTARGETDEVICERESETPORTSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfUsbTargetDeviceResetPortSynchronously)(DriverGlobals, UsbDevice); 4458 } 4459 4460 _Must_inspect_result_ 4461 _IRQL_requires_max_(PASSIVE_LEVEL) 4462 WDFAPI 4463 NTSTATUS 4464 VFWDFEXPORT(WdfUsbTargetDeviceQueryUsbCapability)( 4465 _In_ 4466 PWDF_DRIVER_GLOBALS DriverGlobals, 4467 _In_ 4468 WDFUSBDEVICE UsbDevice, 4469 _In_ 4470 CONST GUID* CapabilityType, 4471 _In_ 4472 ULONG CapabilityBufferLength, 4473 _When_(CapabilityBufferLength == 0, _Out_opt_) 4474 _When_(CapabilityBufferLength != 0 && ResultLength == NULL, _Out_writes_bytes_(CapabilityBufferLength)) 4475 _When_(CapabilityBufferLength != 0 && ResultLength != NULL, _Out_writes_bytes_to_opt_(CapabilityBufferLength, *ResultLength)) 4476 PVOID CapabilityBuffer, 4477 _Out_opt_ 4478 _When_(ResultLength != NULL,_Deref_out_range_(<=,CapabilityBufferLength)) 4479 PULONG ResultLength 4480 ) 4481 { 4482 PAGED_CODE_LOCKED(); 4483 return ((PFN_WDFUSBTARGETDEVICEQUERYUSBCAPABILITY) WdfVersion.Functions.pfnWdfUsbTargetDeviceQueryUsbCapability)(DriverGlobals, UsbDevice, CapabilityType, CapabilityBufferLength, CapabilityBuffer, ResultLength); 4484 } 4485 4486 _IRQL_requires_max_(DISPATCH_LEVEL) 4487 WDFAPI 4488 VOID 4489 VFWDFEXPORT(WdfUsbTargetPipeGetInformation)( 4490 _In_ 4491 PWDF_DRIVER_GLOBALS DriverGlobals, 4492 _In_ 4493 WDFUSBPIPE Pipe, 4494 _Out_ 4495 PWDF_USB_PIPE_INFORMATION PipeInformation 4496 ) 4497 { 4498 PAGED_CODE_LOCKED(); 4499 ((PFN_WDFUSBTARGETPIPEGETINFORMATION) WdfVersion.Functions.pfnWdfUsbTargetPipeGetInformation)(DriverGlobals, Pipe, PipeInformation); 4500 } 4501 4502 _IRQL_requires_max_(DISPATCH_LEVEL) 4503 WDFAPI 4504 BOOLEAN 4505 VFWDFEXPORT(WdfUsbTargetPipeIsInEndpoint)( 4506 _In_ 4507 PWDF_DRIVER_GLOBALS DriverGlobals, 4508 _In_ 4509 WDFUSBPIPE Pipe 4510 ) 4511 { 4512 PAGED_CODE_LOCKED(); 4513 return ((PFN_WDFUSBTARGETPIPEISINENDPOINT) WdfVersion.Functions.pfnWdfUsbTargetPipeIsInEndpoint)(DriverGlobals, Pipe); 4514 } 4515 4516 _IRQL_requires_max_(DISPATCH_LEVEL) 4517 WDFAPI 4518 BOOLEAN 4519 VFWDFEXPORT(WdfUsbTargetPipeIsOutEndpoint)( 4520 _In_ 4521 PWDF_DRIVER_GLOBALS DriverGlobals, 4522 _In_ 4523 WDFUSBPIPE Pipe 4524 ) 4525 { 4526 PAGED_CODE_LOCKED(); 4527 return ((PFN_WDFUSBTARGETPIPEISOUTENDPOINT) WdfVersion.Functions.pfnWdfUsbTargetPipeIsOutEndpoint)(DriverGlobals, Pipe); 4528 } 4529 4530 _IRQL_requires_max_(DISPATCH_LEVEL) 4531 WDFAPI 4532 WDF_USB_PIPE_TYPE 4533 VFWDFEXPORT(WdfUsbTargetPipeGetType)( 4534 _In_ 4535 PWDF_DRIVER_GLOBALS DriverGlobals, 4536 _In_ 4537 WDFUSBPIPE Pipe 4538 ) 4539 { 4540 PAGED_CODE_LOCKED(); 4541 return ((PFN_WDFUSBTARGETPIPEGETTYPE) WdfVersion.Functions.pfnWdfUsbTargetPipeGetType)(DriverGlobals, Pipe); 4542 } 4543 4544 _IRQL_requires_max_(DISPATCH_LEVEL) 4545 WDFAPI 4546 VOID 4547 VFWDFEXPORT(WdfUsbTargetPipeSetNoMaximumPacketSizeCheck)( 4548 _In_ 4549 PWDF_DRIVER_GLOBALS DriverGlobals, 4550 _In_ 4551 WDFUSBPIPE Pipe 4552 ) 4553 { 4554 PAGED_CODE_LOCKED(); 4555 ((PFN_WDFUSBTARGETPIPESETNOMAXIMUMPACKETSIZECHECK) WdfVersion.Functions.pfnWdfUsbTargetPipeSetNoMaximumPacketSizeCheck)(DriverGlobals, Pipe); 4556 } 4557 4558 _Must_inspect_result_ 4559 _IRQL_requires_max_(PASSIVE_LEVEL) 4560 WDFAPI 4561 NTSTATUS 4562 VFWDFEXPORT(WdfUsbTargetPipeWriteSynchronously)( 4563 _In_ 4564 PWDF_DRIVER_GLOBALS DriverGlobals, 4565 _In_ 4566 WDFUSBPIPE Pipe, 4567 _In_opt_ 4568 WDFREQUEST Request, 4569 _In_opt_ 4570 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 4571 _In_opt_ 4572 PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, 4573 _Out_opt_ 4574 PULONG BytesWritten 4575 ) 4576 { 4577 PAGED_CODE_LOCKED(); 4578 return ((PFN_WDFUSBTARGETPIPEWRITESYNCHRONOUSLY) WdfVersion.Functions.pfnWdfUsbTargetPipeWriteSynchronously)(DriverGlobals, Pipe, Request, RequestOptions, MemoryDescriptor, BytesWritten); 4579 } 4580 4581 _Must_inspect_result_ 4582 _IRQL_requires_max_(DISPATCH_LEVEL) 4583 WDFAPI 4584 NTSTATUS 4585 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForWrite)( 4586 _In_ 4587 PWDF_DRIVER_GLOBALS DriverGlobals, 4588 _In_ 4589 WDFUSBPIPE Pipe, 4590 _In_ 4591 WDFREQUEST Request, 4592 _In_opt_ 4593 WDFMEMORY WriteMemory, 4594 _In_opt_ 4595 PWDFMEMORY_OFFSET WriteOffset 4596 ) 4597 { 4598 PAGED_CODE_LOCKED(); 4599 return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORWRITE) WdfVersion.Functions.pfnWdfUsbTargetPipeFormatRequestForWrite)(DriverGlobals, Pipe, Request, WriteMemory, WriteOffset); 4600 } 4601 4602 _Must_inspect_result_ 4603 _IRQL_requires_max_(PASSIVE_LEVEL) 4604 WDFAPI 4605 NTSTATUS 4606 VFWDFEXPORT(WdfUsbTargetPipeReadSynchronously)( 4607 _In_ 4608 PWDF_DRIVER_GLOBALS DriverGlobals, 4609 _In_ 4610 WDFUSBPIPE Pipe, 4611 _In_opt_ 4612 WDFREQUEST Request, 4613 _In_opt_ 4614 PWDF_REQUEST_SEND_OPTIONS RequestOptions, 4615 _In_opt_ 4616 PWDF_MEMORY_DESCRIPTOR MemoryDescriptor, 4617 _Out_opt_ 4618 PULONG BytesRead 4619 ) 4620 { 4621 PAGED_CODE_LOCKED(); 4622 return ((PFN_WDFUSBTARGETPIPEREADSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfUsbTargetPipeReadSynchronously)(DriverGlobals, Pipe, Request, RequestOptions, MemoryDescriptor, BytesRead); 4623 } 4624 4625 _Must_inspect_result_ 4626 _IRQL_requires_max_(DISPATCH_LEVEL) 4627 WDFAPI 4628 NTSTATUS 4629 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForRead)( 4630 _In_ 4631 PWDF_DRIVER_GLOBALS DriverGlobals, 4632 _In_ 4633 WDFUSBPIPE Pipe, 4634 _In_ 4635 WDFREQUEST Request, 4636 _In_opt_ 4637 WDFMEMORY ReadMemory, 4638 _In_opt_ 4639 PWDFMEMORY_OFFSET ReadOffset 4640 ) 4641 { 4642 PAGED_CODE_LOCKED(); 4643 return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORREAD) WdfVersion.Functions.pfnWdfUsbTargetPipeFormatRequestForRead)(DriverGlobals, Pipe, Request, ReadMemory, ReadOffset); 4644 } 4645 4646 _Must_inspect_result_ 4647 _IRQL_requires_max_(DISPATCH_LEVEL) 4648 WDFAPI 4649 NTSTATUS 4650 VFWDFEXPORT(WdfUsbTargetPipeConfigContinuousReader)( 4651 _In_ 4652 PWDF_DRIVER_GLOBALS DriverGlobals, 4653 _In_ 4654 WDFUSBPIPE Pipe, 4655 _In_ 4656 PWDF_USB_CONTINUOUS_READER_CONFIG Config 4657 ) 4658 { 4659 PAGED_CODE_LOCKED(); 4660 return ((PFN_WDFUSBTARGETPIPECONFIGCONTINUOUSREADER) WdfVersion.Functions.pfnWdfUsbTargetPipeConfigContinuousReader)(DriverGlobals, Pipe, Config); 4661 } 4662 4663 _Must_inspect_result_ 4664 _IRQL_requires_max_(PASSIVE_LEVEL) 4665 WDFAPI 4666 NTSTATUS 4667 VFWDFEXPORT(WdfUsbTargetPipeAbortSynchronously)( 4668 _In_ 4669 PWDF_DRIVER_GLOBALS DriverGlobals, 4670 _In_ 4671 WDFUSBPIPE Pipe, 4672 _In_opt_ 4673 WDFREQUEST Request, 4674 _In_opt_ 4675 PWDF_REQUEST_SEND_OPTIONS RequestOptions 4676 ) 4677 { 4678 PAGED_CODE_LOCKED(); 4679 return ((PFN_WDFUSBTARGETPIPEABORTSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfUsbTargetPipeAbortSynchronously)(DriverGlobals, Pipe, Request, RequestOptions); 4680 } 4681 4682 _Must_inspect_result_ 4683 _IRQL_requires_max_(DISPATCH_LEVEL) 4684 WDFAPI 4685 NTSTATUS 4686 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForAbort)( 4687 _In_ 4688 PWDF_DRIVER_GLOBALS DriverGlobals, 4689 _In_ 4690 WDFUSBPIPE Pipe, 4691 _In_ 4692 WDFREQUEST Request 4693 ) 4694 { 4695 PAGED_CODE_LOCKED(); 4696 return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORABORT) WdfVersion.Functions.pfnWdfUsbTargetPipeFormatRequestForAbort)(DriverGlobals, Pipe, Request); 4697 } 4698 4699 _Must_inspect_result_ 4700 _IRQL_requires_max_(PASSIVE_LEVEL) 4701 WDFAPI 4702 NTSTATUS 4703 VFWDFEXPORT(WdfUsbTargetPipeResetSynchronously)( 4704 _In_ 4705 PWDF_DRIVER_GLOBALS DriverGlobals, 4706 _In_ 4707 WDFUSBPIPE Pipe, 4708 _In_opt_ 4709 WDFREQUEST Request, 4710 _In_opt_ 4711 PWDF_REQUEST_SEND_OPTIONS RequestOptions 4712 ) 4713 { 4714 PAGED_CODE_LOCKED(); 4715 return ((PFN_WDFUSBTARGETPIPERESETSYNCHRONOUSLY) WdfVersion.Functions.pfnWdfUsbTargetPipeResetSynchronously)(DriverGlobals, Pipe, Request, RequestOptions); 4716 } 4717 4718 _Must_inspect_result_ 4719 _IRQL_requires_max_(DISPATCH_LEVEL) 4720 WDFAPI 4721 NTSTATUS 4722 VFWDFEXPORT(WdfUsbTargetPipeFormatRequestForReset)( 4723 _In_ 4724 PWDF_DRIVER_GLOBALS DriverGlobals, 4725 _In_ 4726 WDFUSBPIPE Pipe, 4727 _In_ 4728 WDFREQUEST Request 4729 ) 4730 { 4731 PAGED_CODE_LOCKED(); 4732 return ((PFN_WDFUSBTARGETPIPEFORMATREQUESTFORRESET) WdfVersion.Functions.pfnWdfUsbTargetPipeFormatRequestForReset)(DriverGlobals, Pipe, Request); 4733 } 4734 4735 _IRQL_requires_max_(DISPATCH_LEVEL) 4736 WDFAPI 4737 BYTE 4738 VFWDFEXPORT(WdfUsbInterfaceGetInterfaceNumber)( 4739 _In_ 4740 PWDF_DRIVER_GLOBALS DriverGlobals, 4741 _In_ 4742 WDFUSBINTERFACE UsbInterface 4743 ) 4744 { 4745 PAGED_CODE_LOCKED(); 4746 return ((PFN_WDFUSBINTERFACEGETINTERFACENUMBER) WdfVersion.Functions.pfnWdfUsbInterfaceGetInterfaceNumber)(DriverGlobals, UsbInterface); 4747 } 4748 4749 _IRQL_requires_max_(DISPATCH_LEVEL) 4750 WDFAPI 4751 BYTE 4752 VFWDFEXPORT(WdfUsbInterfaceGetNumEndpoints)( 4753 _In_ 4754 PWDF_DRIVER_GLOBALS DriverGlobals, 4755 _In_ 4756 WDFUSBINTERFACE UsbInterface, 4757 _In_ 4758 UCHAR SettingIndex 4759 ) 4760 { 4761 PAGED_CODE_LOCKED(); 4762 return ((PFN_WDFUSBINTERFACEGETNUMENDPOINTS) WdfVersion.Functions.pfnWdfUsbInterfaceGetNumEndpoints)(DriverGlobals, UsbInterface, SettingIndex); 4763 } 4764 4765 _IRQL_requires_max_(DISPATCH_LEVEL) 4766 WDFAPI 4767 VOID 4768 VFWDFEXPORT(WdfUsbInterfaceGetDescriptor)( 4769 _In_ 4770 PWDF_DRIVER_GLOBALS DriverGlobals, 4771 _In_ 4772 WDFUSBINTERFACE UsbInterface, 4773 _In_ 4774 UCHAR SettingIndex, 4775 _Out_ 4776 PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor 4777 ) 4778 { 4779 PAGED_CODE_LOCKED(); 4780 ((PFN_WDFUSBINTERFACEGETDESCRIPTOR) WdfVersion.Functions.pfnWdfUsbInterfaceGetDescriptor)(DriverGlobals, UsbInterface, SettingIndex, InterfaceDescriptor); 4781 } 4782 4783 _IRQL_requires_max_(DISPATCH_LEVEL) 4784 WDFAPI 4785 BYTE 4786 VFWDFEXPORT(WdfUsbInterfaceGetNumSettings)( 4787 _In_ 4788 PWDF_DRIVER_GLOBALS DriverGlobals, 4789 _In_ 4790 WDFUSBINTERFACE UsbInterface 4791 ) 4792 { 4793 PAGED_CODE_LOCKED(); 4794 return ((PFN_WDFUSBINTERFACEGETNUMSETTINGS) WdfVersion.Functions.pfnWdfUsbInterfaceGetNumSettings)(DriverGlobals, UsbInterface); 4795 } 4796 4797 _Must_inspect_result_ 4798 _IRQL_requires_max_(PASSIVE_LEVEL) 4799 WDFAPI 4800 NTSTATUS 4801 VFWDFEXPORT(WdfUsbInterfaceSelectSetting)( 4802 _In_ 4803 PWDF_DRIVER_GLOBALS DriverGlobals, 4804 _In_ 4805 WDFUSBINTERFACE UsbInterface, 4806 _In_opt_ 4807 PWDF_OBJECT_ATTRIBUTES PipesAttributes, 4808 _In_ 4809 PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params 4810 ) 4811 { 4812 PAGED_CODE_LOCKED(); 4813 return ((PFN_WDFUSBINTERFACESELECTSETTING) WdfVersion.Functions.pfnWdfUsbInterfaceSelectSetting)(DriverGlobals, UsbInterface, PipesAttributes, Params); 4814 } 4815 4816 _IRQL_requires_max_(DISPATCH_LEVEL) 4817 WDFAPI 4818 VOID 4819 VFWDFEXPORT(WdfUsbInterfaceGetEndpointInformation)( 4820 _In_ 4821 PWDF_DRIVER_GLOBALS DriverGlobals, 4822 _In_ 4823 WDFUSBINTERFACE UsbInterface, 4824 _In_ 4825 UCHAR SettingIndex, 4826 _In_ 4827 UCHAR EndpointIndex, 4828 _Out_ 4829 PWDF_USB_PIPE_INFORMATION EndpointInfo 4830 ) 4831 { 4832 PAGED_CODE_LOCKED(); 4833 ((PFN_WDFUSBINTERFACEGETENDPOINTINFORMATION) WdfVersion.Functions.pfnWdfUsbInterfaceGetEndpointInformation)(DriverGlobals, UsbInterface, SettingIndex, EndpointIndex, EndpointInfo); 4834 } 4835 4836 _IRQL_requires_max_(DISPATCH_LEVEL) 4837 WDFAPI 4838 WDFUSBINTERFACE 4839 VFWDFEXPORT(WdfUsbTargetDeviceGetInterface)( 4840 _In_ 4841 PWDF_DRIVER_GLOBALS DriverGlobals, 4842 _In_ 4843 WDFUSBDEVICE UsbDevice, 4844 _In_ 4845 UCHAR InterfaceIndex 4846 ) 4847 { 4848 PAGED_CODE_LOCKED(); 4849 return ((PFN_WDFUSBTARGETDEVICEGETINTERFACE) WdfVersion.Functions.pfnWdfUsbTargetDeviceGetInterface)(DriverGlobals, UsbDevice, InterfaceIndex); 4850 } 4851 4852 _IRQL_requires_max_(DISPATCH_LEVEL) 4853 WDFAPI 4854 BYTE 4855 VFWDFEXPORT(WdfUsbInterfaceGetConfiguredSettingIndex)( 4856 _In_ 4857 PWDF_DRIVER_GLOBALS DriverGlobals, 4858 _In_ 4859 WDFUSBINTERFACE Interface 4860 ) 4861 { 4862 PAGED_CODE_LOCKED(); 4863 return ((PFN_WDFUSBINTERFACEGETCONFIGUREDSETTINGINDEX) WdfVersion.Functions.pfnWdfUsbInterfaceGetConfiguredSettingIndex)(DriverGlobals, Interface); 4864 } 4865 4866 _IRQL_requires_max_(DISPATCH_LEVEL) 4867 WDFAPI 4868 BYTE 4869 VFWDFEXPORT(WdfUsbInterfaceGetNumConfiguredPipes)( 4870 _In_ 4871 PWDF_DRIVER_GLOBALS DriverGlobals, 4872 _In_ 4873 WDFUSBINTERFACE UsbInterface 4874 ) 4875 { 4876 PAGED_CODE_LOCKED(); 4877 return ((PFN_WDFUSBINTERFACEGETNUMCONFIGUREDPIPES) WdfVersion.Functions.pfnWdfUsbInterfaceGetNumConfiguredPipes)(DriverGlobals, UsbInterface); 4878 } 4879 4880 _IRQL_requires_max_(DISPATCH_LEVEL) 4881 WDFAPI 4882 WDFUSBPIPE 4883 VFWDFEXPORT(WdfUsbInterfaceGetConfiguredPipe)( 4884 _In_ 4885 PWDF_DRIVER_GLOBALS DriverGlobals, 4886 _In_ 4887 WDFUSBINTERFACE UsbInterface, 4888 _In_ 4889 UCHAR PipeIndex, 4890 _Out_opt_ 4891 PWDF_USB_PIPE_INFORMATION PipeInfo 4892 ) 4893 { 4894 PAGED_CODE_LOCKED(); 4895 return ((PFN_WDFUSBINTERFACEGETCONFIGUREDPIPE) WdfVersion.Functions.pfnWdfUsbInterfaceGetConfiguredPipe)(DriverGlobals, UsbInterface, PipeIndex, PipeInfo); 4896 } 4897 4898 WDFAPI 4899 VOID 4900 VFWDFEXPORT(WdfVerifierDbgBreakPoint)( 4901 _In_ 4902 PWDF_DRIVER_GLOBALS DriverGlobals 4903 ) 4904 { 4905 PAGED_CODE_LOCKED(); 4906 ((PFN_WDFVERIFIERDBGBREAKPOINT) WdfVersion.Functions.pfnWdfVerifierDbgBreakPoint)(DriverGlobals); 4907 } 4908 4909 WDFAPI 4910 VOID 4911 VFWDFEXPORT(WdfVerifierKeBugCheck)( 4912 _In_ 4913 PWDF_DRIVER_GLOBALS DriverGlobals, 4914 _In_ 4915 ULONG BugCheckCode, 4916 _In_ 4917 ULONG_PTR BugCheckParameter1, 4918 _In_ 4919 ULONG_PTR BugCheckParameter2, 4920 _In_ 4921 ULONG_PTR BugCheckParameter3, 4922 _In_ 4923 ULONG_PTR BugCheckParameter4 4924 ) 4925 { 4926 PAGED_CODE_LOCKED(); 4927 ((PFN_WDFVERIFIERKEBUGCHECK) WdfVersion.Functions.pfnWdfVerifierKeBugCheck)(DriverGlobals, BugCheckCode, BugCheckParameter1, BugCheckParameter2, BugCheckParameter3, BugCheckParameter4); 4928 } 4929 4930 WDFAPI 4931 PVOID 4932 VFWDFEXPORT(WdfGetTriageInfo)( 4933 _In_ 4934 PWDF_DRIVER_GLOBALS DriverGlobals 4935 ) 4936 { 4937 PAGED_CODE_LOCKED(); 4938 return ((PFN_WDFGETTRIAGEINFO) WdfVersion.Functions.pfnWdfGetTriageInfo)(DriverGlobals); 4939 } 4940 4941 _Must_inspect_result_ 4942 _IRQL_requires_max_(DISPATCH_LEVEL) 4943 WDFAPI 4944 NTSTATUS 4945 VFWDFEXPORT(WdfWorkItemCreate)( 4946 _In_ 4947 PWDF_DRIVER_GLOBALS DriverGlobals, 4948 _In_ 4949 PWDF_WORKITEM_CONFIG Config, 4950 _In_ 4951 PWDF_OBJECT_ATTRIBUTES Attributes, 4952 _Out_ 4953 WDFWORKITEM* WorkItem 4954 ) 4955 { 4956 PAGED_CODE_LOCKED(); 4957 return ((PFN_WDFWORKITEMCREATE) WdfVersion.Functions.pfnWdfWorkItemCreate)(DriverGlobals, Config, Attributes, WorkItem); 4958 } 4959 4960 _IRQL_requires_max_(DISPATCH_LEVEL) 4961 WDFAPI 4962 VOID 4963 VFWDFEXPORT(WdfWorkItemEnqueue)( 4964 _In_ 4965 PWDF_DRIVER_GLOBALS DriverGlobals, 4966 _In_ 4967 WDFWORKITEM WorkItem 4968 ) 4969 { 4970 PAGED_CODE_LOCKED(); 4971 ((PFN_WDFWORKITEMENQUEUE) WdfVersion.Functions.pfnWdfWorkItemEnqueue)(DriverGlobals, WorkItem); 4972 } 4973 4974 _IRQL_requires_max_(DISPATCH_LEVEL) 4975 WDFAPI 4976 WDFOBJECT 4977 VFWDFEXPORT(WdfWorkItemGetParentObject)( 4978 _In_ 4979 PWDF_DRIVER_GLOBALS DriverGlobals, 4980 _In_ 4981 WDFWORKITEM WorkItem 4982 ) 4983 { 4984 PAGED_CODE_LOCKED(); 4985 return ((PFN_WDFWORKITEMGETPARENTOBJECT) WdfVersion.Functions.pfnWdfWorkItemGetParentObject)(DriverGlobals, WorkItem); 4986 } 4987 4988 _IRQL_requires_max_(PASSIVE_LEVEL) 4989 WDFAPI 4990 VOID 4991 VFWDFEXPORT(WdfWorkItemFlush)( 4992 _In_ 4993 PWDF_DRIVER_GLOBALS DriverGlobals, 4994 _In_ 4995 WDFWORKITEM WorkItem 4996 ) 4997 { 4998 PAGED_CODE_LOCKED(); 4999 ((PFN_WDFWORKITEMFLUSH) WdfVersion.Functions.pfnWdfWorkItemFlush)(DriverGlobals, WorkItem); 5000 } 5001 5002 5003