1 /*++ 2 3 Copyright (c) Microsoft Corporation. All rights reserved. 4 5 _WdfVersionBuild_ 6 7 Module Name: 8 9 wdfrequest.h 10 11 Abstract: 12 13 This module contains contains the Windows Driver Framework Request object 14 interfaces. 15 16 Environment: 17 18 kernel mode only 19 20 Revision History: 21 22 23 --*/ 24 25 // 26 // NOTE: This header is generated by stubwork. Please make any 27 // modifications to the corresponding template files 28 // (.x or .y) and use stubwork to regenerate the header 29 // 30 31 #ifndef _WDFREQUEST_H_ 32 #define _WDFREQUEST_H_ 33 34 #ifndef WDF_EXTERN_C 35 #ifdef __cplusplus 36 #define WDF_EXTERN_C extern "C" 37 #define WDF_EXTERN_C_START extern "C" { 38 #define WDF_EXTERN_C_END } 39 #else 40 #define WDF_EXTERN_C 41 #define WDF_EXTERN_C_START 42 #define WDF_EXTERN_C_END 43 #endif 44 #endif 45 46 WDF_EXTERN_C_START 47 48 49 50 #if (NTDDI_VERSION >= NTDDI_WIN2K) 51 52 // 53 // Types 54 // 55 56 typedef enum _WDF_REQUEST_TYPE { 57 WdfRequestTypeCreate = 0x0, 58 WdfRequestTypeCreateNamedPipe = 0x1, 59 WdfRequestTypeClose = 0x2, 60 WdfRequestTypeRead = 0x3, 61 WdfRequestTypeWrite = 0x4, 62 WdfRequestTypeQueryInformation = 0x5, 63 WdfRequestTypeSetInformation = 0x6, 64 WdfRequestTypeQueryEA = 0x7, 65 WdfRequestTypeSetEA = 0x8, 66 WdfRequestTypeFlushBuffers = 0x9, 67 WdfRequestTypeQueryVolumeInformation = 0xa, 68 WdfRequestTypeSetVolumeInformation = 0xb, 69 WdfRequestTypeDirectoryControl = 0xc, 70 WdfRequestTypeFileSystemControl = 0xd, 71 WdfRequestTypeDeviceControl = 0xe, 72 WdfRequestTypeDeviceControlInternal = 0xf, 73 WdfRequestTypeShutdown = 0x10, 74 WdfRequestTypeLockControl = 0x11, 75 WdfRequestTypeCleanup = 0x12, 76 WdfRequestTypeCreateMailSlot = 0x13, 77 WdfRequestTypeQuerySecurity = 0x14, 78 WdfRequestTypeSetSecurity = 0x15, 79 WdfRequestTypePower = 0x16, 80 WdfRequestTypeSystemControl = 0x17, 81 WdfRequestTypeDeviceChange = 0x18, 82 WdfRequestTypeQueryQuota = 0x19, 83 WdfRequestTypeSetQuota = 0x1A, 84 WdfRequestTypePnp = 0x1B, 85 WdfRequestTypeOther =0x1C, 86 WdfRequestTypeUsb = 0x40, 87 WdfRequestTypeNoFormat = 0xFF, 88 WdfRequestTypeMax, 89 } WDF_REQUEST_TYPE; 90 91 typedef enum _WDF_REQUEST_REUSE_FLAGS { 92 WDF_REQUEST_REUSE_NO_FLAGS = 0x00000000, 93 WDF_REQUEST_REUSE_SET_NEW_IRP = 0x00000001, 94 } WDF_REQUEST_REUSE_FLAGS; 95 96 // 97 // This defines the actions to take on a request 98 // in EvtIoStop. 99 // 100 typedef enum _WDF_REQUEST_STOP_ACTION_FLAGS { 101 WdfRequestStopActionInvalid = 0, 102 WdfRequestStopActionSuspend = 0x01, // Device is being suspended 103 WdfRequestStopActionPurge = 0x2, // Device/queue is being removed 104 WdfRequestStopRequestCancelable = 0x10000000, // This bit is set if the request is marked cancelable 105 } WDF_REQUEST_STOP_ACTION_FLAGS; 106 107 typedef enum _WDF_REQUEST_SEND_OPTIONS_FLAGS { 108 WDF_REQUEST_SEND_OPTION_TIMEOUT = 0x00000001, 109 WDF_REQUEST_SEND_OPTION_SYNCHRONOUS = 0x00000002, 110 WDF_REQUEST_SEND_OPTION_IGNORE_TARGET_STATE = 0x00000004, 111 WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET = 0x00000008, 112 WDF_REQUEST_SEND_OPTION_IMPERSONATE_CLIENT = 0x00010000, 113 WDF_REQUEST_SEND_OPTION_IMPERSONATION_IGNORE_FAILURE = 0x00020000, 114 } WDF_REQUEST_SEND_OPTIONS_FLAGS; 115 116 117 118 // Request cancel is called if a request that has been marked cancelable is cancelled 119 typedef 120 _Function_class_(EVT_WDF_REQUEST_CANCEL) 121 _IRQL_requires_same_ 122 _IRQL_requires_max_(DISPATCH_LEVEL) 123 VOID 124 EVT_WDF_REQUEST_CANCEL( 125 _In_ 126 WDFREQUEST Request 127 ); 128 129 typedef EVT_WDF_REQUEST_CANCEL *PFN_WDF_REQUEST_CANCEL; 130 131 132 // 133 // This parameters structure allows general access to a requests parameters 134 // 135 typedef struct _WDF_REQUEST_PARAMETERS { 136 137 USHORT Size; 138 139 UCHAR MinorFunction; 140 141 WDF_REQUEST_TYPE Type; 142 143 // 144 // The following user parameters are based on the service that is being 145 // invoked. Drivers and file systems can determine which set to use based 146 // on the above major and minor function codes. 147 // 148 union { 149 150 // 151 // System service parameters for: Create 152 // 153 154 struct { 155 PIO_SECURITY_CONTEXT SecurityContext; 156 ULONG Options; 157 USHORT POINTER_ALIGNMENT FileAttributes; 158 USHORT ShareAccess; 159 ULONG POINTER_ALIGNMENT EaLength; 160 } Create; 161 162 163 // 164 // System service parameters for: Read 165 // 166 167 struct { 168 size_t Length; 169 ULONG POINTER_ALIGNMENT Key; 170 LONGLONG DeviceOffset; 171 } Read; 172 173 // 174 // System service parameters for: Write 175 // 176 177 struct { 178 size_t Length; 179 ULONG POINTER_ALIGNMENT Key; 180 LONGLONG DeviceOffset; 181 } Write; 182 183 // 184 // System service parameters for: Device Control 185 // 186 // Note that the user's output buffer is stored in the UserBuffer field 187 // and the user's input buffer is stored in the SystemBuffer field. 188 // 189 190 struct { 191 size_t OutputBufferLength; 192 size_t POINTER_ALIGNMENT InputBufferLength; 193 ULONG POINTER_ALIGNMENT IoControlCode; 194 PVOID Type3InputBuffer; 195 } DeviceIoControl; 196 197 struct { 198 PVOID Arg1; 199 PVOID Arg2; 200 ULONG POINTER_ALIGNMENT IoControlCode; 201 PVOID Arg4; 202 } Others; 203 204 } Parameters; 205 206 } WDF_REQUEST_PARAMETERS, *PWDF_REQUEST_PARAMETERS; 207 208 VOID 209 FORCEINLINE 210 WDF_REQUEST_PARAMETERS_INIT( 211 _Out_ PWDF_REQUEST_PARAMETERS Parameters 212 ) 213 { 214 RtlZeroMemory(Parameters, sizeof(WDF_REQUEST_PARAMETERS)); 215 216 Parameters->Size = sizeof(WDF_REQUEST_PARAMETERS); 217 } 218 219 typedef struct _WDF_USB_REQUEST_COMPLETION_PARAMS *PWDF_USB_REQUEST_COMPLETION_PARAMS; 220 221 typedef struct _WDF_REQUEST_COMPLETION_PARAMS { 222 // 223 // Size of the structure in bytes 224 // 225 ULONG Size; 226 227 WDF_REQUEST_TYPE Type; 228 229 IO_STATUS_BLOCK IoStatus; 230 231 union { 232 struct { 233 WDFMEMORY Buffer; 234 size_t Length; 235 size_t Offset; 236 } Write; 237 238 struct { 239 WDFMEMORY Buffer; 240 size_t Length; 241 size_t Offset; 242 } Read; 243 244 struct { 245 ULONG IoControlCode; 246 247 struct { 248 WDFMEMORY Buffer; 249 size_t Offset; 250 } Input; 251 252 struct { 253 WDFMEMORY Buffer; 254 size_t Offset; 255 size_t Length; 256 } Output; 257 } Ioctl; 258 259 struct { 260 union { 261 PVOID Ptr; 262 ULONG_PTR Value; 263 } Argument1; 264 union { 265 PVOID Ptr; 266 ULONG_PTR Value; 267 } Argument2; 268 union { 269 PVOID Ptr; 270 ULONG_PTR Value; 271 } Argument3; 272 union { 273 PVOID Ptr; 274 ULONG_PTR Value; 275 } Argument4; 276 } Others; 277 278 struct { 279 PWDF_USB_REQUEST_COMPLETION_PARAMS Completion; 280 } Usb; 281 } Parameters; 282 283 } WDF_REQUEST_COMPLETION_PARAMS, *PWDF_REQUEST_COMPLETION_PARAMS; 284 285 VOID 286 FORCEINLINE 287 WDF_REQUEST_COMPLETION_PARAMS_INIT( 288 _Out_ PWDF_REQUEST_COMPLETION_PARAMS Params 289 ) 290 { 291 RtlZeroMemory(Params, sizeof(WDF_REQUEST_COMPLETION_PARAMS)); 292 Params->Size = sizeof(WDF_REQUEST_COMPLETION_PARAMS); 293 Params->Type = WdfRequestTypeNoFormat; 294 } 295 296 typedef 297 _Function_class_(EVT_WDF_REQUEST_COMPLETION_ROUTINE) 298 _IRQL_requires_same_ 299 VOID 300 EVT_WDF_REQUEST_COMPLETION_ROUTINE( 301 _In_ 302 WDFREQUEST Request, 303 _In_ 304 WDFIOTARGET Target, 305 _In_ 306 PWDF_REQUEST_COMPLETION_PARAMS Params, 307 _In_ 308 WDFCONTEXT Context 309 ); 310 311 typedef EVT_WDF_REQUEST_COMPLETION_ROUTINE *PFN_WDF_REQUEST_COMPLETION_ROUTINE; 312 313 /*++ 314 315 Routine Description: 316 Clears out the internal state of the irp, which includes, but is not limited 317 to: 318 a) Any internal allocations for the previously formatted request 319 b) The completion routine and its context 320 c) The request's intended i/o target 321 d) All of the internal IRP's stack locations 322 323 Arguments: 324 Request - The request to be reused. 325 326 ReuseParams - Parameters controlling the reuse of the request, see comments 327 for each field in the structure for usage 328 329 Return Value: 330 None 331 332 --*/ 333 334 typedef struct _WDF_REQUEST_REUSE_PARAMS { 335 // 336 // Size of this structure in bytes 337 // 338 ULONG Size; 339 340 // 341 // Bit field combination of WDF_REQUEST_REUSE_Xxx values 342 // 343 ULONG Flags; 344 345 // 346 // The new status of the request. 347 // 348 NTSTATUS Status; 349 350 // 351 // New PIRP to be contained in the WDFREQUEST. Setting a new PIRP value 352 // is only valid for WDFREQUESTs created by WdfRequestCreateFromIrp where 353 // RequestFreesIrp == FALSE. No other WDFREQUESTs (presented by the 354 // I/O queue for instance) may have their IRPs changed. 355 // 356 PIRP NewIrp; 357 358 } WDF_REQUEST_REUSE_PARAMS, *PWDF_REQUEST_REUSE_PARAMS; 359 360 VOID 361 FORCEINLINE 362 WDF_REQUEST_REUSE_PARAMS_INIT( 363 _Out_ PWDF_REQUEST_REUSE_PARAMS Params, 364 _In_ ULONG Flags, 365 _In_ NTSTATUS Status 366 ) 367 { 368 RtlZeroMemory(Params, sizeof(WDF_REQUEST_REUSE_PARAMS)); 369 370 Params->Size = sizeof(WDF_REQUEST_REUSE_PARAMS); 371 Params->Flags = Flags; 372 Params->Status = Status; 373 } 374 375 VOID 376 FORCEINLINE 377 WDF_REQUEST_REUSE_PARAMS_SET_NEW_IRP( 378 _Inout_ PWDF_REQUEST_REUSE_PARAMS Params, 379 _In_ PIRP NewIrp 380 ) 381 { 382 Params->Flags |= WDF_REQUEST_REUSE_SET_NEW_IRP; 383 Params->NewIrp = NewIrp; 384 } 385 386 typedef struct _WDF_REQUEST_SEND_OPTIONS { 387 // 388 // Size of the structure in bytes 389 // 390 ULONG Size; 391 392 // 393 // Bit field combination of values from the WDF_REQUEST_SEND_OPTIONS_FLAGS 394 // enumeration 395 // 396 ULONG Flags; 397 398 // 399 // Valid when WDF_REQUEST_SEND_OPTION_TIMEOUT is set 400 // 401 LONGLONG Timeout; 402 403 } WDF_REQUEST_SEND_OPTIONS, *PWDF_REQUEST_SEND_OPTIONS; 404 405 VOID 406 FORCEINLINE 407 WDF_REQUEST_SEND_OPTIONS_INIT( 408 _Out_ PWDF_REQUEST_SEND_OPTIONS Options, 409 _In_ ULONG Flags 410 ) 411 { 412 RtlZeroMemory(Options, sizeof(WDF_REQUEST_SEND_OPTIONS)); 413 Options->Size = sizeof(WDF_REQUEST_SEND_OPTIONS); 414 Options->Flags = Flags; 415 } 416 417 VOID 418 FORCEINLINE 419 WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT( 420 _Inout_ PWDF_REQUEST_SEND_OPTIONS Options, 421 _In_ LONGLONG Timeout 422 ) 423 { 424 Options->Flags |= WDF_REQUEST_SEND_OPTION_TIMEOUT; 425 Options->Timeout = Timeout; 426 } 427 428 typedef enum _WDF_REQUEST_FORWARD_OPTIONS_FLAGS { 429 WDF_REQUEST_FORWARD_OPTION_SEND_AND_FORGET = 0x00000001 430 } WDF_REQUEST_FORWARD_OPTIONS_FLAGS; 431 432 typedef struct _WDF_REQUEST_FORWARD_OPTIONS { 433 // 434 // Size of the structure in bytes 435 // 436 ULONG Size; 437 438 // 439 // Bit field combination of values from the WDF_REQUEST_FORWARD_OPTIONS_FLAGS 440 // enumeration 441 // 442 ULONG Flags; 443 } WDF_REQUEST_FORWARD_OPTIONS, *PWDF_REQUEST_FORWARD_OPTIONS; 444 445 446 // 447 // Default REquest forward initialization macro 448 // 449 VOID 450 FORCEINLINE 451 WDF_REQUEST_FORWARD_OPTIONS_INIT( 452 _Out_ PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions 453 ) 454 { 455 RtlZeroMemory(ForwardOptions, sizeof(WDF_REQUEST_FORWARD_OPTIONS)); 456 457 ForwardOptions->Size = sizeof(WDF_REQUEST_FORWARD_OPTIONS); 458 ForwardOptions->Flags |= WDF_REQUEST_FORWARD_OPTION_SEND_AND_FORGET; 459 } 460 461 462 463 464 // 465 // WDF Function: WdfRequestCreate 466 // 467 typedef 468 _Must_inspect_result_ 469 _IRQL_requires_max_(DISPATCH_LEVEL) 470 WDFAPI 471 NTSTATUS 472 (*PFN_WDFREQUESTCREATE)( 473 _In_ 474 PWDF_DRIVER_GLOBALS DriverGlobals, 475 _In_opt_ 476 PWDF_OBJECT_ATTRIBUTES RequestAttributes, 477 _In_opt_ 478 WDFIOTARGET IoTarget, 479 _Out_ 480 WDFREQUEST* Request 481 ); 482 483 _Must_inspect_result_ 484 _IRQL_requires_max_(DISPATCH_LEVEL) 485 NTSTATUS 486 FORCEINLINE 487 WdfRequestCreate( 488 _In_opt_ 489 PWDF_OBJECT_ATTRIBUTES RequestAttributes, 490 _In_opt_ 491 WDFIOTARGET IoTarget, 492 _Out_ 493 WDFREQUEST* Request 494 ) 495 { 496 return ((PFN_WDFREQUESTCREATE) WdfFunctions[WdfRequestCreateTableIndex])(WdfDriverGlobals, RequestAttributes, IoTarget, Request); 497 } 498 499 // 500 // WDF Function: WdfRequestCreateFromIrp 501 // 502 typedef 503 _Must_inspect_result_ 504 _IRQL_requires_max_(DISPATCH_LEVEL) 505 WDFAPI 506 NTSTATUS 507 (*PFN_WDFREQUESTCREATEFROMIRP)( 508 _In_ 509 PWDF_DRIVER_GLOBALS DriverGlobals, 510 _In_opt_ 511 PWDF_OBJECT_ATTRIBUTES RequestAttributes, 512 _In_ 513 PIRP Irp, 514 _In_ 515 BOOLEAN RequestFreesIrp, 516 _Out_ 517 WDFREQUEST* Request 518 ); 519 520 _Must_inspect_result_ 521 _IRQL_requires_max_(DISPATCH_LEVEL) 522 NTSTATUS 523 FORCEINLINE 524 WdfRequestCreateFromIrp( 525 _In_opt_ 526 PWDF_OBJECT_ATTRIBUTES RequestAttributes, 527 _In_ 528 PIRP Irp, 529 _In_ 530 BOOLEAN RequestFreesIrp, 531 _Out_ 532 WDFREQUEST* Request 533 ) 534 { 535 return ((PFN_WDFREQUESTCREATEFROMIRP) WdfFunctions[WdfRequestCreateFromIrpTableIndex])(WdfDriverGlobals, RequestAttributes, Irp, RequestFreesIrp, Request); 536 } 537 538 // 539 // WDF Function: WdfRequestReuse 540 // 541 typedef 542 _IRQL_requires_max_(DISPATCH_LEVEL) 543 WDFAPI 544 NTSTATUS 545 (*PFN_WDFREQUESTREUSE)( 546 _In_ 547 PWDF_DRIVER_GLOBALS DriverGlobals, 548 _In_ 549 WDFREQUEST Request, 550 _In_ 551 PWDF_REQUEST_REUSE_PARAMS ReuseParams 552 ); 553 554 _IRQL_requires_max_(DISPATCH_LEVEL) 555 NTSTATUS 556 FORCEINLINE 557 WdfRequestReuse( 558 _In_ 559 WDFREQUEST Request, 560 _In_ 561 PWDF_REQUEST_REUSE_PARAMS ReuseParams 562 ) 563 { 564 return ((PFN_WDFREQUESTREUSE) WdfFunctions[WdfRequestReuseTableIndex])(WdfDriverGlobals, Request, ReuseParams); 565 } 566 567 // 568 // WDF Function: WdfRequestChangeTarget 569 // 570 typedef 571 _Must_inspect_result_ 572 _IRQL_requires_max_(DISPATCH_LEVEL) 573 WDFAPI 574 NTSTATUS 575 (*PFN_WDFREQUESTCHANGETARGET)( 576 _In_ 577 PWDF_DRIVER_GLOBALS DriverGlobals, 578 _In_ 579 WDFREQUEST Request, 580 _In_ 581 WDFIOTARGET IoTarget 582 ); 583 584 _Must_inspect_result_ 585 _IRQL_requires_max_(DISPATCH_LEVEL) 586 NTSTATUS 587 FORCEINLINE 588 WdfRequestChangeTarget( 589 _In_ 590 WDFREQUEST Request, 591 _In_ 592 WDFIOTARGET IoTarget 593 ) 594 { 595 return ((PFN_WDFREQUESTCHANGETARGET) WdfFunctions[WdfRequestChangeTargetTableIndex])(WdfDriverGlobals, Request, IoTarget); 596 } 597 598 // 599 // WDF Function: WdfRequestFormatRequestUsingCurrentType 600 // 601 typedef 602 _IRQL_requires_max_(DISPATCH_LEVEL) 603 WDFAPI 604 VOID 605 (*PFN_WDFREQUESTFORMATREQUESTUSINGCURRENTTYPE)( 606 _In_ 607 PWDF_DRIVER_GLOBALS DriverGlobals, 608 _In_ 609 WDFREQUEST Request 610 ); 611 612 _IRQL_requires_max_(DISPATCH_LEVEL) 613 VOID 614 FORCEINLINE 615 WdfRequestFormatRequestUsingCurrentType( 616 _In_ 617 WDFREQUEST Request 618 ) 619 { 620 ((PFN_WDFREQUESTFORMATREQUESTUSINGCURRENTTYPE) WdfFunctions[WdfRequestFormatRequestUsingCurrentTypeTableIndex])(WdfDriverGlobals, Request); 621 } 622 623 // 624 // WDF Function: WdfRequestWdmFormatUsingStackLocation 625 // 626 typedef 627 _IRQL_requires_max_(DISPATCH_LEVEL) 628 WDFAPI 629 VOID 630 (*PFN_WDFREQUESTWDMFORMATUSINGSTACKLOCATION)( 631 _In_ 632 PWDF_DRIVER_GLOBALS DriverGlobals, 633 _In_ 634 WDFREQUEST Request, 635 _In_ 636 PIO_STACK_LOCATION Stack 637 ); 638 639 _IRQL_requires_max_(DISPATCH_LEVEL) 640 VOID 641 FORCEINLINE 642 WdfRequestWdmFormatUsingStackLocation( 643 _In_ 644 WDFREQUEST Request, 645 _In_ 646 PIO_STACK_LOCATION Stack 647 ) 648 { 649 ((PFN_WDFREQUESTWDMFORMATUSINGSTACKLOCATION) WdfFunctions[WdfRequestWdmFormatUsingStackLocationTableIndex])(WdfDriverGlobals, Request, Stack); 650 } 651 652 // 653 // WDF Function: WdfRequestSend 654 // 655 typedef 656 _IRQL_requires_max_(DISPATCH_LEVEL) 657 _When_(Options->Flags & WDF_REQUEST_SEND_OPTION_SYNCHRONOUS == 0, _Must_inspect_result_) 658 WDFAPI 659 BOOLEAN 660 (*PFN_WDFREQUESTSEND)( 661 _In_ 662 PWDF_DRIVER_GLOBALS DriverGlobals, 663 _In_ 664 WDFREQUEST Request, 665 _In_ 666 WDFIOTARGET Target, 667 _In_opt_ 668 PWDF_REQUEST_SEND_OPTIONS Options 669 ); 670 671 _IRQL_requires_max_(DISPATCH_LEVEL) 672 _When_(Options->Flags & WDF_REQUEST_SEND_OPTION_SYNCHRONOUS == 0, _Must_inspect_result_) 673 BOOLEAN 674 FORCEINLINE 675 WdfRequestSend( 676 _In_ 677 WDFREQUEST Request, 678 _In_ 679 WDFIOTARGET Target, 680 _In_opt_ 681 PWDF_REQUEST_SEND_OPTIONS Options 682 ) 683 { 684 return ((PFN_WDFREQUESTSEND) WdfFunctions[WdfRequestSendTableIndex])(WdfDriverGlobals, Request, Target, Options); 685 } 686 687 // 688 // WDF Function: WdfRequestGetStatus 689 // 690 typedef 691 _Must_inspect_result_ 692 _IRQL_requires_max_(DISPATCH_LEVEL) 693 WDFAPI 694 NTSTATUS 695 (*PFN_WDFREQUESTGETSTATUS)( 696 _In_ 697 PWDF_DRIVER_GLOBALS DriverGlobals, 698 _In_ 699 WDFREQUEST Request 700 ); 701 702 _Must_inspect_result_ 703 _IRQL_requires_max_(DISPATCH_LEVEL) 704 NTSTATUS 705 FORCEINLINE 706 WdfRequestGetStatus( 707 _In_ 708 WDFREQUEST Request 709 ) 710 { 711 return ((PFN_WDFREQUESTGETSTATUS) WdfFunctions[WdfRequestGetStatusTableIndex])(WdfDriverGlobals, Request); 712 } 713 714 // 715 // WDF Function: WdfRequestMarkCancelable 716 // 717 typedef 718 _IRQL_requires_max_(DISPATCH_LEVEL) 719 WDFAPI 720 VOID 721 (*PFN_WDFREQUESTMARKCANCELABLE)( 722 _In_ 723 PWDF_DRIVER_GLOBALS DriverGlobals, 724 _In_ 725 WDFREQUEST Request, 726 _In_ 727 PFN_WDF_REQUEST_CANCEL EvtRequestCancel 728 ); 729 730 _IRQL_requires_max_(DISPATCH_LEVEL) 731 VOID 732 FORCEINLINE 733 WdfRequestMarkCancelable( 734 _In_ 735 WDFREQUEST Request, 736 _In_ 737 PFN_WDF_REQUEST_CANCEL EvtRequestCancel 738 ) 739 { 740 ((PFN_WDFREQUESTMARKCANCELABLE) WdfFunctions[WdfRequestMarkCancelableTableIndex])(WdfDriverGlobals, Request, EvtRequestCancel); 741 } 742 743 // 744 // WDF Function: WdfRequestMarkCancelableEx 745 // 746 typedef 747 _Must_inspect_result_ 748 _IRQL_requires_max_(DISPATCH_LEVEL) 749 WDFAPI 750 NTSTATUS 751 (*PFN_WDFREQUESTMARKCANCELABLEEX)( 752 _In_ 753 PWDF_DRIVER_GLOBALS DriverGlobals, 754 _In_ 755 WDFREQUEST Request, 756 _In_ 757 PFN_WDF_REQUEST_CANCEL EvtRequestCancel 758 ); 759 760 _Must_inspect_result_ 761 _IRQL_requires_max_(DISPATCH_LEVEL) 762 NTSTATUS 763 FORCEINLINE 764 WdfRequestMarkCancelableEx( 765 _In_ 766 WDFREQUEST Request, 767 _In_ 768 PFN_WDF_REQUEST_CANCEL EvtRequestCancel 769 ) 770 { 771 return ((PFN_WDFREQUESTMARKCANCELABLEEX) WdfFunctions[WdfRequestMarkCancelableExTableIndex])(WdfDriverGlobals, Request, EvtRequestCancel); 772 } 773 774 // 775 // WDF Function: WdfRequestUnmarkCancelable 776 // 777 typedef 778 _Must_inspect_result_ 779 _IRQL_requires_max_(DISPATCH_LEVEL) 780 WDFAPI 781 NTSTATUS 782 (*PFN_WDFREQUESTUNMARKCANCELABLE)( 783 _In_ 784 PWDF_DRIVER_GLOBALS DriverGlobals, 785 _In_ 786 WDFREQUEST Request 787 ); 788 789 _Must_inspect_result_ 790 _IRQL_requires_max_(DISPATCH_LEVEL) 791 NTSTATUS 792 FORCEINLINE 793 WdfRequestUnmarkCancelable( 794 _In_ 795 WDFREQUEST Request 796 ) 797 { 798 return ((PFN_WDFREQUESTUNMARKCANCELABLE) WdfFunctions[WdfRequestUnmarkCancelableTableIndex])(WdfDriverGlobals, Request); 799 } 800 801 // 802 // WDF Function: WdfRequestIsCanceled 803 // 804 typedef 805 _Must_inspect_result_ 806 _IRQL_requires_max_(DISPATCH_LEVEL) 807 WDFAPI 808 BOOLEAN 809 (*PFN_WDFREQUESTISCANCELED)( 810 _In_ 811 PWDF_DRIVER_GLOBALS DriverGlobals, 812 _In_ 813 WDFREQUEST Request 814 ); 815 816 _Must_inspect_result_ 817 _IRQL_requires_max_(DISPATCH_LEVEL) 818 BOOLEAN 819 FORCEINLINE 820 WdfRequestIsCanceled( 821 _In_ 822 WDFREQUEST Request 823 ) 824 { 825 return ((PFN_WDFREQUESTISCANCELED) WdfFunctions[WdfRequestIsCanceledTableIndex])(WdfDriverGlobals, Request); 826 } 827 828 // 829 // WDF Function: WdfRequestCancelSentRequest 830 // 831 typedef 832 _IRQL_requires_max_(DISPATCH_LEVEL) 833 WDFAPI 834 BOOLEAN 835 (*PFN_WDFREQUESTCANCELSENTREQUEST)( 836 _In_ 837 PWDF_DRIVER_GLOBALS DriverGlobals, 838 _In_ 839 WDFREQUEST Request 840 ); 841 842 _IRQL_requires_max_(DISPATCH_LEVEL) 843 BOOLEAN 844 FORCEINLINE 845 WdfRequestCancelSentRequest( 846 _In_ 847 WDFREQUEST Request 848 ) 849 { 850 return ((PFN_WDFREQUESTCANCELSENTREQUEST) WdfFunctions[WdfRequestCancelSentRequestTableIndex])(WdfDriverGlobals, Request); 851 } 852 853 // 854 // WDF Function: WdfRequestIsFrom32BitProcess 855 // 856 typedef 857 _Must_inspect_result_ 858 _IRQL_requires_max_(APC_LEVEL) 859 WDFAPI 860 BOOLEAN 861 (*PFN_WDFREQUESTISFROM32BITPROCESS)( 862 _In_ 863 PWDF_DRIVER_GLOBALS DriverGlobals, 864 _In_ 865 WDFREQUEST Request 866 ); 867 868 _Must_inspect_result_ 869 _IRQL_requires_max_(APC_LEVEL) 870 BOOLEAN 871 FORCEINLINE 872 WdfRequestIsFrom32BitProcess( 873 _In_ 874 WDFREQUEST Request 875 ) 876 { 877 return ((PFN_WDFREQUESTISFROM32BITPROCESS) WdfFunctions[WdfRequestIsFrom32BitProcessTableIndex])(WdfDriverGlobals, Request); 878 } 879 880 // 881 // WDF Function: WdfRequestSetCompletionRoutine 882 // 883 typedef 884 _IRQL_requires_max_(DISPATCH_LEVEL) 885 WDFAPI 886 VOID 887 (*PFN_WDFREQUESTSETCOMPLETIONROUTINE)( 888 _In_ 889 PWDF_DRIVER_GLOBALS DriverGlobals, 890 _In_ 891 WDFREQUEST Request, 892 _In_opt_ 893 PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine, 894 _In_opt_ __drv_aliasesMem 895 WDFCONTEXT CompletionContext 896 ); 897 898 _IRQL_requires_max_(DISPATCH_LEVEL) 899 VOID 900 FORCEINLINE 901 WdfRequestSetCompletionRoutine( 902 _In_ 903 WDFREQUEST Request, 904 _In_opt_ 905 PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine, 906 _In_opt_ __drv_aliasesMem 907 WDFCONTEXT CompletionContext 908 ) 909 { 910 ((PFN_WDFREQUESTSETCOMPLETIONROUTINE) WdfFunctions[WdfRequestSetCompletionRoutineTableIndex])(WdfDriverGlobals, Request, CompletionRoutine, CompletionContext); 911 } 912 913 // 914 // WDF Function: WdfRequestGetCompletionParams 915 // 916 typedef 917 _IRQL_requires_max_(DISPATCH_LEVEL) 918 WDFAPI 919 VOID 920 (*PFN_WDFREQUESTGETCOMPLETIONPARAMS)( 921 _In_ 922 PWDF_DRIVER_GLOBALS DriverGlobals, 923 _In_ 924 WDFREQUEST Request, 925 _Out_ 926 PWDF_REQUEST_COMPLETION_PARAMS Params 927 ); 928 929 _IRQL_requires_max_(DISPATCH_LEVEL) 930 VOID 931 FORCEINLINE 932 WdfRequestGetCompletionParams( 933 _In_ 934 WDFREQUEST Request, 935 _Out_ 936 PWDF_REQUEST_COMPLETION_PARAMS Params 937 ) 938 { 939 ((PFN_WDFREQUESTGETCOMPLETIONPARAMS) WdfFunctions[WdfRequestGetCompletionParamsTableIndex])(WdfDriverGlobals, Request, Params); 940 } 941 942 // 943 // WDF Function: WdfRequestAllocateTimer 944 // 945 typedef 946 _Must_inspect_result_ 947 _IRQL_requires_max_(DISPATCH_LEVEL) 948 WDFAPI 949 NTSTATUS 950 (*PFN_WDFREQUESTALLOCATETIMER)( 951 _In_ 952 PWDF_DRIVER_GLOBALS DriverGlobals, 953 _In_ 954 WDFREQUEST Request 955 ); 956 957 _Must_inspect_result_ 958 _IRQL_requires_max_(DISPATCH_LEVEL) 959 NTSTATUS 960 FORCEINLINE 961 WdfRequestAllocateTimer( 962 _In_ 963 WDFREQUEST Request 964 ) 965 { 966 return ((PFN_WDFREQUESTALLOCATETIMER) WdfFunctions[WdfRequestAllocateTimerTableIndex])(WdfDriverGlobals, Request); 967 } 968 969 // 970 // WDF Function: WdfRequestComplete 971 // 972 typedef 973 _IRQL_requires_max_(DISPATCH_LEVEL) 974 WDFAPI 975 VOID 976 (*PFN_WDFREQUESTCOMPLETE)( 977 _In_ 978 PWDF_DRIVER_GLOBALS DriverGlobals, 979 _In_ 980 WDFREQUEST Request, 981 _In_ 982 NTSTATUS Status 983 ); 984 985 _IRQL_requires_max_(DISPATCH_LEVEL) 986 VOID 987 FORCEINLINE 988 WdfRequestComplete( 989 _In_ 990 WDFREQUEST Request, 991 _In_ 992 NTSTATUS Status 993 ) 994 { 995 ((PFN_WDFREQUESTCOMPLETE) WdfFunctions[WdfRequestCompleteTableIndex])(WdfDriverGlobals, Request, Status); 996 } 997 998 // 999 // WDF Function: WdfRequestCompleteWithPriorityBoost 1000 // 1001 typedef 1002 _IRQL_requires_max_(DISPATCH_LEVEL) 1003 WDFAPI 1004 VOID 1005 (*PFN_WDFREQUESTCOMPLETEWITHPRIORITYBOOST)( 1006 _In_ 1007 PWDF_DRIVER_GLOBALS DriverGlobals, 1008 _In_ 1009 WDFREQUEST Request, 1010 _In_ 1011 NTSTATUS Status, 1012 _In_ 1013 CCHAR PriorityBoost 1014 ); 1015 1016 _IRQL_requires_max_(DISPATCH_LEVEL) 1017 VOID 1018 FORCEINLINE 1019 WdfRequestCompleteWithPriorityBoost( 1020 _In_ 1021 WDFREQUEST Request, 1022 _In_ 1023 NTSTATUS Status, 1024 _In_ 1025 CCHAR PriorityBoost 1026 ) 1027 { 1028 ((PFN_WDFREQUESTCOMPLETEWITHPRIORITYBOOST) WdfFunctions[WdfRequestCompleteWithPriorityBoostTableIndex])(WdfDriverGlobals, Request, Status, PriorityBoost); 1029 } 1030 1031 // 1032 // WDF Function: WdfRequestCompleteWithInformation 1033 // 1034 typedef 1035 _IRQL_requires_max_(DISPATCH_LEVEL) 1036 WDFAPI 1037 VOID 1038 (*PFN_WDFREQUESTCOMPLETEWITHINFORMATION)( 1039 _In_ 1040 PWDF_DRIVER_GLOBALS DriverGlobals, 1041 _In_ 1042 WDFREQUEST Request, 1043 _In_ 1044 NTSTATUS Status, 1045 _In_ 1046 ULONG_PTR Information 1047 ); 1048 1049 _IRQL_requires_max_(DISPATCH_LEVEL) 1050 VOID 1051 FORCEINLINE 1052 WdfRequestCompleteWithInformation( 1053 _In_ 1054 WDFREQUEST Request, 1055 _In_ 1056 NTSTATUS Status, 1057 _In_ 1058 ULONG_PTR Information 1059 ) 1060 { 1061 ((PFN_WDFREQUESTCOMPLETEWITHINFORMATION) WdfFunctions[WdfRequestCompleteWithInformationTableIndex])(WdfDriverGlobals, Request, Status, Information); 1062 } 1063 1064 // 1065 // WDF Function: WdfRequestGetParameters 1066 // 1067 typedef 1068 _IRQL_requires_max_(DISPATCH_LEVEL) 1069 WDFAPI 1070 VOID 1071 (*PFN_WDFREQUESTGETPARAMETERS)( 1072 _In_ 1073 PWDF_DRIVER_GLOBALS DriverGlobals, 1074 _In_ 1075 WDFREQUEST Request, 1076 _Out_ 1077 PWDF_REQUEST_PARAMETERS Parameters 1078 ); 1079 1080 _IRQL_requires_max_(DISPATCH_LEVEL) 1081 VOID 1082 FORCEINLINE 1083 WdfRequestGetParameters( 1084 _In_ 1085 WDFREQUEST Request, 1086 _Out_ 1087 PWDF_REQUEST_PARAMETERS Parameters 1088 ) 1089 { 1090 ((PFN_WDFREQUESTGETPARAMETERS) WdfFunctions[WdfRequestGetParametersTableIndex])(WdfDriverGlobals, Request, Parameters); 1091 } 1092 1093 // 1094 // WDF Function: WdfRequestRetrieveInputMemory 1095 // 1096 typedef 1097 _Must_inspect_result_ 1098 _IRQL_requires_max_(DISPATCH_LEVEL) 1099 WDFAPI 1100 NTSTATUS 1101 (*PFN_WDFREQUESTRETRIEVEINPUTMEMORY)( 1102 _In_ 1103 PWDF_DRIVER_GLOBALS DriverGlobals, 1104 _In_ 1105 WDFREQUEST Request, 1106 _Out_ 1107 WDFMEMORY* Memory 1108 ); 1109 1110 _Must_inspect_result_ 1111 _IRQL_requires_max_(DISPATCH_LEVEL) 1112 NTSTATUS 1113 FORCEINLINE 1114 WdfRequestRetrieveInputMemory( 1115 _In_ 1116 WDFREQUEST Request, 1117 _Out_ 1118 WDFMEMORY* Memory 1119 ) 1120 { 1121 return ((PFN_WDFREQUESTRETRIEVEINPUTMEMORY) WdfFunctions[WdfRequestRetrieveInputMemoryTableIndex])(WdfDriverGlobals, Request, Memory); 1122 } 1123 1124 // 1125 // WDF Function: WdfRequestRetrieveOutputMemory 1126 // 1127 typedef 1128 _Must_inspect_result_ 1129 _IRQL_requires_max_(DISPATCH_LEVEL) 1130 WDFAPI 1131 NTSTATUS 1132 (*PFN_WDFREQUESTRETRIEVEOUTPUTMEMORY)( 1133 _In_ 1134 PWDF_DRIVER_GLOBALS DriverGlobals, 1135 _In_ 1136 WDFREQUEST Request, 1137 _Out_ 1138 WDFMEMORY* Memory 1139 ); 1140 1141 _Must_inspect_result_ 1142 _IRQL_requires_max_(DISPATCH_LEVEL) 1143 NTSTATUS 1144 FORCEINLINE 1145 WdfRequestRetrieveOutputMemory( 1146 _In_ 1147 WDFREQUEST Request, 1148 _Out_ 1149 WDFMEMORY* Memory 1150 ) 1151 { 1152 return ((PFN_WDFREQUESTRETRIEVEOUTPUTMEMORY) WdfFunctions[WdfRequestRetrieveOutputMemoryTableIndex])(WdfDriverGlobals, Request, Memory); 1153 } 1154 1155 // 1156 // WDF Function: WdfRequestRetrieveInputBuffer 1157 // 1158 typedef 1159 _Must_inspect_result_ 1160 _IRQL_requires_max_(DISPATCH_LEVEL) 1161 WDFAPI 1162 NTSTATUS 1163 (*PFN_WDFREQUESTRETRIEVEINPUTBUFFER)( 1164 _In_ 1165 PWDF_DRIVER_GLOBALS DriverGlobals, 1166 _In_ 1167 WDFREQUEST Request, 1168 _In_ 1169 size_t MinimumRequiredLength, 1170 _Outptr_result_bytebuffer_(*Length) 1171 PVOID* Buffer, 1172 _Out_opt_ 1173 size_t* Length 1174 ); 1175 1176 _Must_inspect_result_ 1177 _IRQL_requires_max_(DISPATCH_LEVEL) 1178 NTSTATUS 1179 FORCEINLINE 1180 WdfRequestRetrieveInputBuffer( 1181 _In_ 1182 WDFREQUEST Request, 1183 _In_ 1184 size_t MinimumRequiredLength, 1185 _Outptr_result_bytebuffer_(*Length) 1186 PVOID* Buffer, 1187 _Out_opt_ 1188 size_t* Length 1189 ) 1190 { 1191 return ((PFN_WDFREQUESTRETRIEVEINPUTBUFFER) WdfFunctions[WdfRequestRetrieveInputBufferTableIndex])(WdfDriverGlobals, Request, MinimumRequiredLength, Buffer, Length); 1192 } 1193 1194 // 1195 // WDF Function: WdfRequestRetrieveOutputBuffer 1196 // 1197 typedef 1198 _Must_inspect_result_ 1199 _IRQL_requires_max_(DISPATCH_LEVEL) 1200 WDFAPI 1201 NTSTATUS 1202 (*PFN_WDFREQUESTRETRIEVEOUTPUTBUFFER)( 1203 _In_ 1204 PWDF_DRIVER_GLOBALS DriverGlobals, 1205 _In_ 1206 WDFREQUEST Request, 1207 _In_ 1208 size_t MinimumRequiredSize, 1209 _Outptr_result_bytebuffer_(*Length) 1210 PVOID* Buffer, 1211 _Out_opt_ 1212 size_t* Length 1213 ); 1214 1215 _Must_inspect_result_ 1216 _IRQL_requires_max_(DISPATCH_LEVEL) 1217 NTSTATUS 1218 FORCEINLINE 1219 WdfRequestRetrieveOutputBuffer( 1220 _In_ 1221 WDFREQUEST Request, 1222 _In_ 1223 size_t MinimumRequiredSize, 1224 _Outptr_result_bytebuffer_(*Length) 1225 PVOID* Buffer, 1226 _Out_opt_ 1227 size_t* Length 1228 ) 1229 { 1230 return ((PFN_WDFREQUESTRETRIEVEOUTPUTBUFFER) WdfFunctions[WdfRequestRetrieveOutputBufferTableIndex])(WdfDriverGlobals, Request, MinimumRequiredSize, Buffer, Length); 1231 } 1232 1233 // 1234 // WDF Function: WdfRequestRetrieveInputWdmMdl 1235 // 1236 typedef 1237 _Must_inspect_result_ 1238 _IRQL_requires_max_(DISPATCH_LEVEL) 1239 WDFAPI 1240 NTSTATUS 1241 (*PFN_WDFREQUESTRETRIEVEINPUTWDMMDL)( 1242 _In_ 1243 PWDF_DRIVER_GLOBALS DriverGlobals, 1244 _In_ 1245 WDFREQUEST Request, 1246 _Outptr_ 1247 PMDL* Mdl 1248 ); 1249 1250 _Must_inspect_result_ 1251 _IRQL_requires_max_(DISPATCH_LEVEL) 1252 NTSTATUS 1253 FORCEINLINE 1254 WdfRequestRetrieveInputWdmMdl( 1255 _In_ 1256 WDFREQUEST Request, 1257 _Outptr_ 1258 PMDL* Mdl 1259 ) 1260 { 1261 return ((PFN_WDFREQUESTRETRIEVEINPUTWDMMDL) WdfFunctions[WdfRequestRetrieveInputWdmMdlTableIndex])(WdfDriverGlobals, Request, Mdl); 1262 } 1263 1264 // 1265 // WDF Function: WdfRequestRetrieveOutputWdmMdl 1266 // 1267 typedef 1268 _Must_inspect_result_ 1269 _IRQL_requires_max_(DISPATCH_LEVEL) 1270 WDFAPI 1271 NTSTATUS 1272 (*PFN_WDFREQUESTRETRIEVEOUTPUTWDMMDL)( 1273 _In_ 1274 PWDF_DRIVER_GLOBALS DriverGlobals, 1275 _In_ 1276 WDFREQUEST Request, 1277 _Outptr_ 1278 PMDL* Mdl 1279 ); 1280 1281 _Must_inspect_result_ 1282 _IRQL_requires_max_(DISPATCH_LEVEL) 1283 NTSTATUS 1284 FORCEINLINE 1285 WdfRequestRetrieveOutputWdmMdl( 1286 _In_ 1287 WDFREQUEST Request, 1288 _Outptr_ 1289 PMDL* Mdl 1290 ) 1291 { 1292 return ((PFN_WDFREQUESTRETRIEVEOUTPUTWDMMDL) WdfFunctions[WdfRequestRetrieveOutputWdmMdlTableIndex])(WdfDriverGlobals, Request, Mdl); 1293 } 1294 1295 // 1296 // WDF Function: WdfRequestRetrieveUnsafeUserInputBuffer 1297 // 1298 typedef 1299 _Must_inspect_result_ 1300 _IRQL_requires_max_(PASSIVE_LEVEL) 1301 WDFAPI 1302 NTSTATUS 1303 (*PFN_WDFREQUESTRETRIEVEUNSAFEUSERINPUTBUFFER)( 1304 _In_ 1305 PWDF_DRIVER_GLOBALS DriverGlobals, 1306 _In_ 1307 WDFREQUEST Request, 1308 _In_ 1309 size_t MinimumRequiredLength, 1310 _Outptr_result_bytebuffer_maybenull_(*Length) 1311 PVOID* InputBuffer, 1312 _Out_opt_ 1313 size_t* Length 1314 ); 1315 1316 _Must_inspect_result_ 1317 _IRQL_requires_max_(PASSIVE_LEVEL) 1318 NTSTATUS 1319 FORCEINLINE 1320 WdfRequestRetrieveUnsafeUserInputBuffer( 1321 _In_ 1322 WDFREQUEST Request, 1323 _In_ 1324 size_t MinimumRequiredLength, 1325 _Outptr_result_bytebuffer_maybenull_(*Length) 1326 PVOID* InputBuffer, 1327 _Out_opt_ 1328 size_t* Length 1329 ) 1330 { 1331 return ((PFN_WDFREQUESTRETRIEVEUNSAFEUSERINPUTBUFFER) WdfFunctions[WdfRequestRetrieveUnsafeUserInputBufferTableIndex])(WdfDriverGlobals, Request, MinimumRequiredLength, InputBuffer, Length); 1332 } 1333 1334 // 1335 // WDF Function: WdfRequestRetrieveUnsafeUserOutputBuffer 1336 // 1337 typedef 1338 _Must_inspect_result_ 1339 _IRQL_requires_max_(PASSIVE_LEVEL) 1340 WDFAPI 1341 NTSTATUS 1342 (*PFN_WDFREQUESTRETRIEVEUNSAFEUSEROUTPUTBUFFER)( 1343 _In_ 1344 PWDF_DRIVER_GLOBALS DriverGlobals, 1345 _In_ 1346 WDFREQUEST Request, 1347 _In_ 1348 size_t MinimumRequiredLength, 1349 _Outptr_result_bytebuffer_maybenull_(*Length) 1350 PVOID* OutputBuffer, 1351 _Out_opt_ 1352 size_t* Length 1353 ); 1354 1355 _Must_inspect_result_ 1356 _IRQL_requires_max_(PASSIVE_LEVEL) 1357 NTSTATUS 1358 FORCEINLINE 1359 WdfRequestRetrieveUnsafeUserOutputBuffer( 1360 _In_ 1361 WDFREQUEST Request, 1362 _In_ 1363 size_t MinimumRequiredLength, 1364 _Outptr_result_bytebuffer_maybenull_(*Length) 1365 PVOID* OutputBuffer, 1366 _Out_opt_ 1367 size_t* Length 1368 ) 1369 { 1370 return ((PFN_WDFREQUESTRETRIEVEUNSAFEUSEROUTPUTBUFFER) WdfFunctions[WdfRequestRetrieveUnsafeUserOutputBufferTableIndex])(WdfDriverGlobals, Request, MinimumRequiredLength, OutputBuffer, Length); 1371 } 1372 1373 // 1374 // WDF Function: WdfRequestSetInformation 1375 // 1376 typedef 1377 _IRQL_requires_max_(DISPATCH_LEVEL) 1378 WDFAPI 1379 VOID 1380 (*PFN_WDFREQUESTSETINFORMATION)( 1381 _In_ 1382 PWDF_DRIVER_GLOBALS DriverGlobals, 1383 _In_ 1384 WDFREQUEST Request, 1385 _In_ 1386 ULONG_PTR Information 1387 ); 1388 1389 _IRQL_requires_max_(DISPATCH_LEVEL) 1390 VOID 1391 FORCEINLINE 1392 WdfRequestSetInformation( 1393 _In_ 1394 WDFREQUEST Request, 1395 _In_ 1396 ULONG_PTR Information 1397 ) 1398 { 1399 ((PFN_WDFREQUESTSETINFORMATION) WdfFunctions[WdfRequestSetInformationTableIndex])(WdfDriverGlobals, Request, Information); 1400 } 1401 1402 // 1403 // WDF Function: WdfRequestGetInformation 1404 // 1405 typedef 1406 _IRQL_requires_max_(DISPATCH_LEVEL) 1407 WDFAPI 1408 ULONG_PTR 1409 (*PFN_WDFREQUESTGETINFORMATION)( 1410 _In_ 1411 PWDF_DRIVER_GLOBALS DriverGlobals, 1412 _In_ 1413 WDFREQUEST Request 1414 ); 1415 1416 _IRQL_requires_max_(DISPATCH_LEVEL) 1417 ULONG_PTR 1418 FORCEINLINE 1419 WdfRequestGetInformation( 1420 _In_ 1421 WDFREQUEST Request 1422 ) 1423 { 1424 return ((PFN_WDFREQUESTGETINFORMATION) WdfFunctions[WdfRequestGetInformationTableIndex])(WdfDriverGlobals, Request); 1425 } 1426 1427 // 1428 // WDF Function: WdfRequestGetFileObject 1429 // 1430 typedef 1431 _IRQL_requires_max_(DISPATCH_LEVEL) 1432 WDFAPI 1433 WDFFILEOBJECT 1434 (*PFN_WDFREQUESTGETFILEOBJECT)( 1435 _In_ 1436 PWDF_DRIVER_GLOBALS DriverGlobals, 1437 _In_ 1438 WDFREQUEST Request 1439 ); 1440 1441 _IRQL_requires_max_(DISPATCH_LEVEL) 1442 WDFFILEOBJECT 1443 FORCEINLINE 1444 WdfRequestGetFileObject( 1445 _In_ 1446 WDFREQUEST Request 1447 ) 1448 { 1449 return ((PFN_WDFREQUESTGETFILEOBJECT) WdfFunctions[WdfRequestGetFileObjectTableIndex])(WdfDriverGlobals, Request); 1450 } 1451 1452 // 1453 // WDF Function: WdfRequestProbeAndLockUserBufferForRead 1454 // 1455 typedef 1456 _Must_inspect_result_ 1457 _IRQL_requires_max_(PASSIVE_LEVEL) 1458 WDFAPI 1459 NTSTATUS 1460 (*PFN_WDFREQUESTPROBEANDLOCKUSERBUFFERFORREAD)( 1461 _In_ 1462 PWDF_DRIVER_GLOBALS DriverGlobals, 1463 _In_ 1464 WDFREQUEST Request, 1465 _In_reads_bytes_(Length) 1466 PVOID Buffer, 1467 _In_ 1468 size_t Length, 1469 _Out_ 1470 WDFMEMORY* MemoryObject 1471 ); 1472 1473 _Must_inspect_result_ 1474 _IRQL_requires_max_(PASSIVE_LEVEL) 1475 NTSTATUS 1476 FORCEINLINE 1477 WdfRequestProbeAndLockUserBufferForRead( 1478 _In_ 1479 WDFREQUEST Request, 1480 _In_reads_bytes_(Length) 1481 PVOID Buffer, 1482 _In_ 1483 size_t Length, 1484 _Out_ 1485 WDFMEMORY* MemoryObject 1486 ) 1487 { 1488 return ((PFN_WDFREQUESTPROBEANDLOCKUSERBUFFERFORREAD) WdfFunctions[WdfRequestProbeAndLockUserBufferForReadTableIndex])(WdfDriverGlobals, Request, Buffer, Length, MemoryObject); 1489 } 1490 1491 // 1492 // WDF Function: WdfRequestProbeAndLockUserBufferForWrite 1493 // 1494 typedef 1495 _Must_inspect_result_ 1496 _IRQL_requires_max_(PASSIVE_LEVEL) 1497 WDFAPI 1498 NTSTATUS 1499 (*PFN_WDFREQUESTPROBEANDLOCKUSERBUFFERFORWRITE)( 1500 _In_ 1501 PWDF_DRIVER_GLOBALS DriverGlobals, 1502 _In_ 1503 WDFREQUEST Request, 1504 _In_reads_bytes_(Length) 1505 PVOID Buffer, 1506 _In_ 1507 size_t Length, 1508 _Out_ 1509 WDFMEMORY* MemoryObject 1510 ); 1511 1512 _Must_inspect_result_ 1513 _IRQL_requires_max_(PASSIVE_LEVEL) 1514 NTSTATUS 1515 FORCEINLINE 1516 WdfRequestProbeAndLockUserBufferForWrite( 1517 _In_ 1518 WDFREQUEST Request, 1519 _In_reads_bytes_(Length) 1520 PVOID Buffer, 1521 _In_ 1522 size_t Length, 1523 _Out_ 1524 WDFMEMORY* MemoryObject 1525 ) 1526 { 1527 return ((PFN_WDFREQUESTPROBEANDLOCKUSERBUFFERFORWRITE) WdfFunctions[WdfRequestProbeAndLockUserBufferForWriteTableIndex])(WdfDriverGlobals, Request, Buffer, Length, MemoryObject); 1528 } 1529 1530 // 1531 // WDF Function: WdfRequestGetRequestorMode 1532 // 1533 typedef 1534 _IRQL_requires_max_(DISPATCH_LEVEL) 1535 WDFAPI 1536 KPROCESSOR_MODE 1537 (*PFN_WDFREQUESTGETREQUESTORMODE)( 1538 _In_ 1539 PWDF_DRIVER_GLOBALS DriverGlobals, 1540 _In_ 1541 WDFREQUEST Request 1542 ); 1543 1544 _IRQL_requires_max_(DISPATCH_LEVEL) 1545 KPROCESSOR_MODE 1546 FORCEINLINE 1547 WdfRequestGetRequestorMode( 1548 _In_ 1549 WDFREQUEST Request 1550 ) 1551 { 1552 return ((PFN_WDFREQUESTGETREQUESTORMODE) WdfFunctions[WdfRequestGetRequestorModeTableIndex])(WdfDriverGlobals, Request); 1553 } 1554 1555 // 1556 // WDF Function: WdfRequestForwardToIoQueue 1557 // 1558 typedef 1559 _Must_inspect_result_ 1560 _IRQL_requires_max_(DISPATCH_LEVEL) 1561 WDFAPI 1562 NTSTATUS 1563 (*PFN_WDFREQUESTFORWARDTOIOQUEUE)( 1564 _In_ 1565 PWDF_DRIVER_GLOBALS DriverGlobals, 1566 _In_ 1567 WDFREQUEST Request, 1568 _In_ 1569 WDFQUEUE DestinationQueue 1570 ); 1571 1572 _Must_inspect_result_ 1573 _IRQL_requires_max_(DISPATCH_LEVEL) 1574 NTSTATUS 1575 FORCEINLINE 1576 WdfRequestForwardToIoQueue( 1577 _In_ 1578 WDFREQUEST Request, 1579 _In_ 1580 WDFQUEUE DestinationQueue 1581 ) 1582 { 1583 return ((PFN_WDFREQUESTFORWARDTOIOQUEUE) WdfFunctions[WdfRequestForwardToIoQueueTableIndex])(WdfDriverGlobals, Request, DestinationQueue); 1584 } 1585 1586 // 1587 // WDF Function: WdfRequestGetIoQueue 1588 // 1589 typedef 1590 _IRQL_requires_max_(DISPATCH_LEVEL) 1591 WDFAPI 1592 WDFQUEUE 1593 (*PFN_WDFREQUESTGETIOQUEUE)( 1594 _In_ 1595 PWDF_DRIVER_GLOBALS DriverGlobals, 1596 _In_ 1597 WDFREQUEST Request 1598 ); 1599 1600 _IRQL_requires_max_(DISPATCH_LEVEL) 1601 WDFQUEUE 1602 FORCEINLINE 1603 WdfRequestGetIoQueue( 1604 _In_ 1605 WDFREQUEST Request 1606 ) 1607 { 1608 return ((PFN_WDFREQUESTGETIOQUEUE) WdfFunctions[WdfRequestGetIoQueueTableIndex])(WdfDriverGlobals, Request); 1609 } 1610 1611 // 1612 // WDF Function: WdfRequestRequeue 1613 // 1614 typedef 1615 _Must_inspect_result_ 1616 _IRQL_requires_max_(DISPATCH_LEVEL) 1617 WDFAPI 1618 NTSTATUS 1619 (*PFN_WDFREQUESTREQUEUE)( 1620 _In_ 1621 PWDF_DRIVER_GLOBALS DriverGlobals, 1622 _In_ 1623 WDFREQUEST Request 1624 ); 1625 1626 _Must_inspect_result_ 1627 _IRQL_requires_max_(DISPATCH_LEVEL) 1628 NTSTATUS 1629 FORCEINLINE 1630 WdfRequestRequeue( 1631 _In_ 1632 WDFREQUEST Request 1633 ) 1634 { 1635 return ((PFN_WDFREQUESTREQUEUE) WdfFunctions[WdfRequestRequeueTableIndex])(WdfDriverGlobals, Request); 1636 } 1637 1638 // 1639 // WDF Function: WdfRequestStopAcknowledge 1640 // 1641 typedef 1642 _IRQL_requires_max_(DISPATCH_LEVEL) 1643 WDFAPI 1644 VOID 1645 (*PFN_WDFREQUESTSTOPACKNOWLEDGE)( 1646 _In_ 1647 PWDF_DRIVER_GLOBALS DriverGlobals, 1648 _In_ 1649 WDFREQUEST Request, 1650 _In_ 1651 BOOLEAN Requeue 1652 ); 1653 1654 _IRQL_requires_max_(DISPATCH_LEVEL) 1655 VOID 1656 FORCEINLINE 1657 WdfRequestStopAcknowledge( 1658 _In_ 1659 WDFREQUEST Request, 1660 _In_ 1661 BOOLEAN Requeue 1662 ) 1663 { 1664 ((PFN_WDFREQUESTSTOPACKNOWLEDGE) WdfFunctions[WdfRequestStopAcknowledgeTableIndex])(WdfDriverGlobals, Request, Requeue); 1665 } 1666 1667 // 1668 // WDF Function: WdfRequestWdmGetIrp 1669 // 1670 typedef 1671 _IRQL_requires_max_(DISPATCH_LEVEL) 1672 WDFAPI 1673 PIRP 1674 (*PFN_WDFREQUESTWDMGETIRP)( 1675 _In_ 1676 PWDF_DRIVER_GLOBALS DriverGlobals, 1677 _In_ 1678 WDFREQUEST Request 1679 ); 1680 1681 _IRQL_requires_max_(DISPATCH_LEVEL) 1682 PIRP 1683 FORCEINLINE 1684 WdfRequestWdmGetIrp( 1685 _In_ 1686 WDFREQUEST Request 1687 ) 1688 { 1689 return ((PFN_WDFREQUESTWDMGETIRP) WdfFunctions[WdfRequestWdmGetIrpTableIndex])(WdfDriverGlobals, Request); 1690 } 1691 1692 // 1693 // WDF Function: WdfRequestIsReserved 1694 // 1695 typedef 1696 _IRQL_requires_max_(DISPATCH_LEVEL) 1697 WDFAPI 1698 BOOLEAN 1699 (*PFN_WDFREQUESTISRESERVED)( 1700 _In_ 1701 PWDF_DRIVER_GLOBALS DriverGlobals, 1702 _In_ 1703 WDFREQUEST Request 1704 ); 1705 1706 _IRQL_requires_max_(DISPATCH_LEVEL) 1707 BOOLEAN 1708 FORCEINLINE 1709 WdfRequestIsReserved( 1710 _In_ 1711 WDFREQUEST Request 1712 ) 1713 { 1714 return ((PFN_WDFREQUESTISRESERVED) WdfFunctions[WdfRequestIsReservedTableIndex])(WdfDriverGlobals, Request); 1715 } 1716 1717 // 1718 // WDF Function: WdfRequestForwardToParentDeviceIoQueue 1719 // 1720 typedef 1721 _Must_inspect_result_ 1722 _IRQL_requires_max_(DISPATCH_LEVEL) 1723 WDFAPI 1724 NTSTATUS 1725 (*PFN_WDFREQUESTFORWARDTOPARENTDEVICEIOQUEUE)( 1726 _In_ 1727 PWDF_DRIVER_GLOBALS DriverGlobals, 1728 _In_ 1729 WDFREQUEST Request, 1730 _In_ 1731 WDFQUEUE ParentDeviceQueue, 1732 _In_ 1733 PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions 1734 ); 1735 1736 _Must_inspect_result_ 1737 _IRQL_requires_max_(DISPATCH_LEVEL) 1738 NTSTATUS 1739 FORCEINLINE 1740 WdfRequestForwardToParentDeviceIoQueue( 1741 _In_ 1742 WDFREQUEST Request, 1743 _In_ 1744 WDFQUEUE ParentDeviceQueue, 1745 _In_ 1746 PWDF_REQUEST_FORWARD_OPTIONS ForwardOptions 1747 ) 1748 { 1749 return ((PFN_WDFREQUESTFORWARDTOPARENTDEVICEIOQUEUE) WdfFunctions[WdfRequestForwardToParentDeviceIoQueueTableIndex])(WdfDriverGlobals, Request, ParentDeviceQueue, ForwardOptions); 1750 } 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 #endif // (NTDDI_VERSION >= NTDDI_WIN2K) 1763 1764 1765 WDF_EXTERN_C_END 1766 1767 #endif // _WDFREQUEST_H_ 1768 1769