ReactOS  0.4.15-dev-3324-gda4e15f
fxdmatransactioncallbacks.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxDmaTransactionCallbacks.h
8 
9 Abstract:
10 
11  This module implements the FxDmaTransaction object callbacks
12 
13 Environment:
14 
15  kernel mode only
16 
17 Revision History:
18 
19 --*/
20 
21 #ifndef _FXDMATRANSACTIONCALLBACKS_H
22 #define _FXDMATRANSACTIONCALLBACKS_H
23 
24 //
25 // FxDmaTransactionProgramDma or FxDmaTransactionReserveDma callback delegate
26 // These are mutually exclusive callbacks and are packed together in
27 // the callback structure (C++ won't allow two classes with constructors
28 // to be together in a union, so the containing class can't do the
29 // packing)
30 //
32 
33 public:
34  union {
37  } Method;
38 
40  VOID
41  ) :
42  FxCallback()
43  {
44  Method.ProgramDma = NULL;
45  }
46 
47  BOOLEAN
49  __in WDFDMATRANSACTION Transaction,
50  __in WDFDEVICE Device,
54  )
55  {
56  if (Method.ProgramDma) {
57  BOOLEAN cc;
58 
59  CallbackStart();
60  cc = Method.ProgramDma( Transaction,
61  Device,
62  Context,
63  Direction,
64  SgList );
65  CallbackEnd();
66 
67  return cc;
68  }
69  else {
70  return FALSE;
71  }
72  }
73 
74  VOID
76  __in WDFDMATRANSACTION Transaction,
78  )
79  {
80  if (Method.ReserveDma) {
81  CallbackStart();
82  Method.ReserveDma( Transaction, Context );
83  CallbackEnd();
84  }
85  }
86 
87  VOID
89  VOID
90  )
91  {
92  Method.ProgramDma = NULL;
93  }
94 };
95 
96 //
97 // FxDmaTransactionConfigureChannel callback delegate
98 //
99 
101 
102 public:
104 
106  VOID
107  ) :
108  FxCallback()
109  {
110  Method = NULL;
111  }
112 
114  BOOLEAN
116  __in WDFDMATRANSACTION DmaTransaction,
117  __in WDFDEVICE Device,
119  __in_opt PMDL Mdl,
120  __in size_t Offset,
121  __in size_t Length
122  )
123  {
124  BOOLEAN b = TRUE;
125  if (Method) {
126  CallbackStart();
128  CallbackEnd();
129  }
130  return b;
131  }
132 };
133 
134 //
135 // FxDmaTransactionTransferComplete callback delegate
136 //
137 
139 
140 public:
142 
144  VOID
145  ) :
146  FxCallback()
147  {
148  Method = NULL;
149  }
150 
151  VOID
153  __in WDFDMATRANSACTION Transaction,
154  __in WDFDEVICE Device,
158  )
159  {
160  if (Method) {
161  CallbackStart();
163  CallbackEnd();
164  }
165  }
166 };
167 
168 #endif // _FXDMATRANSACTIONCALLBACKS_H
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
EVT_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE * PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
BOOLEAN InvokeProgramDma(__in WDFDMATRANSACTION Transaction, __in WDFDEVICE Device, __in PVOID Context, __in WDF_DMA_DIRECTION Direction, __in PSCATTER_GATHER_LIST SgList)
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
EVT_WDF_RESERVE_DMA * PFN_WDF_RESERVE_DMA
EVT_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL * PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL
VOID Invoke(__in WDFDMATRANSACTION Transaction, __in WDFDEVICE Device, __in WDFCONTEXT Context, __in WDF_DMA_DIRECTION Direction, __in DMA_COMPLETION_STATUS Status)
#define b
Definition: ke_i.h:79
Status
Definition: gdiplustypes.h:24
PFN_WDF_DMA_TRANSACTION_CONFIGURE_DMA_CHANNEL Method
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
DMA_COMPLETION_STATUS
Definition: iotypes.h:2298
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION _In_ PSCATTER_GATHER_LIST SgList
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
uint32_t cc
Definition: isohybrid.c:75
EVT_WDF_PROGRAM_DMA * PFN_WDF_PROGRAM_DMA
#define NULL
Definition: types.h:112
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
PFN_WDF_DMA_TRANSACTION_DMA_TRANSFER_COMPLETE Method
union FxDmaTransactionProgramOrReserveDma::@4098 Method
struct _SCATTER_GATHER_LIST * PSCATTER_GATHER_LIST
Definition: iotypes.h:2204
enum _WDF_DMA_DIRECTION WDF_DMA_DIRECTION
VOID InvokeReserveDma(__in WDFDMATRANSACTION Transaction, __in PVOID Context)
void __inline CallbackStart(VOID)
Definition: fxcallback.hpp:64
_Must_inspect_result_ BOOLEAN Invoke(__in WDFDMATRANSACTION DmaTransaction, __in WDFDEVICE Device, __in PVOID Context, __in_opt PMDL Mdl, __in size_t Offset, __in size_t Length)
#define __in
Definition: dbghelp.h:35
_Must_inspect_result_ _In_ WDFDMAENABLER _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDMATRANSACTION * DmaTransaction
void __inline CallbackEnd(VOID)
Definition: fxcallback.hpp:74