ReactOS 0.4.15-dev-7958-gcd0bb1a
fxdmatransactionapi.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxDmaTransactionAPI.cpp
8
9Abstract:
10
11 Base for WDF DMA Transaction APIs
12
13Environment:
14
15 Kernel mode only.
16
17Notes:
18
19
20Revision History:
21
22--*/
23
24#include "fxdmapch.hpp"
25
26extern "C" {
27// #include "FxDmaTransactionAPI.tmh"
28}
29
30//
31// Extern "C" the entire file
32//
33extern "C" {
34
38WDFEXPORT(WdfDmaTransactionCreate)(
39 __in
41 __in
42 WDFDMAENABLER DmaEnabler,
45 __out
46 WDFDMATRANSACTION * DmaTransactionHandle
47 )
48{
52
56 (PVOID *) &pDmaEnabler,
58
60
62
66 );
68 return status;
69 }
70
72 {
79 break;
80
90 );
91 break;
92
99 break;
100
101 default:
102 NT_ASSERTMSG("Unknown profile for DMA enabler", FALSE);
104 break;
105 }
106
107 return status;
108}
109
113WDFEXPORT(WdfDmaTransactionInitializeUsingRequest)(
114 __in
116 __in
117 WDFDMATRANSACTION DmaTransaction,
118 __in
119 WDFREQUEST Request,
120 __in
122 __in
124 )
125{
133
137 (PVOID *) &pDmaTrans,
139
141
147 "Initialization of WDFDMATRANSACTION 0x%p using WDFREQUEST %p, "
148 "DmaDirection 0x%x is an invalid value, %!STATUS!",
150 return status;
151 }
152
154 Request,
156 (PVOID *) &pReqObj);
157
158 reqLength = 0;
159
161
162 //
163 // Get the MDL and Length from the request.
164 //
165 switch (stack->MajorFunction) {
166
167 case IRP_MJ_READ:
168
171
173 "Dma direction %!WDF_DMA_DIRECTION! of WDFTRANSACTION "
174 "0x%p doesn't match with the WDFREQUEST 0x%p type "
175 "%!WDF_REQUEST_TYPE! %!STATUS!",
177 stack->MajorFunction, status);
178
179 return status;
180 }
181
182 reqLength = stack->Parameters.Read.Length;
183
185 break;
186
187 case IRP_MJ_WRITE:
188
191
193 "Dma direction %!WDF_DMA_DIRECTION! of WDFTRANSACTION "
194 "0x%p doesn't match with the WDFREQUEST 0x%p type "
195 "%!WDF_REQUEST_TYPE! %!STATUS!",
197 stack->MajorFunction, status);
198
199 return status;
200 }
201
202 reqLength = stack->Parameters.Write.Length;
203
205 break;
206
209
210 switch (METHOD_FROM_CTL_CODE(stack->Parameters.DeviceIoControl.IoControlCode)) {
211 case METHOD_BUFFERED:
212
214 reqLength = stack->Parameters.DeviceIoControl.InputBufferLength;
215 } else {
216 reqLength = stack->Parameters.DeviceIoControl.OutputBufferLength;
217 }
218
219 //
220 // In this case both input buffer and output buffer map
221 // to the same MDL and it's probed for read & write access.
222 // So it's okay for DMA transfer in either direction.
223 //
225 break;
226
227 case METHOD_IN_DIRECT:
228 //
229 // For this type, the output buffer is probed for read access.
230 // So the direction of DMA transfer is WdfDmaDirectionWriteToDevice.
231 //
233
235
238 "Dma direction %!WDF_DMA_DIRECTION! of WDFTRANSACTION "
239 "0x%p doesn't match with WDFREQUEST 0x%p ioctl type "
240 "METHOD_IN_DIRECT %!STATUS!",
242 return status;
243 }
244
245 reqLength = stack->Parameters.DeviceIoControl.OutputBufferLength;
246
248
249 break;
250
252 //
253 // For this type, the output buffer is probed for write access.
254 // So the direction of DMA transfer is WdfDmaDirectionReadFromDevice.
255 //
257
259
262 "Dma direction %!WDF_DMA_DIRECTION! of WDFTRANSACTION "
263 "0x%p doesn't match with WDFREQUEST 0x%p ioctl type "
264 "METHOD_OUT_DIRECT %!STATUS!",
266
267 return status;
268 }
269
270 reqLength = stack->Parameters.DeviceIoControl.OutputBufferLength;
271
273
274 break;
275 default:
276
278
280 "Invalid ioctl code in WDFREQUEST 0x%p %!STATUS!",
281 Request, status);
282
284 break;
285
286 }// End of switch(ioctType)
287 break;
288
289 default:
291 break;
292
293 }
294
295 if (!NT_SUCCESS(status)) {
297 "Couldn't retrieve mdl from WDFREQUEST 0x%p for "
298 "WDFTRANSACTION 0x%p %!STATUS!",
300 return status;
301 }
302
303 if (reqLength == 0) {
307 "Zero length request, %!STATUS!", status);
308 return status;
309 }
310
311 //
312 // If the DMA enabler is packet based, make sure the virtual address and
313 // the length of transfer are within bounds. Basically, we are checking
314 // to see if the length of data to be transferred doesn't span multiple
315 // MDLs, because packet based DMA doesn't support chained MDLs.
316 //
319
321
322 if (reqLength > length) {
326 "WDFREQUEST %p transfer length (%d) is out of bounds of MDL "
327 "Byte count (%d), %!STATUS!",
329
330 return status;
331 }
332 }
333
334 //
335 // Parms appear OK, so initialize this instance.
336 //
339 mdl,
340 0,
341 reqLength);
342
343 if (!NT_SUCCESS(status)) {
345 "WDFTANSACTION 0x%p initialization failed: "
346 "%!STATUS!", DmaTransaction, status);
347 return status;
348 }
349
350 //
351 // Set this Request in the new DmaTransaction. The request will
352 // take a reference on this request when it starts executing.
353 //
355
357}
358
359
363WDFEXPORT(WdfDmaTransactionInitializeUsingOffset)(
364 __in
366 __in
367 WDFDMATRANSACTION DmaTransaction,
368 __in
370 __in
372 __in
374 __in
375 size_t Offset,
376 __in
378 size_t Length
379 )
380{
381 //
382 // Stub this out by calling the regular initialize method. Eventually
383 // the regular initialize method will call this instead.
384 //
385
386 return WDFEXPORT(WdfDmaTransactionInitialize)(
391 Mdl,
393 Length
394 );
395}
396
400WDFEXPORT(WdfDmaTransactionInitialize)(
401 __in
403 __in
404 WDFDMATRANSACTION DmaTransaction,
405 __in
407 __in
409 __in
410 PMDL Mdl,
411
412 //__drv_when(DmaDirection == WdfDmaDirectionReadFromDevice, __out_bcount(Length))
413 //__drv_when(DmaDirection == WdfDmaDirectionWriteToDevice, __in_bcount(Length))
414 __in
416 __in
418 size_t Length
419 )
420{
423 PUCHAR pVA;
424 ULONG mdlLength;
426
430 (PVOID *) &pDmaTrans,
432
435
436 if (Length == 0) {
439 "Can't initialize WDFDMATRANSACTION 0x%p with "
440 "zero length transfer", DmaTransaction);
441 return status;
442 }
443
449 "Initialization of WDFDMATRANSACTION 0x%p,DmaDirection 0x%x is an "
450 "invalid value, %!STATUS!", DmaTransaction, DmaDirection, status);
451 return status;
452 }
453
454 //
455 // Make sure the VirtualAddress is within the first MDL bounds.
456 //
458 mdlLength = MmGetMdlByteCount(Mdl);
459
460 if (VirtualAddress < pVA ||
461 VirtualAddress >= WDF_PTR_ADD_OFFSET(pVA, mdlLength)) {
465 "VirtualAddress %p is not within the Mdl bounds, StartVA (%p) + "
466 "ByteCount (0x%x), %!STATUS! ",
467 VirtualAddress, pVA, mdlLength, status);
468
469 return status;
470 }
471
472 //
473 // Get the DmaEnabler
474 //
478 (PVOID *) &pDmaTrans);
479
481 //
482 // Make sure the MDL is not a chained MDL by checking
483 // to see if the virtual address and the length
484 // are within bounds.
485 //
487 WDF_PTR_ADD_OFFSET(pVA, mdlLength)) {
491 "VirtualAddress+Length (%p+%I64d) is out of bounds of MDL VA + MDL "
492 "Byte count (max address is %p). "
493 "Possibly a chained MDL, %!STATUS!",
495 WDF_PTR_ADD_OFFSET(pVA, mdlLength), status);
496
497 return status;
498 }
499 }
500
503 Mdl,
507 ),
508 (ULONG) Length);
509
510 if (!NT_SUCCESS(status)) {
512 "WDFTANSACTION 0x%p initialization failed: "
513 "%!STATUS!", DmaTransaction, status);
514 }
515
516 return status;
517}
518
519
523WDFEXPORT(WdfDmaTransactionExecute)(
524 __in
526 __in
527 WDFDMATRANSACTION DmaTransaction,
530 )
531{
533
537 (PVOID *) &pDmaTrans);
538
540}
541
545WDFEXPORT(WdfDmaTransactionRelease)(
546 __in
548 __in
549 WDFDMATRANSACTION DmaTransaction
550 )
551{
553
557 (PVOID *) &pDmaTrans);
558
559 //
560 // Release map registers allocated for this specific transaction,
561 // but not map registers which were allocated through
562 // AllocateResources.
563 //
565 return STATUS_SUCCESS;
566}
567
568
571WDFEXPORT(WdfDmaTransactionDmaCompleted)(
572 __in
574 __in
575 WDFDMATRANSACTION DmaTransaction,
576 __out
578 )
579{
581
585 (PVOID *) &pDmaTrans);
586
588
589
590 //
591 // Indicate this DMA has been completed.
592 //
594}
595
598WDFEXPORT(WdfDmaTransactionDmaCompletedWithLength)(
599 __in
601 __in
602 WDFDMATRANSACTION DmaTransaction,
603 __in
605 __out
607 )
608{
610
614 (PVOID *) &pDmaTrans);
615
617
618 //
619 // Indicate this DMA transfer has been completed.
620 //
622 pStatus,
624}
625
628WDFEXPORT(WdfDmaTransactionDmaCompletedFinal)(
629 __in
631 __in
632 WDFDMATRANSACTION DmaTransaction,
633 __in
635 __out
637 )
638{
640
644 (PVOID *) &pDmaTrans);
645
647
648 //
649 // Indicate this DMA FinalLength has completed.
650 //
652 pStatus,
654}
655
656
658size_t
659WDFEXPORT(WdfDmaTransactionGetBytesTransferred)(
660 __in
662 __in
663 WDFDMATRANSACTION DmaTransaction
664 )
665{
667
671 (PVOID *) &pDmaTrans);
672
674}
675
677VOID
678WDFEXPORT(WdfDmaTransactionSetMaximumLength)(
679 __in
681 __in
682 WDFDMATRANSACTION DmaTransaction,
683 __in
685 )
686{
688
692 (PVOID *) &pDmaTrans);
693
695}
696
698WDFREQUEST
699WDFEXPORT(WdfDmaTransactionGetRequest)(
700 __in
702 __in
703 WDFDMATRANSACTION DmaTransaction
704 )
705{
708
712 (PVOID *) &pDmaTrans);
713
715
716 if (pRequest != NULL) {
717 return pRequest->GetHandle();
718 }
719 else {
720 return NULL;
721 }
722}
723
725size_t
726WDFEXPORT(WdfDmaTransactionGetCurrentDmaTransferLength)(
727 __in
729 __in
730 WDFDMATRANSACTION DmaTransaction
731 )
732{
734
738 (PVOID *) &pDmaTrans);
739
741}
742
743
745WDFDEVICE
746WDFEXPORT(WdfDmaTransactionGetDevice)(
747 __in
749 __in
750 WDFDMATRANSACTION DmaTransaction
751 )
752{
754
758 (PVOID *) &pDmaTrans);
759
761}
762
764VOID
765WDFEXPORT(WdfDmaTransactionSetChannelConfigurationCallback)(
766 __in
768 __in
769 WDFDMATRANSACTION DmaTransaction,
774 )
775{
778
782 (PVOID *) &pDmaTrans,
784
785 //
786 // Verify that the transaction belongs to a system profile enabler.
787 //
788
793 "Cannot call %!FUNC! on non-system-profile "
794 "WDFDMATRANSACTION (%p) (transaction profile "
795 "is %!WDF_DMA_PROFILE!).",
797 profile);
799 return;
800 }
801
802 //
803 // Cast the transaction to the right sub-type now that we've verified the
804 // profile.
805 //
806
810}
811
813VOID
814WDFEXPORT(WdfDmaTransactionSetTransferCompleteCallback)(
815 __in
817 __in
818 WDFDMATRANSACTION DmaTransaction,
823 )
824{
827
831 (PVOID *) &pDmaTrans,
833
834 //
835 // Verify that the transaction belongs to a system profile enabler.
836 //
837
839 if ((profile != WdfDmaProfileSystem) &&
842 "Cannot call %!FUNC! on non-system-profile "
843 "WDFDMATRANSACTION (%p) (transaction profile "
844 "is %!WDF_DMA_PROFILE!).",
846 profile);
848 return;
849 }
850
851 //
852 // Cast the transaction to the right sub-type now that we've verified the
853 // profile.
854 //
855
859
860}
861
863VOID
864WDFEXPORT(WdfDmaTransactionSetDeviceAddressOffset)(
865 __in
867 __in
868 WDFDMATRANSACTION DmaTransaction,
869 __in
871 )
872{
875
879 (PVOID *) &pDmaTrans,
881
882 //
883 // Verify that the transaction belongs to a system profile enabler.
884 //
885
887 if ((profile != WdfDmaProfileSystem) &&
890 "Cannot call %!FUNC! on non-system-profile "
891 "WDFDMATRANSACTION (%p) (transaction profile "
892 "is %!WDF_DMA_PROFILE!).",
894 profile);
896 return;
897 }
898
899 //
900 // Cast the transaction to the right sub-type now that we've verified the
901 // profile.
902 //
903
906}
907
909PVOID
910WDFEXPORT(WdfDmaTransactionWdmGetTransferContext)(
911 __in
913 __in
914 WDFDMATRANSACTION DmaTransaction
915 )
916{
919
923 (PVOID *) &pDmaTrans,
925
928 "Cannot call %!FUNC! for WDFDMATRANSACTION %p "
929 "because the parent WDFDMAENABLER (%p) is not "
930 "configured to use DMA version 3.",
934 return NULL;
935 }
936
938
944 "Cannot call %!FUNC! on WDFDMATRANSACTION %p "
945 "becuase it is uninitialized, reused, deleted "
946 "(state is %!FxDmaTransactionState!).",
948 state
949 );
951 return NULL;
952 }
953
955}
956
958VOID
959WDFEXPORT(WdfDmaTransactionGetTransferInfo)(
960 __in
962 __in
963 WDFDMATRANSACTION DmaTransaction,
968 )
969{
972
976 (PVOID *) &pDmaTrans,
978
980}
981
982//
983// Stubbed WDF 1.11 DMA DDIs start here.
984//
985
987VOID
988WDFEXPORT(WdfDmaTransactionSetImmediateExecution)(
989 __in
991 __in
992 WDFDMATRANSACTION DmaTransaction,
993 __in
995 )
996{
999
1003 (PVOID *) &pDmaTrans,
1005
1007 {
1009 "Cannot call %!FUNC! for WDFDMATRANSACTION %p "
1010 "because the parent WDFDMAENABLER (%p) is not "
1011 "configured to use DMA version 3.",
1015 return;
1016 }
1017
1019}
1020
1023WDFEXPORT(WdfDmaTransactionAllocateResources)(
1024 __in
1026 __in
1027 WDFDMATRANSACTION DmaTransaction,
1028 __in
1030 __in
1032 __in
1034 __in
1036 )
1037{
1040
1042
1046 (PVOID *) &pDmaTrans,
1048
1049 //
1050 // Only valid if DMA V3 is enabled.
1051 //
1052
1054 {
1056
1058 "Cannot call %!FUNC! on WDFDMATRANSACTION %p "
1059 "because WDFDMAENABLER %p was not configured "
1060 "for DMA version 3 - %!STATUS!.",
1063 status);
1065 return status;
1066 }
1067
1068 //
1069 // Only valid for packet or system profile transactions.
1070 //
1076
1078
1080 "Cannot call %!FUNC! on non packet or system "
1081 "profile WDFDMATRANSACTION (%p) (transaction "
1082 "profile is %!WDF_DMA_PROFILE!) - %!STATUS!.",
1084 profile,
1085 status);
1087 return status;
1088 }
1089
1090 //
1091 // Validate the direction value.
1092 //
1098 "Allocation of DMA adapter for WDFDMATRANSACTION 0x%p, "
1099 "DmaDirection 0x%x is an invalid value, %!STATUS!",
1102 return status;
1103 }
1104
1106
1107 status = pDmaTrans->ReserveAdapter(RequiredMapRegisters,
1111
1112 return status;
1113}
1115VOID
1116WDFEXPORT(WdfDmaTransactionFreeResources)(
1117 __in
1119 __in
1120 WDFDMATRANSACTION DmaTransaction
1121 )
1122{
1125
1129 (PVOID *) &pDmaTrans,
1131
1132 //
1133 // Only valid for packet or system profile transactions.
1134 //
1136 if ((profile != WdfDmaProfilePacket) &&
1141 "Cannot call %!FUNC! on non packet or system "
1142 "profile WDFDMATRANSACTION (%p) (transaction "
1143 "profile is %!WDF_DMA_PROFILE!).",
1145 profile);
1147 return;
1148 }
1149
1150 //
1151 // Only valid if DMA V3 is enabled.
1152 //
1153
1155 {
1157 "Cannot call %!FUNC! on WDFDMATRANSACTION %p "
1158 "because WDFDMAENABLER %p was not configured "
1159 "for DMA version 3",
1163 return;
1164 }
1165
1166 pDmaTrans->ReleaseAdapter();
1167
1168 return;
1169}
1171BOOLEAN
1172WDFEXPORT(WdfDmaTransactionCancel)(
1173 __in
1175 __in
1176 WDFDMATRANSACTION DmaTransaction
1177 )
1178{
1181
1185 (PVOID *) &pDmaTrans,
1187
1188 //
1189 // Only valid if the enabler uses DMA v3
1190 //
1191
1192 if (pDmaTrans->GetDmaEnabler()->UsesDmaV3() == FALSE) {
1194 "Cannot call %!FUNC! WDFDMATRANSACTION (%p) "
1195 "because enabler is not using DMA version 3",
1198 return FALSE;
1199 }
1200
1202}
1203
1205VOID
1206WDFEXPORT(WdfDmaTransactionStopSystemTransfer)(
1207 __in
1209 __in
1210 WDFDMATRANSACTION DmaTransaction
1211 )
1212{
1215
1219 (PVOID *) &pDmaTrans,
1221
1222 //
1223 // Verify that the transaction belongs to a system profile enabler.
1224 //
1225
1227 if ((profile != WdfDmaProfileSystem) &&
1230 "Cannot call %!FUNC! on non-system-profile "
1231 "WDFDMATRANSACTION (%p) (transaction profile "
1232 "is %!WDF_DMA_PROFILE!).",
1234 profile);
1236 return;
1237 }
1238
1239 //
1240 // Cast the transaction to the right sub-type now that we've verified the
1241 // profile.
1242 //
1243
1246 return;
1247}
1248
1249
1250
1251} // extern "C"
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
__inline BOOLEAN SupportsChainedMdls(VOID)
BOOLEAN UsesDmaV3(VOID)
__inline WDF_DMA_PROFILE GetProfile(VOID)
__inline WDFDEVICE GetDeviceHandle(VOID)
__inline WDFDMAENABLER GetHandle(VOID)
VOID SetDeviceAddressOffset(__in ULONG Offset)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in FxDmaEnabler *DmaEnabler, __out WDFDMATRANSACTION *Transaction)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in FxDmaEnabler *DmaEnabler, __out WDFDMATRANSACTION *Transaction)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in FxDmaEnabler *DmaEnabler, __out WDFDMATRANSACTION *Transaction)
VOID SetConfigureChannelCallback(__in_opt PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL Callback, __in_opt PVOID Context)
VOID SetTransferCompleteCallback(__in_opt PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE Callback, __in_opt PVOID Context)
__forceinline VOID SetMaximumFragmentLength(size_t MaximumFragmentLength)
__forceinline size_t GetCurrentFragmentLength(VOID)
VOID SetImmediateExecution(__in BOOLEAN Value)
__forceinline FxRequest * GetRequest(VOID)
__forceinline VOID SetRequest(__in FxRequest *Request)
VOID ReleaseForReuse(__in BOOLEAN ForceRelease)
__forceinline size_t GetBytesTransferred(VOID)
FxDmaTransactionState GetTransactionState(VOID)
__forceinline FxDmaEnabler * GetDmaEnabler(VOID)
_Must_inspect_result_ NTSTATUS Execute(__in PVOID Context)
VOID GetTransferInfo(__out_opt ULONG *MapRegisterCount, __out_opt ULONG *ScatterGatherElementCount)
_Must_inspect_result_ NTSTATUS Initialize(__in PFN_WDF_PROGRAM_DMA ProgramDmaFunction, __in WDF_DMA_DIRECTION DmaDirection, __in PMDL Mdl, __in size_t Offset, __in ULONG Length)
BOOLEAN CancelResourceAllocation(VOID)
BOOLEAN DmaCompleted(__in size_t TransferredLength, __out NTSTATUS *ReturnStatus, __in FxDmaCompletionType CompletionType)
PIO_STACK_LOCATION GetCurrentIrpStackLocation(VOID)
Definition: fxirpum.cpp:370
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
__inline WDFREQUEST GetHandle(VOID)
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
_Must_inspect_result_ NTSTATUS GetDeviceControlOutputMdl(__out PMDL *pMdl)
_Must_inspect_result_ NTSTATUS GetMdl(__out PMDL *pMdl)
Definition: fxrequestkm.cpp:80
Definition: _stack.h:55
#define __out_opt
Definition: dbghelp.h:65
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define TRACINGDMA
Definition: dbgtrace.h:71
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define __drv_when(cond, annotes)
Definition: driverspecs.h:335
#define __drv_reportError(why)
Definition: driverspecs.h:320
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
FxDmaTransactionState
@ FxDmaTransactionStateDeleted
@ FxDmaTransactionStateInvalid
@ FxDmaTransactionStateReleased
@ FxDmaTransactionStateCreated
@ FxDmaCompletionTypeAbort
@ FxDmaCompletionTypePartial
@ FxDmaCompletionTypeFull
MDL * mdl
_Must_inspect_result_ __in WDFDMATRANSACTION DmaTransaction
__in WDFDMATRANSACTION __out_opt ULONG * MapRegisterCount
PIO_STACK_LOCATION stack
__in WDFDMATRANSACTION __in WDF_DMA_DIRECTION __in ULONG __in PFN_WDF_RESERVE_DMA EvtReserveDmaFunction
__in WDFDMATRANSACTION __in_opt PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE DmaCompletionRoutine
__in WDFDMATRANSACTION __in size_t FinalTransferredLength
FxRequest * pReqObj
_Must_inspect_result_ __in WDFDMATRANSACTION __in PFN_WDF_PROGRAM_DMA __in WDF_DMA_DIRECTION __in PMDL Mdl
WDF_DMA_PROFILE profile
__in WDFDMATRANSACTION __in_opt PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE __in_opt PVOID DmaCompletionContext
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), DmaEnabler, FX_TYPE_DMA_ENABLER,(PVOID *) &pDmaEnabler, &pFxDriverGlobals)
_Must_inspect_result_ __in WDFDMATRANSACTION __in WDFREQUEST Request
__in WDFDMATRANSACTION __out_opt ULONG __out_opt ULONG * ScatterGatherElementCount
_Must_inspect_result_ __in WDFDMATRANSACTION __in_opt WDFCONTEXT Context
_Must_inspect_result_ __in WDFDMATRANSACTION __in WDFREQUEST __in PFN_WDF_PROGRAM_DMA __in WDF_DMA_DIRECTION DmaDirection
_Must_inspect_result_ __in WDFDMAENABLER __in_opt WDF_OBJECT_ATTRIBUTES __out WDFDMATRANSACTION * DmaTransactionHandle
ULONG reqLength
return STATUS_SUCCESS
FxRequest * pRequest
__in WDFDMATRANSACTION __in_opt PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL ConfigureRoutine
_Must_inspect_result_ __in WDFDMATRANSACTION __in PFN_WDF_PROGRAM_DMA __in WDF_DMA_DIRECTION __in PMDL __in PVOID VirtualAddress
__in WDFDMATRANSACTION __out NTSTATUS * pStatus
__in WDFDMATRANSACTION __in WDF_DMA_DIRECTION __in ULONG RequiredMapRegisters
FxDmaTransactionBase * pDmaTrans
_Must_inspect_result_ __in WDFDMATRANSACTION __in WDFREQUEST __in PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction
FxDmaEnabler * pDmaEnabler
FxDmaSystemTransaction * systemTransaction
FxObjectHandleGetPtr(pFxDriverGlobals, Request, FX_TYPE_REQUEST,(PVOID *) &pReqObj)
__in WDFDMATRANSACTION __in WDF_DMA_DIRECTION __in ULONG __in PFN_WDF_RESERVE_DMA __in PVOID EvtReserveDmaContext
__in WDFDMATRANSACTION __in_opt PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL __in_opt PVOID ConfigureContext
FxDmaTransactionState state
_Must_inspect_result_ __in WDFDMAENABLER DmaEnabler
__in WDFDMATRANSACTION __in BOOLEAN UseImmediateExecution
_Must_inspect_result_ __in WDFDMAENABLER __in_opt WDF_OBJECT_ATTRIBUTES * Attributes
__in WDFDMATRANSACTION __in size_t TransferredLength
__in WDFDMATRANSACTION __in size_t MaximumLength
_Must_inspect_result_ __in WDFDMATRANSACTION __in PFN_WDF_PROGRAM_DMA __in WDF_DMA_DIRECTION __in PMDL __in size_t Offset
PFX_DRIVER_GLOBALS pFxDriverGlobals
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
@ FX_TYPE_DMA_TRANSACTION
Definition: fxtypes.h:108
@ FX_TYPE_REQUEST
Definition: fxtypes.h:53
@ FX_TYPE_DMA_ENABLER
Definition: fxtypes.h:107
@ FX_VALIDATE_OPTION_PARENT_NOT_ALLOWED
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define __success(expr)
Definition: ms_sal.h:2869
#define METHOD_OUT_DIRECT
Definition: nt_native.h:596
#define METHOD_BUFFERED
Definition: nt_native.h:594
#define METHOD_IN_DIRECT
Definition: nt_native.h:595
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
int zero
Definition: sehframes.cpp:29
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDMAENABLER DmaEnabler
#define WDF_PTR_GET_OFFSET(_base, _addr)
Definition: wdfcore.h:147
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
@ WdfDmaProfileScatterGather
Definition: wdfdmaenabler.h:55
@ WdfDmaProfilePacket
Definition: wdfdmaenabler.h:54
@ WdfDmaProfileScatterGatherDuplex
Definition: wdfdmaenabler.h:58
@ WdfDmaProfileSystem
Definition: wdfdmaenabler.h:60
@ WdfDmaProfileSystemDuplex
Definition: wdfdmaenabler.h:61
@ WdfDmaProfilePacket64
Definition: wdfdmaenabler.h:56
@ WdfDmaProfileScatterGather64Duplex
Definition: wdfdmaenabler.h:59
@ WdfDmaProfileScatterGather64
Definition: wdfdmaenabler.h:57
_In_ WDFDMAENABLER _In_ WDF_DMA_DIRECTION DmaDirection
enum _WDF_DMA_DIRECTION WDF_DMA_DIRECTION
WDF_EXTERN_C_START enum _WDF_DMA_PROFILE WDF_DMA_PROFILE
@ WdfDmaDirectionReadFromDevice
Definition: wdfdmaenabler.h:65
@ WdfDmaDirectionWriteToDevice
Definition: wdfdmaenabler.h:66
_In_ WDFDMATRANSACTION _In_opt_ PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE _In_opt_ PVOID DmaCompletionContext
EVT_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE * PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE
_In_ WDFDMATRANSACTION _In_ size_t FinalTransferredLength
_Must_inspect_result_ _In_ WDFDMAENABLER _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDMATRANSACTION * DmaTransaction
_In_ WDFDMATRANSACTION _In_ WDF_DMA_DIRECTION _In_ ULONG _In_ PFN_WDF_RESERVE_DMA _In_ PVOID EvtReserveDmaContext
_In_ WDFDMATRANSACTION _In_ BOOLEAN UseImmediateExecution
EVT_WDF_PROGRAM_DMA * PFN_WDF_PROGRAM_DMA
_In_ WDFDMATRANSACTION _In_opt_ PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL _In_opt_ PVOID ConfigureContext
EVT_WDF_RESERVE_DMA * PFN_WDF_RESERVE_DMA
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA EvtProgramDmaFunction
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFDMATRANSACTION _In_opt_ PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE DmaCompletionRoutine
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
_In_ WDFDMATRANSACTION _In_ WDF_DMA_DIRECTION _In_ ULONG _In_ PFN_WDF_RESERVE_DMA EvtReserveDmaFunction
_In_ WDFDMATRANSACTION _Out_opt_ ULONG * MapRegisterCount
_In_ WDFDMATRANSACTION _In_ WDF_DMA_DIRECTION _In_ ULONG RequiredMapRegisters
_In_ WDFDMATRANSACTION _In_ size_t TransferredLength
EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL * PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL
_In_ WDFDMATRANSACTION _Out_opt_ ULONG _Out_opt_ ULONG * ScatterGatherElementCount
_In_ WDFDMATRANSACTION _In_opt_ PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL ConfigureRoutine
#define METHOD_FROM_CTL_CODE(ctrlCode)
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define MmGetMdlByteCount(_Mdl)
#define MmGetMdlVirtualAddress(_Mdl)
MDL
Definition: mmtypes.h:117
#define NT_ASSERTMSG
Definition: rtlfuncs.h:3311