1 /*++ 2 3 Copyright (c) Microsoft Corporation. All rights reserved. 4 5 _WdfVersionBuild_ 6 7 Module Name: 8 9 wdfinterrupt.h 10 11 Abstract: 12 13 This is the C header for driver framework Interrupt object 14 15 Revision History: 16 17 18 --*/ 19 20 // 21 // NOTE: This header is generated by stubwork. Please make any 22 // modifications to the corresponding template files 23 // (.x or .y) and use stubwork to regenerate the header 24 // 25 26 #ifndef _WDFINTERRUPT_H_ 27 #define _WDFINTERRUPT_H_ 28 29 #ifndef WDF_EXTERN_C 30 #ifdef __cplusplus 31 #define WDF_EXTERN_C extern "C" 32 #define WDF_EXTERN_C_START extern "C" { 33 #define WDF_EXTERN_C_END } 34 #else 35 #define WDF_EXTERN_C 36 #define WDF_EXTERN_C_START 37 #define WDF_EXTERN_C_END 38 #endif 39 #endif 40 41 WDF_EXTERN_C_START 42 43 44 45 #if (NTDDI_VERSION >= NTDDI_WIN2K) 46 47 // 48 // Message Signaled Interrupts (MSI) information structure 49 // 50 typedef enum _WDF_INTERRUPT_POLARITY { 51 WdfInterruptPolarityUnknown = 0, 52 WdfInterruptActiveHigh, 53 WdfInterruptActiveLow, 54 } WDF_INTERRUPT_POLARITY, *PWDF_INTERRUPT_POLARITY; 55 56 typedef enum _WDF_INTERRUPT_POLICY { 57 WdfIrqPolicyMachineDefault = 0, 58 WdfIrqPolicyAllCloseProcessors, 59 WdfIrqPolicyOneCloseProcessor, 60 WdfIrqPolicyAllProcessorsInMachine, 61 WdfIrqPolicySpecifiedProcessors, 62 WdfIrqPolicySpreadMessagesAcrossAllProcessors, 63 } WDF_INTERRUPT_POLICY, *PWDF_INTERRUPT_POLICY; 64 65 typedef enum _WDF_INTERRUPT_PRIORITY { 66 WdfIrqPriorityUndefined = 0, 67 WdfIrqPriorityLow, 68 WdfIrqPriorityNormal, 69 WdfIrqPriorityHigh, 70 } WDF_INTERRUPT_PRIORITY, *PWDF_INTERRUPT_PRIORITY; 71 72 73 74 75 // 76 // This is the function that gets invoked when the hardware ISR occurs. 77 // This function is called at the IRQL at which the interrupt is serviced: 78 // - DIRQL for DIRQL interrupt handling. 79 // - PASSIVE_LEVEL for passive-level interrupt handling. 80 // 81 typedef 82 _Function_class_(EVT_WDF_INTERRUPT_ISR) 83 _IRQL_requires_same_ 84 _IRQL_requires_min_(PASSIVE_LEVEL) 85 BOOLEAN 86 STDCALL 87 EVT_WDF_INTERRUPT_ISR( 88 _In_ 89 WDFINTERRUPT Interrupt, 90 _In_ 91 ULONG MessageID 92 ); 93 94 typedef EVT_WDF_INTERRUPT_ISR *PFN_WDF_INTERRUPT_ISR; 95 96 // 97 // This is the function that gets invoked when a Synchronize execution occurs. 98 // This function is called at the IRQL at which the interrupt is serviced: 99 // - DIRQL for DIRQL interrupt handling. 100 // - PASSIVE_LEVEL for passive-level interrupt handling. 101 // 102 typedef 103 _Function_class_(EVT_WDF_INTERRUPT_SYNCHRONIZE) 104 _IRQL_requires_same_ 105 _IRQL_requires_min_(PASSIVE_LEVEL) 106 BOOLEAN 107 STDCALL 108 EVT_WDF_INTERRUPT_SYNCHRONIZE( 109 _In_ 110 WDFINTERRUPT Interrupt, 111 _In_ 112 WDFCONTEXT Context 113 ); 114 115 typedef EVT_WDF_INTERRUPT_SYNCHRONIZE *PFN_WDF_INTERRUPT_SYNCHRONIZE; 116 117 // 118 // This is the function that gets called back into the driver 119 // when the DpcForIsr fires. It will be called at DISPATCH_LEVEL. 120 // 121 typedef 122 _Function_class_(EVT_WDF_INTERRUPT_DPC) 123 _IRQL_requires_same_ 124 _IRQL_requires_(DISPATCH_LEVEL) 125 VOID 126 STDCALL 127 EVT_WDF_INTERRUPT_DPC( 128 _In_ 129 WDFINTERRUPT Interrupt, 130 _In_ 131 WDFOBJECT AssociatedObject 132 ); 133 134 typedef EVT_WDF_INTERRUPT_DPC *PFN_WDF_INTERRUPT_DPC; 135 136 // 137 // This is the function that gets called back into the driver 138 // when the WorkItemForIsr fires. It will be called at PASSIVE_LEVEL. 139 // 140 typedef 141 _Function_class_(EVT_WDF_INTERRUPT_WORKITEM) 142 _IRQL_requires_same_ 143 _IRQL_requires_(PASSIVE_LEVEL) 144 VOID 145 STDCALL 146 EVT_WDF_INTERRUPT_WORKITEM( 147 _In_ 148 WDFINTERRUPT Interrupt, 149 _In_ 150 WDFOBJECT AssociatedObject 151 ); 152 153 typedef EVT_WDF_INTERRUPT_WORKITEM *PFN_WDF_INTERRUPT_WORKITEM; 154 155 // 156 // This is the function that gets called back into the driver 157 // to enable the interrupt in the hardware. It will be called 158 // at the same IRQL at which the interrupt will be serviced: 159 // - DIRQL for DIRQL interrupt handling. 160 // - PASSIVE_LEVEL for passive-level interrupt handling. 161 // 162 typedef 163 _Function_class_(EVT_WDF_INTERRUPT_ENABLE) 164 _IRQL_requires_same_ 165 _IRQL_requires_min_(PASSIVE_LEVEL) 166 NTSTATUS 167 STDCALL 168 EVT_WDF_INTERRUPT_ENABLE( 169 _In_ 170 WDFINTERRUPT Interrupt, 171 _In_ 172 WDFDEVICE AssociatedDevice 173 ); 174 175 typedef EVT_WDF_INTERRUPT_ENABLE *PFN_WDF_INTERRUPT_ENABLE; 176 177 // 178 // This is the function that gets called back into the driver 179 // to disable the interrupt in the hardware. It will be called 180 // at the same IRQL at which the interrupt is serviced: 181 // - DIRQL for DIRQL interrupt handling. 182 // - PASSIVE_LEVEL for passive-level interrupt handling. 183 // 184 typedef 185 _Function_class_(EVT_WDF_INTERRUPT_DISABLE) 186 _IRQL_requires_same_ 187 _IRQL_requires_min_(PASSIVE_LEVEL) 188 NTSTATUS 189 STDCALL 190 EVT_WDF_INTERRUPT_DISABLE( 191 _In_ 192 WDFINTERRUPT Interrupt, 193 _In_ 194 WDFDEVICE AssociatedDevice 195 ); 196 197 typedef EVT_WDF_INTERRUPT_DISABLE *PFN_WDF_INTERRUPT_DISABLE; 198 199 // 200 // Interrupt Configuration Structure 201 // 202 typedef struct _WDF_INTERRUPT_CONFIG { 203 ULONG Size; 204 205 // 206 // If this interrupt is to be synchronized with other interrupt(s) assigned 207 // to the same WDFDEVICE, create a WDFSPINLOCK and assign it to each of the 208 // WDFINTERRUPTs config. 209 // 210 WDFSPINLOCK SpinLock; 211 212 WDF_TRI_STATE ShareVector; 213 214 BOOLEAN FloatingSave; 215 216 // 217 // DIRQL handling: automatic serialization of the DpcForIsr/WaitItemForIsr. 218 // Passive-level handling: automatic serialization of all callbacks. 219 // 220 BOOLEAN AutomaticSerialization; 221 222 // 223 // Event Callbacks 224 // 225 PFN_WDF_INTERRUPT_ISR EvtInterruptIsr; 226 PFN_WDF_INTERRUPT_DPC EvtInterruptDpc; 227 PFN_WDF_INTERRUPT_ENABLE EvtInterruptEnable; 228 PFN_WDF_INTERRUPT_DISABLE EvtInterruptDisable; 229 PFN_WDF_INTERRUPT_WORKITEM EvtInterruptWorkItem; 230 231 // 232 // These fields are only used when interrupt is created in 233 // EvtDevicePrepareHardware callback. 234 // 235 PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw; 236 PCM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated; 237 238 // 239 // Optional passive lock for handling interrupts at passive-level. 240 // 241 WDFWAITLOCK WaitLock; 242 243 // 244 // TRUE: handle interrupt at passive-level. 245 // FALSE: handle interrupt at DIRQL level. This is the default. 246 // 247 BOOLEAN PassiveHandling; 248 249 // 250 // TRUE: Interrupt is reported inactive on explicit power down 251 // instead of disconnecting it. 252 // FALSE: Interrupt is disconnected instead of reporting inactive 253 // on explicit power down. 254 // DEFAULT: Framework decides the right value. 255 // 256 WDF_TRI_STATE ReportInactiveOnPowerDown; 257 258 // 259 // TRUE: Interrupt is used to wake the device from low-power states 260 // and when the device is armed for wake this interrupt should 261 // remain connected. 262 // FALSE: Interrupt is not used to wake the device from low-power states. 263 // This is the default. 264 // 265 BOOLEAN CanWakeDevice; 266 } WDF_INTERRUPT_CONFIG, *PWDF_INTERRUPT_CONFIG; 267 268 269 FORCEINLINE 270 VOID 271 WDF_INTERRUPT_CONFIG_INIT( 272 _Out_ PWDF_INTERRUPT_CONFIG Configuration, 273 _In_ PFN_WDF_INTERRUPT_ISR EvtInterruptIsr, 274 _In_opt_ PFN_WDF_INTERRUPT_DPC EvtInterruptDpc 275 ) 276 { 277 RtlZeroMemory(Configuration, sizeof(WDF_INTERRUPT_CONFIG)); 278 279 Configuration->Size = sizeof(WDF_INTERRUPT_CONFIG); 280 281 Configuration->ShareVector = WdfUseDefault; 282 283 Configuration->EvtInterruptIsr = EvtInterruptIsr; 284 Configuration->EvtInterruptDpc = EvtInterruptDpc; 285 286 Configuration->ReportInactiveOnPowerDown = WdfUseDefault; 287 } 288 289 290 291 292 // 293 // Disable warning C4324: structure was padded due to DECLSPEC_ALIGN 294 // This padding is intentional and necessary. 295 #ifdef _MSC_VER 296 #pragma warning(push) 297 #pragma warning(disable: 4324) 298 #endif 299 300 typedef struct _WDF_INTERRUPT_INFO { 301 // 302 // Size of this structure in bytes 303 // 304 ULONG Size; 305 ULONG64 Reserved1; 306 KAFFINITY TargetProcessorSet; 307 ULONG Reserved2; 308 ULONG MessageNumber; 309 ULONG Vector; 310 KIRQL Irql; 311 KINTERRUPT_MODE Mode; 312 WDF_INTERRUPT_POLARITY Polarity; 313 BOOLEAN MessageSignaled; 314 UCHAR ShareDisposition; //CM_SHARE_DISPOSITION 315 DECLSPEC_ALIGN(8) USHORT Group; 316 317 } WDF_INTERRUPT_INFO, *PWDF_INTERRUPT_INFO; 318 319 #ifdef _MSC_VER 320 #pragma warning(pop) 321 #endif 322 323 FORCEINLINE 324 VOID 325 WDF_INTERRUPT_INFO_INIT( 326 _Out_ PWDF_INTERRUPT_INFO Info 327 ) 328 { 329 RtlZeroMemory(Info, sizeof(WDF_INTERRUPT_INFO)); 330 Info->Size = sizeof(WDF_INTERRUPT_INFO); 331 } 332 333 // 334 // Interrupt Extended Policy Configuration Structure 335 // 336 typedef struct _WDF_INTERRUPT_EXTENDED_POLICY { 337 // 338 // Size of this structure in bytes 339 // 340 ULONG Size; 341 WDF_INTERRUPT_POLICY Policy; 342 WDF_INTERRUPT_PRIORITY Priority; 343 GROUP_AFFINITY TargetProcessorSetAndGroup; 344 345 } WDF_INTERRUPT_EXTENDED_POLICY, *PWDF_INTERRUPT_EXTENDED_POLICY; 346 347 FORCEINLINE 348 VOID 349 WDF_INTERRUPT_EXTENDED_POLICY_INIT( 350 _Out_ PWDF_INTERRUPT_EXTENDED_POLICY ExtendedPolicy 351 ) 352 { 353 RtlZeroMemory(ExtendedPolicy, sizeof(WDF_INTERRUPT_EXTENDED_POLICY)); 354 ExtendedPolicy->Size = sizeof(WDF_INTERRUPT_EXTENDED_POLICY); 355 ExtendedPolicy->Policy = WdfIrqPolicyMachineDefault; 356 ExtendedPolicy->Priority = WdfIrqPriorityUndefined; 357 } 358 359 360 // 361 // WDF Function: WdfInterruptCreate 362 // 363 typedef 364 _Must_inspect_result_ 365 _IRQL_requires_max_(DISPATCH_LEVEL) 366 WDFAPI 367 NTSTATUS 368 (STDCALL *PFN_WDFINTERRUPTCREATE)( 369 _In_ 370 PWDF_DRIVER_GLOBALS DriverGlobals, 371 _In_ 372 WDFDEVICE Device, 373 _In_ 374 PWDF_INTERRUPT_CONFIG Configuration, 375 _In_opt_ 376 PWDF_OBJECT_ATTRIBUTES Attributes, 377 _Out_ 378 WDFINTERRUPT* Interrupt 379 ); 380 381 _Must_inspect_result_ 382 _IRQL_requires_max_(DISPATCH_LEVEL) 383 FORCEINLINE 384 NTSTATUS 385 WdfInterruptCreate( 386 _In_ 387 WDFDEVICE Device, 388 _In_ 389 PWDF_INTERRUPT_CONFIG Configuration, 390 _In_opt_ 391 PWDF_OBJECT_ATTRIBUTES Attributes, 392 _Out_ 393 WDFINTERRUPT* Interrupt 394 ) 395 { 396 return ((PFN_WDFINTERRUPTCREATE) WdfFunctions[WdfInterruptCreateTableIndex])(WdfDriverGlobals, Device, Configuration, Attributes, Interrupt); 397 } 398 399 // 400 // WDF Function: WdfInterruptQueueDpcForIsr 401 // 402 typedef 403 WDFAPI 404 BOOLEAN 405 (STDCALL *PFN_WDFINTERRUPTQUEUEDPCFORISR)( 406 _In_ 407 PWDF_DRIVER_GLOBALS DriverGlobals, 408 _In_ 409 WDFINTERRUPT Interrupt 410 ); 411 412 FORCEINLINE 413 BOOLEAN 414 WdfInterruptQueueDpcForIsr( 415 _In_ 416 WDFINTERRUPT Interrupt 417 ) 418 { 419 return ((PFN_WDFINTERRUPTQUEUEDPCFORISR) WdfFunctions[WdfInterruptQueueDpcForIsrTableIndex])(WdfDriverGlobals, Interrupt); 420 } 421 422 // 423 // WDF Function: WdfInterruptQueueWorkItemForIsr 424 // 425 typedef 426 WDFAPI 427 BOOLEAN 428 (STDCALL *PFN_WDFINTERRUPTQUEUEWORKITEMFORISR)( 429 _In_ 430 PWDF_DRIVER_GLOBALS DriverGlobals, 431 _In_ 432 WDFINTERRUPT Interrupt 433 ); 434 435 FORCEINLINE 436 BOOLEAN 437 WdfInterruptQueueWorkItemForIsr( 438 _In_ 439 WDFINTERRUPT Interrupt 440 ) 441 { 442 return ((PFN_WDFINTERRUPTQUEUEWORKITEMFORISR) WdfFunctions[WdfInterruptQueueWorkItemForIsrTableIndex])(WdfDriverGlobals, Interrupt); 443 } 444 445 // 446 // WDF Function: WdfInterruptSynchronize 447 // 448 typedef 449 _IRQL_requires_max_(DISPATCH_LEVEL) 450 WDFAPI 451 BOOLEAN 452 (STDCALL *PFN_WDFINTERRUPTSYNCHRONIZE)( 453 _In_ 454 PWDF_DRIVER_GLOBALS DriverGlobals, 455 _In_ 456 WDFINTERRUPT Interrupt, 457 _In_ 458 PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, 459 _In_ 460 WDFCONTEXT Context 461 ); 462 463 _IRQL_requires_max_(DISPATCH_LEVEL) 464 FORCEINLINE 465 BOOLEAN 466 WdfInterruptSynchronize( 467 _In_ 468 WDFINTERRUPT Interrupt, 469 _In_ 470 PFN_WDF_INTERRUPT_SYNCHRONIZE Callback, 471 _In_ 472 WDFCONTEXT Context 473 ) 474 { 475 return ((PFN_WDFINTERRUPTSYNCHRONIZE) WdfFunctions[WdfInterruptSynchronizeTableIndex])(WdfDriverGlobals, Interrupt, Callback, Context); 476 } 477 478 // 479 // WDF Function: WdfInterruptAcquireLock 480 // 481 typedef 482 _IRQL_requires_max_(DISPATCH_LEVEL + 1) 483 WDFAPI 484 VOID 485 (STDCALL *PFN_WDFINTERRUPTACQUIRELOCK)( 486 _In_ 487 PWDF_DRIVER_GLOBALS DriverGlobals, 488 _In_ 489 _Requires_lock_not_held_(_Curr_) 490 _Acquires_lock_(_Curr_) 491 WDFINTERRUPT Interrupt 492 ); 493 494 _IRQL_requires_max_(DISPATCH_LEVEL + 1) 495 FORCEINLINE 496 VOID 497 WdfInterruptAcquireLock( 498 _In_ 499 _Requires_lock_not_held_(_Curr_) 500 _Acquires_lock_(_Curr_) 501 WDFINTERRUPT Interrupt 502 ) 503 { 504 ((PFN_WDFINTERRUPTACQUIRELOCK) WdfFunctions[WdfInterruptAcquireLockTableIndex])(WdfDriverGlobals, Interrupt); 505 } 506 507 // 508 // WDF Function: WdfInterruptReleaseLock 509 // 510 typedef 511 _IRQL_requires_max_(DISPATCH_LEVEL + 1) 512 WDFAPI 513 VOID 514 (STDCALL *PFN_WDFINTERRUPTRELEASELOCK)( 515 _In_ 516 PWDF_DRIVER_GLOBALS DriverGlobals, 517 _In_ 518 _Requires_lock_held_(_Curr_) 519 _Releases_lock_(_Curr_) 520 WDFINTERRUPT Interrupt 521 ); 522 523 _IRQL_requires_max_(DISPATCH_LEVEL + 1) 524 FORCEINLINE 525 VOID 526 WdfInterruptReleaseLock( 527 _In_ 528 _Requires_lock_held_(_Curr_) 529 _Releases_lock_(_Curr_) 530 WDFINTERRUPT Interrupt 531 ) 532 { 533 ((PFN_WDFINTERRUPTRELEASELOCK) WdfFunctions[WdfInterruptReleaseLockTableIndex])(WdfDriverGlobals, Interrupt); 534 } 535 536 // 537 // WDF Function: WdfInterruptEnable 538 // 539 typedef 540 _IRQL_requires_max_(PASSIVE_LEVEL) 541 WDFAPI 542 VOID 543 (STDCALL *PFN_WDFINTERRUPTENABLE)( 544 _In_ 545 PWDF_DRIVER_GLOBALS DriverGlobals, 546 _In_ 547 WDFINTERRUPT Interrupt 548 ); 549 550 _IRQL_requires_max_(PASSIVE_LEVEL) 551 FORCEINLINE 552 VOID 553 WdfInterruptEnable( 554 _In_ 555 WDFINTERRUPT Interrupt 556 ) 557 { 558 ((PFN_WDFINTERRUPTENABLE) WdfFunctions[WdfInterruptEnableTableIndex])(WdfDriverGlobals, Interrupt); 559 } 560 561 // 562 // WDF Function: WdfInterruptDisable 563 // 564 typedef 565 _IRQL_requires_max_(PASSIVE_LEVEL) 566 WDFAPI 567 VOID 568 (STDCALL *PFN_WDFINTERRUPTDISABLE)( 569 _In_ 570 PWDF_DRIVER_GLOBALS DriverGlobals, 571 _In_ 572 WDFINTERRUPT Interrupt 573 ); 574 575 _IRQL_requires_max_(PASSIVE_LEVEL) 576 FORCEINLINE 577 VOID 578 WdfInterruptDisable( 579 _In_ 580 WDFINTERRUPT Interrupt 581 ) 582 { 583 ((PFN_WDFINTERRUPTDISABLE) WdfFunctions[WdfInterruptDisableTableIndex])(WdfDriverGlobals, Interrupt); 584 } 585 586 // 587 // WDF Function: WdfInterruptWdmGetInterrupt 588 // 589 typedef 590 _Must_inspect_result_ 591 WDFAPI 592 PKINTERRUPT 593 (STDCALL *PFN_WDFINTERRUPTWDMGETINTERRUPT)( 594 _In_ 595 PWDF_DRIVER_GLOBALS DriverGlobals, 596 _In_ 597 WDFINTERRUPT Interrupt 598 ); 599 600 _Must_inspect_result_ 601 FORCEINLINE 602 PKINTERRUPT 603 WdfInterruptWdmGetInterrupt( 604 _In_ 605 WDFINTERRUPT Interrupt 606 ) 607 { 608 return ((PFN_WDFINTERRUPTWDMGETINTERRUPT) WdfFunctions[WdfInterruptWdmGetInterruptTableIndex])(WdfDriverGlobals, Interrupt); 609 } 610 611 // 612 // WDF Function: WdfInterruptGetInfo 613 // 614 typedef 615 _IRQL_requires_max_(DISPATCH_LEVEL) 616 WDFAPI 617 VOID 618 (STDCALL *PFN_WDFINTERRUPTGETINFO)( 619 _In_ 620 PWDF_DRIVER_GLOBALS DriverGlobals, 621 _In_ 622 WDFINTERRUPT Interrupt, 623 _Out_ 624 PWDF_INTERRUPT_INFO Info 625 ); 626 627 _IRQL_requires_max_(DISPATCH_LEVEL) 628 FORCEINLINE 629 VOID 630 WdfInterruptGetInfo( 631 _In_ 632 WDFINTERRUPT Interrupt, 633 _Out_ 634 PWDF_INTERRUPT_INFO Info 635 ) 636 { 637 ((PFN_WDFINTERRUPTGETINFO) WdfFunctions[WdfInterruptGetInfoTableIndex])(WdfDriverGlobals, Interrupt, Info); 638 } 639 640 // 641 // WDF Function: WdfInterruptSetPolicy 642 // 643 typedef 644 _IRQL_requires_max_(DISPATCH_LEVEL) 645 WDFAPI 646 VOID 647 (STDCALL *PFN_WDFINTERRUPTSETPOLICY)( 648 _In_ 649 PWDF_DRIVER_GLOBALS DriverGlobals, 650 _In_ 651 WDFINTERRUPT Interrupt, 652 _In_ 653 WDF_INTERRUPT_POLICY Policy, 654 _In_ 655 WDF_INTERRUPT_PRIORITY Priority, 656 _In_ 657 KAFFINITY TargetProcessorSet 658 ); 659 660 _IRQL_requires_max_(DISPATCH_LEVEL) 661 FORCEINLINE 662 VOID 663 WdfInterruptSetPolicy( 664 _In_ 665 WDFINTERRUPT Interrupt, 666 _In_ 667 WDF_INTERRUPT_POLICY Policy, 668 _In_ 669 WDF_INTERRUPT_PRIORITY Priority, 670 _In_ 671 KAFFINITY TargetProcessorSet 672 ) 673 { 674 ((PFN_WDFINTERRUPTSETPOLICY) WdfFunctions[WdfInterruptSetPolicyTableIndex])(WdfDriverGlobals, Interrupt, Policy, Priority, TargetProcessorSet); 675 } 676 677 // 678 // WDF Function: WdfInterruptSetExtendedPolicy 679 // 680 typedef 681 _IRQL_requires_max_(DISPATCH_LEVEL) 682 WDFAPI 683 VOID 684 (STDCALL *PFN_WDFINTERRUPTSETEXTENDEDPOLICY)( 685 _In_ 686 PWDF_DRIVER_GLOBALS DriverGlobals, 687 _In_ 688 WDFINTERRUPT Interrupt, 689 _In_ 690 PWDF_INTERRUPT_EXTENDED_POLICY PolicyAndGroup 691 ); 692 693 _IRQL_requires_max_(DISPATCH_LEVEL) 694 FORCEINLINE 695 VOID 696 WdfInterruptSetExtendedPolicy( 697 _In_ 698 WDFINTERRUPT Interrupt, 699 _In_ 700 PWDF_INTERRUPT_EXTENDED_POLICY PolicyAndGroup 701 ) 702 { 703 ((PFN_WDFINTERRUPTSETEXTENDEDPOLICY) WdfFunctions[WdfInterruptSetExtendedPolicyTableIndex])(WdfDriverGlobals, Interrupt, PolicyAndGroup); 704 } 705 706 // 707 // WDF Function: WdfInterruptGetDevice 708 // 709 typedef 710 WDFAPI 711 WDFDEVICE 712 (STDCALL *PFN_WDFINTERRUPTGETDEVICE)( 713 _In_ 714 PWDF_DRIVER_GLOBALS DriverGlobals, 715 _In_ 716 WDFINTERRUPT Interrupt 717 ); 718 719 FORCEINLINE 720 WDFDEVICE 721 WdfInterruptGetDevice( 722 _In_ 723 WDFINTERRUPT Interrupt 724 ) 725 { 726 return ((PFN_WDFINTERRUPTGETDEVICE) WdfFunctions[WdfInterruptGetDeviceTableIndex])(WdfDriverGlobals, Interrupt); 727 } 728 729 // 730 // WDF Function: WdfInterruptTryToAcquireLock 731 // 732 typedef 733 _Must_inspect_result_ 734 _Post_satisfies_(return == 1 || return == 0) 735 _IRQL_requires_max_(PASSIVE_LEVEL) 736 WDFAPI 737 BOOLEAN 738 (STDCALL *PFN_WDFINTERRUPTTRYTOACQUIRELOCK)( 739 _In_ 740 PWDF_DRIVER_GLOBALS DriverGlobals, 741 _In_ 742 _Requires_lock_not_held_(_Curr_) 743 _When_(return!=0, _Acquires_lock_(_Curr_)) 744 WDFINTERRUPT Interrupt 745 ); 746 747 _Must_inspect_result_ 748 _Post_satisfies_(return == 1 || return == 0) 749 _IRQL_requires_max_(PASSIVE_LEVEL) 750 FORCEINLINE 751 BOOLEAN 752 WdfInterruptTryToAcquireLock( 753 _In_ 754 _Requires_lock_not_held_(_Curr_) 755 _When_(return!=0, _Acquires_lock_(_Curr_)) 756 WDFINTERRUPT Interrupt 757 ) 758 { 759 return ((PFN_WDFINTERRUPTTRYTOACQUIRELOCK) WdfFunctions[WdfInterruptTryToAcquireLockTableIndex])(WdfDriverGlobals, Interrupt); 760 } 761 762 // 763 // WDF Function: WdfInterruptReportActive 764 // 765 typedef 766 _IRQL_requires_max_(DISPATCH_LEVEL) 767 WDFAPI 768 VOID 769 (STDCALL *PFN_WDFINTERRUPTREPORTACTIVE)( 770 _In_ 771 PWDF_DRIVER_GLOBALS DriverGlobals, 772 _In_ 773 WDFINTERRUPT Interrupt 774 ); 775 776 _IRQL_requires_max_(DISPATCH_LEVEL) 777 FORCEINLINE 778 VOID 779 WdfInterruptReportActive( 780 _In_ 781 WDFINTERRUPT Interrupt 782 ) 783 { 784 ((PFN_WDFINTERRUPTREPORTACTIVE) WdfFunctions[WdfInterruptReportActiveTableIndex])(WdfDriverGlobals, Interrupt); 785 } 786 787 // 788 // WDF Function: WdfInterruptReportInactive 789 // 790 typedef 791 _IRQL_requires_max_(DISPATCH_LEVEL) 792 WDFAPI 793 VOID 794 (STDCALL *PFN_WDFINTERRUPTREPORTINACTIVE)( 795 _In_ 796 PWDF_DRIVER_GLOBALS DriverGlobals, 797 _In_ 798 WDFINTERRUPT Interrupt 799 ); 800 801 _IRQL_requires_max_(DISPATCH_LEVEL) 802 FORCEINLINE 803 VOID 804 WdfInterruptReportInactive( 805 _In_ 806 WDFINTERRUPT Interrupt 807 ) 808 { 809 ((PFN_WDFINTERRUPTREPORTINACTIVE) WdfFunctions[WdfInterruptReportInactiveTableIndex])(WdfDriverGlobals, Interrupt); 810 } 811 812 813 814 #endif // (NTDDI_VERSION >= NTDDI_WIN2K) 815 816 817 WDF_EXTERN_C_END 818 819 #endif // _WDFINTERRUPT_H_ 820 821