1 /*++
2 
3 Copyright (c) Microsoft Corporation.  All rights reserved.
4 
5 _WdfVersionBuild_
6 
7 Module Name:
8 
9     WdfDmaTransaction.h
10 
11 Abstract:
12 
13     WDF DMA Transaction support
14 
15 Environment:
16 
17     Kernel mode only.
18 
19 Notes:
20 
21 Revision History:
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 _WDFDMATRANSACTION_H_
32 #define _WDFDMATRANSACTION_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 
54 typedef
55 _Function_class_(EVT_WDF_PROGRAM_DMA)
56 _IRQL_requires_same_
57 _IRQL_requires_(DISPATCH_LEVEL)
58 BOOLEAN
59 STDCALL
60 EVT_WDF_PROGRAM_DMA(
61     _In_
62     WDFDMATRANSACTION Transaction,
63     _In_
64     WDFDEVICE Device,
65     _In_
66     WDFCONTEXT Context,
67     _In_
68     WDF_DMA_DIRECTION Direction,
69     _In_
70     PSCATTER_GATHER_LIST SgList
71     );
72 
73 typedef EVT_WDF_PROGRAM_DMA *PFN_WDF_PROGRAM_DMA;
74 
75 typedef
76 _Function_class_(EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL)
77 _IRQL_requires_same_
78 _IRQL_requires_(DISPATCH_LEVEL)
79 BOOLEAN
80 STDCALL
81 EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL(
82     _In_
83     WDFDMATRANSACTION DmaTransaction,
84     _In_
85     WDFDEVICE Device,
86     _In_
87     PVOID Context,
88     _In_opt_
89     PMDL Mdl,
90     _In_
91     size_t Offset,
92     _In_
93     size_t Length
94     );
95 
96 typedef EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL *PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL;
97 
98 typedef
99 _Function_class_(EVT_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE)
100 _IRQL_requires_same_
101 _IRQL_requires_(DISPATCH_LEVEL)
102 VOID
103 STDCALL
104 EVT_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE(
105     _In_
106     WDFDMATRANSACTION Transaction,
107     _In_
108     WDFDEVICE Device,
109     _In_
110     WDFCONTEXT Context,
111     _In_
112     WDF_DMA_DIRECTION Direction,
113     _In_
114     DMA_COMPLETION_STATUS Status
115     );
116 
117 typedef EVT_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE *PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE;
118 
119 typedef
120 _Function_class_(EVT_WDF_RESERVE_DMA)
121 _IRQL_requires_same_
122 _IRQL_requires_(DISPATCH_LEVEL)
123 VOID
124 STDCALL
125 EVT_WDF_RESERVE_DMA(
126     _In_
127     WDFDMATRANSACTION DmaTransaction,
128     _In_
129     PVOID Context
130     );
131 
132 typedef EVT_WDF_RESERVE_DMA *PFN_WDF_RESERVE_DMA;
133 
134 //
135 // WDF Function: WdfDmaTransactionCreate
136 //
137 typedef
138 _Must_inspect_result_
139 _IRQL_requires_max_(DISPATCH_LEVEL)
140 WDFAPI
141 NTSTATUS
142 (STDCALL *PFN_WDFDMATRANSACTIONCREATE)(
143     _In_
144     PWDF_DRIVER_GLOBALS DriverGlobals,
145     _In_
146     WDFDMAENABLER DmaEnabler,
147     _In_opt_
148     PWDF_OBJECT_ATTRIBUTES Attributes,
149     _Out_
150     WDFDMATRANSACTION* DmaTransaction
151     );
152 
153 _Must_inspect_result_
154 _IRQL_requires_max_(DISPATCH_LEVEL)
155 FORCEINLINE
156 NTSTATUS
157 WdfDmaTransactionCreate(
158     _In_
159     WDFDMAENABLER DmaEnabler,
160     _In_opt_
161     PWDF_OBJECT_ATTRIBUTES Attributes,
162     _Out_
163     WDFDMATRANSACTION* DmaTransaction
164     )
165 {
166     return ((PFN_WDFDMATRANSACTIONCREATE) WdfFunctions[WdfDmaTransactionCreateTableIndex])(WdfDriverGlobals, DmaEnabler, Attributes, DmaTransaction);
167 }
168 
169 //
170 // WDF Function: WdfDmaTransactionInitialize
171 //
172 typedef
173 _Must_inspect_result_
174 _IRQL_requires_max_(DISPATCH_LEVEL)
175 WDFAPI
176 NTSTATUS
177 (STDCALL *PFN_WDFDMATRANSACTIONINITIALIZE)(
178     _In_
179     PWDF_DRIVER_GLOBALS DriverGlobals,
180     _In_
181     WDFDMATRANSACTION DmaTransaction,
182     _In_
183     PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
184     _In_
185     WDF_DMA_DIRECTION DmaDirection,
186     _In_
187     PMDL Mdl,
188     _In_
189     PVOID VirtualAddress,
190     _In_
191     _When_(Length == 0, __drv_reportError(Length cannot be zero))
192     size_t Length
193     );
194 
195 _Must_inspect_result_
196 _IRQL_requires_max_(DISPATCH_LEVEL)
197 FORCEINLINE
198 NTSTATUS
199 WdfDmaTransactionInitialize(
200     _In_
201     WDFDMATRANSACTION DmaTransaction,
202     _In_
203     PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
204     _In_
205     WDF_DMA_DIRECTION DmaDirection,
206     _In_
207     PMDL Mdl,
208     _In_
209     PVOID VirtualAddress,
210     _In_
211     _When_(Length == 0, __drv_reportError(Length cannot be zero))
212     size_t Length
213     )
214 {
215     return ((PFN_WDFDMATRANSACTIONINITIALIZE) WdfFunctions[WdfDmaTransactionInitializeTableIndex])(WdfDriverGlobals, DmaTransaction, EvtProgramDmaFunction, DmaDirection, Mdl, VirtualAddress, Length);
216 }
217 
218 //
219 // WDF Function: WdfDmaTransactionInitializeUsingOffset
220 //
221 typedef
222 _Must_inspect_result_
223 _IRQL_requires_max_(DISPATCH_LEVEL)
224 WDFAPI
225 NTSTATUS
226 (STDCALL *PFN_WDFDMATRANSACTIONINITIALIZEUSINGOFFSET)(
227     _In_
228     PWDF_DRIVER_GLOBALS DriverGlobals,
229     _In_
230     WDFDMATRANSACTION DmaTransaction,
231     _In_
232     PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
233     _In_
234     WDF_DMA_DIRECTION DmaDirection,
235     _In_
236     PMDL Mdl,
237     _In_
238     size_t Offset,
239     _In_
240     _When_(Length == 0, __drv_reportError(Length cannot be zero))
241     size_t Length
242     );
243 
244 _Must_inspect_result_
245 _IRQL_requires_max_(DISPATCH_LEVEL)
246 FORCEINLINE
247 NTSTATUS
248 WdfDmaTransactionInitializeUsingOffset(
249     _In_
250     WDFDMATRANSACTION DmaTransaction,
251     _In_
252     PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
253     _In_
254     WDF_DMA_DIRECTION DmaDirection,
255     _In_
256     PMDL Mdl,
257     _In_
258     size_t Offset,
259     _In_
260     _When_(Length == 0, __drv_reportError(Length cannot be zero))
261     size_t Length
262     )
263 {
264     return ((PFN_WDFDMATRANSACTIONINITIALIZEUSINGOFFSET) WdfFunctions[WdfDmaTransactionInitializeUsingOffsetTableIndex])(WdfDriverGlobals, DmaTransaction, EvtProgramDmaFunction, DmaDirection, Mdl, Offset, Length);
265 }
266 
267 //
268 // WDF Function: WdfDmaTransactionInitializeUsingRequest
269 //
270 typedef
271 _Must_inspect_result_
272 _IRQL_requires_max_(DISPATCH_LEVEL)
273 WDFAPI
274 NTSTATUS
275 (STDCALL *PFN_WDFDMATRANSACTIONINITIALIZEUSINGREQUEST)(
276     _In_
277     PWDF_DRIVER_GLOBALS DriverGlobals,
278     _In_
279     WDFDMATRANSACTION DmaTransaction,
280     _In_
281     WDFREQUEST Request,
282     _In_
283     PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
284     _In_
285     WDF_DMA_DIRECTION DmaDirection
286     );
287 
288 _Must_inspect_result_
289 _IRQL_requires_max_(DISPATCH_LEVEL)
290 FORCEINLINE
291 NTSTATUS
292 WdfDmaTransactionInitializeUsingRequest(
293     _In_
294     WDFDMATRANSACTION DmaTransaction,
295     _In_
296     WDFREQUEST Request,
297     _In_
298     PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction,
299     _In_
300     WDF_DMA_DIRECTION DmaDirection
301     )
302 {
303     return ((PFN_WDFDMATRANSACTIONINITIALIZEUSINGREQUEST) WdfFunctions[WdfDmaTransactionInitializeUsingRequestTableIndex])(WdfDriverGlobals, DmaTransaction, Request, EvtProgramDmaFunction, DmaDirection);
304 }
305 
306 //
307 // WDF Function: WdfDmaTransactionExecute
308 //
309 typedef
310 _Must_inspect_result_
311 _IRQL_requires_max_(DISPATCH_LEVEL)
312 WDFAPI
313 NTSTATUS
314 (STDCALL *PFN_WDFDMATRANSACTIONEXECUTE)(
315     _In_
316     PWDF_DRIVER_GLOBALS DriverGlobals,
317     _In_
318     WDFDMATRANSACTION DmaTransaction,
319     _In_opt_
320     WDFCONTEXT Context
321     );
322 
323 _Must_inspect_result_
324 _IRQL_requires_max_(DISPATCH_LEVEL)
325 FORCEINLINE
326 NTSTATUS
327 WdfDmaTransactionExecute(
328     _In_
329     WDFDMATRANSACTION DmaTransaction,
330     _In_opt_
331     WDFCONTEXT Context
332     )
333 {
334     return ((PFN_WDFDMATRANSACTIONEXECUTE) WdfFunctions[WdfDmaTransactionExecuteTableIndex])(WdfDriverGlobals, DmaTransaction, Context);
335 }
336 
337 //
338 // WDF Function: WdfDmaTransactionRelease
339 //
340 typedef
341 _Success_(TRUE)
342 _IRQL_requires_max_(DISPATCH_LEVEL)
343 WDFAPI
344 NTSTATUS
345 (STDCALL *PFN_WDFDMATRANSACTIONRELEASE)(
346     _In_
347     PWDF_DRIVER_GLOBALS DriverGlobals,
348     _In_
349     WDFDMATRANSACTION DmaTransaction
350     );
351 
352 _Success_(TRUE)
353 _IRQL_requires_max_(DISPATCH_LEVEL)
354 FORCEINLINE
355 NTSTATUS
356 WdfDmaTransactionRelease(
357     _In_
358     WDFDMATRANSACTION DmaTransaction
359     )
360 {
361     return ((PFN_WDFDMATRANSACTIONRELEASE) WdfFunctions[WdfDmaTransactionReleaseTableIndex])(WdfDriverGlobals, DmaTransaction);
362 }
363 
364 //
365 // WDF Function: WdfDmaTransactionDmaCompleted
366 //
367 typedef
368 _IRQL_requires_max_(DISPATCH_LEVEL)
369 WDFAPI
370 BOOLEAN
371 (STDCALL *PFN_WDFDMATRANSACTIONDMACOMPLETED)(
372     _In_
373     PWDF_DRIVER_GLOBALS DriverGlobals,
374     _In_
375     WDFDMATRANSACTION DmaTransaction,
376     _Out_
377     NTSTATUS* Status
378     );
379 
380 _IRQL_requires_max_(DISPATCH_LEVEL)
381 FORCEINLINE
382 BOOLEAN
383 WdfDmaTransactionDmaCompleted(
384     _In_
385     WDFDMATRANSACTION DmaTransaction,
386     _Out_
387     NTSTATUS* Status
388     )
389 {
390     return ((PFN_WDFDMATRANSACTIONDMACOMPLETED) WdfFunctions[WdfDmaTransactionDmaCompletedTableIndex])(WdfDriverGlobals, DmaTransaction, Status);
391 }
392 
393 //
394 // WDF Function: WdfDmaTransactionDmaCompletedWithLength
395 //
396 typedef
397 _IRQL_requires_max_(DISPATCH_LEVEL)
398 WDFAPI
399 BOOLEAN
400 (STDCALL *PFN_WDFDMATRANSACTIONDMACOMPLETEDWITHLENGTH)(
401     _In_
402     PWDF_DRIVER_GLOBALS DriverGlobals,
403     _In_
404     WDFDMATRANSACTION DmaTransaction,
405     _In_
406     size_t TransferredLength,
407     _Out_
408     NTSTATUS* Status
409     );
410 
411 _IRQL_requires_max_(DISPATCH_LEVEL)
412 FORCEINLINE
413 BOOLEAN
414 WdfDmaTransactionDmaCompletedWithLength(
415     _In_
416     WDFDMATRANSACTION DmaTransaction,
417     _In_
418     size_t TransferredLength,
419     _Out_
420     NTSTATUS* Status
421     )
422 {
423     return ((PFN_WDFDMATRANSACTIONDMACOMPLETEDWITHLENGTH) WdfFunctions[WdfDmaTransactionDmaCompletedWithLengthTableIndex])(WdfDriverGlobals, DmaTransaction, TransferredLength, Status);
424 }
425 
426 //
427 // WDF Function: WdfDmaTransactionDmaCompletedFinal
428 //
429 typedef
430 _IRQL_requires_max_(DISPATCH_LEVEL)
431 WDFAPI
432 BOOLEAN
433 (STDCALL *PFN_WDFDMATRANSACTIONDMACOMPLETEDFINAL)(
434     _In_
435     PWDF_DRIVER_GLOBALS DriverGlobals,
436     _In_
437     WDFDMATRANSACTION DmaTransaction,
438     _In_
439     size_t FinalTransferredLength,
440     _Out_
441     NTSTATUS* Status
442     );
443 
444 _IRQL_requires_max_(DISPATCH_LEVEL)
445 FORCEINLINE
446 BOOLEAN
447 WdfDmaTransactionDmaCompletedFinal(
448     _In_
449     WDFDMATRANSACTION DmaTransaction,
450     _In_
451     size_t FinalTransferredLength,
452     _Out_
453     NTSTATUS* Status
454     )
455 {
456     return ((PFN_WDFDMATRANSACTIONDMACOMPLETEDFINAL) WdfFunctions[WdfDmaTransactionDmaCompletedFinalTableIndex])(WdfDriverGlobals, DmaTransaction, FinalTransferredLength, Status);
457 }
458 
459 //
460 // WDF Function: WdfDmaTransactionGetBytesTransferred
461 //
462 typedef
463 _IRQL_requires_max_(DISPATCH_LEVEL)
464 WDFAPI
465 size_t
466 (STDCALL *PFN_WDFDMATRANSACTIONGETBYTESTRANSFERRED)(
467     _In_
468     PWDF_DRIVER_GLOBALS DriverGlobals,
469     _In_
470     WDFDMATRANSACTION DmaTransaction
471     );
472 
473 _IRQL_requires_max_(DISPATCH_LEVEL)
474 FORCEINLINE
475 size_t
476 WdfDmaTransactionGetBytesTransferred(
477     _In_
478     WDFDMATRANSACTION DmaTransaction
479     )
480 {
481     return ((PFN_WDFDMATRANSACTIONGETBYTESTRANSFERRED) WdfFunctions[WdfDmaTransactionGetBytesTransferredTableIndex])(WdfDriverGlobals, DmaTransaction);
482 }
483 
484 //
485 // WDF Function: WdfDmaTransactionSetMaximumLength
486 //
487 typedef
488 _IRQL_requires_max_(DISPATCH_LEVEL)
489 WDFAPI
490 VOID
491 (STDCALL *PFN_WDFDMATRANSACTIONSETMAXIMUMLENGTH)(
492     _In_
493     PWDF_DRIVER_GLOBALS DriverGlobals,
494     _In_
495     WDFDMATRANSACTION DmaTransaction,
496     _In_
497     size_t MaximumLength
498     );
499 
500 _IRQL_requires_max_(DISPATCH_LEVEL)
501 FORCEINLINE
502 VOID
503 WdfDmaTransactionSetMaximumLength(
504     _In_
505     WDFDMATRANSACTION DmaTransaction,
506     _In_
507     size_t MaximumLength
508     )
509 {
510     ((PFN_WDFDMATRANSACTIONSETMAXIMUMLENGTH) WdfFunctions[WdfDmaTransactionSetMaximumLengthTableIndex])(WdfDriverGlobals, DmaTransaction, MaximumLength);
511 }
512 
513 //
514 // WDF Function: WdfDmaTransactionGetRequest
515 //
516 typedef
517 _IRQL_requires_max_(DISPATCH_LEVEL)
518 WDFAPI
519 WDFREQUEST
520 (STDCALL *PFN_WDFDMATRANSACTIONGETREQUEST)(
521     _In_
522     PWDF_DRIVER_GLOBALS DriverGlobals,
523     _In_
524     WDFDMATRANSACTION DmaTransaction
525     );
526 
527 _IRQL_requires_max_(DISPATCH_LEVEL)
528 FORCEINLINE
529 WDFREQUEST
530 WdfDmaTransactionGetRequest(
531     _In_
532     WDFDMATRANSACTION DmaTransaction
533     )
534 {
535     return ((PFN_WDFDMATRANSACTIONGETREQUEST) WdfFunctions[WdfDmaTransactionGetRequestTableIndex])(WdfDriverGlobals, DmaTransaction);
536 }
537 
538 //
539 // WDF Function: WdfDmaTransactionGetCurrentDmaTransferLength
540 //
541 typedef
542 _IRQL_requires_max_(DISPATCH_LEVEL)
543 WDFAPI
544 size_t
545 (STDCALL *PFN_WDFDMATRANSACTIONGETCURRENTDMATRANSFERLENGTH)(
546     _In_
547     PWDF_DRIVER_GLOBALS DriverGlobals,
548     _In_
549     WDFDMATRANSACTION DmaTransaction
550     );
551 
552 _IRQL_requires_max_(DISPATCH_LEVEL)
553 FORCEINLINE
554 size_t
555 WdfDmaTransactionGetCurrentDmaTransferLength(
556     _In_
557     WDFDMATRANSACTION DmaTransaction
558     )
559 {
560     return ((PFN_WDFDMATRANSACTIONGETCURRENTDMATRANSFERLENGTH) WdfFunctions[WdfDmaTransactionGetCurrentDmaTransferLengthTableIndex])(WdfDriverGlobals, DmaTransaction);
561 }
562 
563 //
564 // WDF Function: WdfDmaTransactionGetDevice
565 //
566 typedef
567 _IRQL_requires_max_(DISPATCH_LEVEL)
568 WDFAPI
569 WDFDEVICE
570 (STDCALL *PFN_WDFDMATRANSACTIONGETDEVICE)(
571     _In_
572     PWDF_DRIVER_GLOBALS DriverGlobals,
573     _In_
574     WDFDMATRANSACTION DmaTransaction
575     );
576 
577 _IRQL_requires_max_(DISPATCH_LEVEL)
578 FORCEINLINE
579 WDFDEVICE
580 WdfDmaTransactionGetDevice(
581     _In_
582     WDFDMATRANSACTION DmaTransaction
583     )
584 {
585     return ((PFN_WDFDMATRANSACTIONGETDEVICE) WdfFunctions[WdfDmaTransactionGetDeviceTableIndex])(WdfDriverGlobals, DmaTransaction);
586 }
587 
588 //
589 // WDF Function: WdfDmaTransactionGetTransferInfo
590 //
591 typedef
592 _IRQL_requires_max_(DISPATCH_LEVEL)
593 WDFAPI
594 VOID
595 (STDCALL *PFN_WDFDMATRANSACTIONGETTRANSFERINFO)(
596     _In_
597     PWDF_DRIVER_GLOBALS DriverGlobals,
598     _In_
599     WDFDMATRANSACTION DmaTransaction,
600     _Out_opt_
601     ULONG* MapRegisterCount,
602     _Out_opt_
603     ULONG* ScatterGatherElementCount
604     );
605 
606 _IRQL_requires_max_(DISPATCH_LEVEL)
607 FORCEINLINE
608 VOID
609 WdfDmaTransactionGetTransferInfo(
610     _In_
611     WDFDMATRANSACTION DmaTransaction,
612     _Out_opt_
613     ULONG* MapRegisterCount,
614     _Out_opt_
615     ULONG* ScatterGatherElementCount
616     )
617 {
618     ((PFN_WDFDMATRANSACTIONGETTRANSFERINFO) WdfFunctions[WdfDmaTransactionGetTransferInfoTableIndex])(WdfDriverGlobals, DmaTransaction, MapRegisterCount, ScatterGatherElementCount);
619 }
620 
621 //
622 // WDF Function: WdfDmaTransactionSetChannelConfigurationCallback
623 //
624 typedef
625 _IRQL_requires_max_(DISPATCH_LEVEL)
626 WDFAPI
627 VOID
628 (STDCALL *PFN_WDFDMATRANSACTIONSETCHANNELCONFIGURATIONCALLBACK)(
629     _In_
630     PWDF_DRIVER_GLOBALS DriverGlobals,
631     _In_
632     WDFDMATRANSACTION DmaTransaction,
633     _In_opt_
634     PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL ConfigureRoutine,
635     _In_opt_
636     PVOID ConfigureContext
637     );
638 
639 _IRQL_requires_max_(DISPATCH_LEVEL)
640 FORCEINLINE
641 VOID
642 WdfDmaTransactionSetChannelConfigurationCallback(
643     _In_
644     WDFDMATRANSACTION DmaTransaction,
645     _In_opt_
646     PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL ConfigureRoutine,
647     _In_opt_
648     PVOID ConfigureContext
649     )
650 {
651     ((PFN_WDFDMATRANSACTIONSETCHANNELCONFIGURATIONCALLBACK) WdfFunctions[WdfDmaTransactionSetChannelConfigurationCallbackTableIndex])(WdfDriverGlobals, DmaTransaction, ConfigureRoutine, ConfigureContext);
652 }
653 
654 //
655 // WDF Function: WdfDmaTransactionSetTransferCompleteCallback
656 //
657 typedef
658 _IRQL_requires_max_(DISPATCH_LEVEL)
659 WDFAPI
660 VOID
661 (STDCALL *PFN_WDFDMATRANSACTIONSETTRANSFERCOMPLETECALLBACK)(
662     _In_
663     PWDF_DRIVER_GLOBALS DriverGlobals,
664     _In_
665     WDFDMATRANSACTION DmaTransaction,
666     _In_opt_
667     PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE DmaCompletionRoutine,
668     _In_opt_
669     PVOID DmaCompletionContext
670     );
671 
672 _IRQL_requires_max_(DISPATCH_LEVEL)
673 FORCEINLINE
674 VOID
675 WdfDmaTransactionSetTransferCompleteCallback(
676     _In_
677     WDFDMATRANSACTION DmaTransaction,
678     _In_opt_
679     PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE DmaCompletionRoutine,
680     _In_opt_
681     PVOID DmaCompletionContext
682     )
683 {
684     ((PFN_WDFDMATRANSACTIONSETTRANSFERCOMPLETECALLBACK) WdfFunctions[WdfDmaTransactionSetTransferCompleteCallbackTableIndex])(WdfDriverGlobals, DmaTransaction, DmaCompletionRoutine, DmaCompletionContext);
685 }
686 
687 //
688 // WDF Function: WdfDmaTransactionSetImmediateExecution
689 //
690 typedef
691 _IRQL_requires_max_(DISPATCH_LEVEL)
692 WDFAPI
693 VOID
694 (STDCALL *PFN_WDFDMATRANSACTIONSETIMMEDIATEEXECUTION)(
695     _In_
696     PWDF_DRIVER_GLOBALS DriverGlobals,
697     _In_
698     WDFDMATRANSACTION DmaTransaction,
699     _In_
700     BOOLEAN UseImmediateExecution
701     );
702 
703 _IRQL_requires_max_(DISPATCH_LEVEL)
704 FORCEINLINE
705 VOID
706 WdfDmaTransactionSetImmediateExecution(
707     _In_
708     WDFDMATRANSACTION DmaTransaction,
709     _In_
710     BOOLEAN UseImmediateExecution
711     )
712 {
713     ((PFN_WDFDMATRANSACTIONSETIMMEDIATEEXECUTION) WdfFunctions[WdfDmaTransactionSetImmediateExecutionTableIndex])(WdfDriverGlobals, DmaTransaction, UseImmediateExecution);
714 }
715 
716 //
717 // WDF Function: WdfDmaTransactionAllocateResources
718 //
719 typedef
720 _IRQL_requires_max_(DISPATCH_LEVEL)
721 WDFAPI
722 NTSTATUS
723 (STDCALL *PFN_WDFDMATRANSACTIONALLOCATERESOURCES)(
724     _In_
725     PWDF_DRIVER_GLOBALS DriverGlobals,
726     _In_
727     WDFDMATRANSACTION DmaTransaction,
728     _In_
729     WDF_DMA_DIRECTION DmaDirection,
730     _In_
731     ULONG RequiredMapRegisters,
732     _In_
733     PFN_WDF_RESERVE_DMA EvtReserveDmaFunction,
734     _In_
735     PVOID EvtReserveDmaContext
736     );
737 
738 _IRQL_requires_max_(DISPATCH_LEVEL)
739 FORCEINLINE
740 NTSTATUS
741 WdfDmaTransactionAllocateResources(
742     _In_
743     WDFDMATRANSACTION DmaTransaction,
744     _In_
745     WDF_DMA_DIRECTION DmaDirection,
746     _In_
747     ULONG RequiredMapRegisters,
748     _In_
749     PFN_WDF_RESERVE_DMA EvtReserveDmaFunction,
750     _In_
751     PVOID EvtReserveDmaContext
752     )
753 {
754     return ((PFN_WDFDMATRANSACTIONALLOCATERESOURCES) WdfFunctions[WdfDmaTransactionAllocateResourcesTableIndex])(WdfDriverGlobals, DmaTransaction, DmaDirection, RequiredMapRegisters, EvtReserveDmaFunction, EvtReserveDmaContext);
755 }
756 
757 //
758 // WDF Function: WdfDmaTransactionSetDeviceAddressOffset
759 //
760 typedef
761 _IRQL_requires_max_(DISPATCH_LEVEL)
762 WDFAPI
763 VOID
764 (STDCALL *PFN_WDFDMATRANSACTIONSETDEVICEADDRESSOFFSET)(
765     _In_
766     PWDF_DRIVER_GLOBALS DriverGlobals,
767     _In_
768     WDFDMATRANSACTION DmaTransaction,
769     _In_
770     ULONG Offset
771     );
772 
773 _IRQL_requires_max_(DISPATCH_LEVEL)
774 FORCEINLINE
775 VOID
776 WdfDmaTransactionSetDeviceAddressOffset(
777     _In_
778     WDFDMATRANSACTION DmaTransaction,
779     _In_
780     ULONG Offset
781     )
782 {
783     ((PFN_WDFDMATRANSACTIONSETDEVICEADDRESSOFFSET) WdfFunctions[WdfDmaTransactionSetDeviceAddressOffsetTableIndex])(WdfDriverGlobals, DmaTransaction, Offset);
784 }
785 
786 //
787 // WDF Function: WdfDmaTransactionFreeResources
788 //
789 typedef
790 _IRQL_requires_max_(DISPATCH_LEVEL)
791 WDFAPI
792 VOID
793 (STDCALL *PFN_WDFDMATRANSACTIONFREERESOURCES)(
794     _In_
795     PWDF_DRIVER_GLOBALS DriverGlobals,
796     _In_
797     WDFDMATRANSACTION DmaTransaction
798     );
799 
800 _IRQL_requires_max_(DISPATCH_LEVEL)
801 FORCEINLINE
802 VOID
803 WdfDmaTransactionFreeResources(
804     _In_
805     WDFDMATRANSACTION DmaTransaction
806     )
807 {
808     ((PFN_WDFDMATRANSACTIONFREERESOURCES) WdfFunctions[WdfDmaTransactionFreeResourcesTableIndex])(WdfDriverGlobals, DmaTransaction);
809 }
810 
811 //
812 // WDF Function: WdfDmaTransactionCancel
813 //
814 typedef
815 _IRQL_requires_max_(DISPATCH_LEVEL)
816 WDFAPI
817 BOOLEAN
818 (STDCALL *PFN_WDFDMATRANSACTIONCANCEL)(
819     _In_
820     PWDF_DRIVER_GLOBALS DriverGlobals,
821     _In_
822     WDFDMATRANSACTION DmaTransaction
823     );
824 
825 _IRQL_requires_max_(DISPATCH_LEVEL)
826 FORCEINLINE
827 BOOLEAN
828 WdfDmaTransactionCancel(
829     _In_
830     WDFDMATRANSACTION DmaTransaction
831     )
832 {
833     return ((PFN_WDFDMATRANSACTIONCANCEL) WdfFunctions[WdfDmaTransactionCancelTableIndex])(WdfDriverGlobals, DmaTransaction);
834 }
835 
836 //
837 // WDF Function: WdfDmaTransactionWdmGetTransferContext
838 //
839 typedef
840 _IRQL_requires_max_(DISPATCH_LEVEL)
841 WDFAPI
842 PVOID
843 (STDCALL *PFN_WDFDMATRANSACTIONWDMGETTRANSFERCONTEXT)(
844     _In_
845     PWDF_DRIVER_GLOBALS DriverGlobals,
846     _In_
847     WDFDMATRANSACTION DmaTransaction
848     );
849 
850 _IRQL_requires_max_(DISPATCH_LEVEL)
851 FORCEINLINE
852 PVOID
853 WdfDmaTransactionWdmGetTransferContext(
854     _In_
855     WDFDMATRANSACTION DmaTransaction
856     )
857 {
858     return ((PFN_WDFDMATRANSACTIONWDMGETTRANSFERCONTEXT) WdfFunctions[WdfDmaTransactionWdmGetTransferContextTableIndex])(WdfDriverGlobals, DmaTransaction);
859 }
860 
861 //
862 // WDF Function: WdfDmaTransactionStopSystemTransfer
863 //
864 typedef
865 _IRQL_requires_max_(DISPATCH_LEVEL)
866 WDFAPI
867 VOID
868 (STDCALL *PFN_WDFDMATRANSACTIONSTOPSYSTEMTRANSFER)(
869     _In_
870     PWDF_DRIVER_GLOBALS DriverGlobals,
871     _In_
872     WDFDMATRANSACTION DmaTransaction
873     );
874 
875 _IRQL_requires_max_(DISPATCH_LEVEL)
876 FORCEINLINE
877 VOID
878 WdfDmaTransactionStopSystemTransfer(
879     _In_
880     WDFDMATRANSACTION DmaTransaction
881     )
882 {
883     ((PFN_WDFDMATRANSACTIONSTOPSYSTEMTRANSFER) WdfFunctions[WdfDmaTransactionStopSystemTransferTableIndex])(WdfDriverGlobals, DmaTransaction);
884 }
885 
886 
887 
888 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
889 
890 
891 WDF_EXTERN_C_END
892 
893 #endif // _WDFDMATRANSACTION_H_
894 
895