ReactOS  0.4.15-dev-3316-g067ca88
fxiotargetum.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft. All rights reserved.
4 
5 Module Name:
6 
7  FxIoTargetUm.hpp
8 
9 Abstract:
10 
11 Author:
12 
13 
14 
15 Environment:
16 
17 
18 Revision History:
19 
20 --*/
21 
22 #ifndef _FXIOTARGETUM_H_
23 #define _FXIOTARGETUM_H_
24 
25 __inline
27  VOID
28  ) :
30  m_OtherMemory(NULL),
31  m_RestoreState(FALSE)
32 {
33  ZeroMemory(&m_OriginalBufferInfo, sizeof(m_OriginalBufferInfo));
34 }
35 
36 __inline
38  VOID
39  )
40 {
41 }
42 
43 __inline
44 VOID
47  )
48 {
49  FxIrp* irp = NULL;
50 
51  irp = Request->GetSubmitFxIrp();
52 
53  if (m_RestoreState) {
54  irp->GetIoIrp()->RestoreCurrentBuffer(&m_OriginalBufferInfo);
56  }
57 
58  //
59  // Release the 2ndary buffer if we have an outstanding reference
60  //
61  if (m_OtherMemory != NULL) {
62  m_OtherMemory->RELEASE(this);
64  }
65 
66  //
67  // Release the other buffer and all __super related fields
68  //
70 }
71 
72 __inline
73 VOID
76  )
77 {
78  switch (m_MajorFunction) {
79  case IRP_MJ_WRITE:
82  break;
83 
84  case IRP_MJ_READ:
87  break;
88 
90  case UMINT::WdfRequestInternalIoctl:
91  m_CompletionParams.Parameters.Ioctl.Output.Length =
93  break;
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108  default:
109  FX_VERIFY(INTERNAL, CHECK("Non Io Irp passed to CopyParameters", FALSE));
110  }
111 }
112 
113 __inline
114 VOID
117  _In_ ULONG NewInputBufferCb,
118  _In_reads_bytes_opt_(NewInputBufferCb) PVOID NewInputBuffer,
119  _In_ ULONG NewOutputBufferCb,
120  _In_reads_bytes_opt_(NewOutputBufferCb) PVOID NewOutputBuffer
121  )
122 {
123  FxIrp* irp = NULL;
124 
125  irp = Request->GetSubmitFxIrp();
126 
128  irp->GetIoIrp()->SwapCurrentBuffer(
129  true,
130  NewInputBufferCb,
131  NewInputBuffer,
132  NewOutputBufferCb,
133  NewOutputBuffer,
134  &m_OriginalBufferInfo
135  );
136 }
137 
138 __inline
139 BOOLEAN
141  VOID
142  )
143 {
144 
145 
146 
147 
148 
149 
150  return TRUE;
151 }
152 
153 __inline
154 VOID
156  _In_ MdIrp Irp
157  )
158 {
159  Forward(Irp);
160 }
161 
162 #endif // _FXIOTARGETUM_H_
BOOLEAN m_RestoreState
Definition: fxiotarget.hpp:113
#define TRUE
Definition: types.h:120
virtual VOID Forward(__in MdIrp Irp)
Definition: fxiotarget.hpp:699
Definition: fxirp.hpp:28
#define ZeroMemory
Definition: winbase.h:1664
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define CHECK(type, val, base, expected)
virtual ~FxIoContext(VOID)
union _WDF_REQUEST_COMPLETION_PARAMS::@3640 Parameters
UCHAR m_MajorFunction
Definition: fxiotarget.hpp:114
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
FxIoContext(VOID)
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
unsigned char BOOLEAN
#define _In_
Definition: ms_sal.h:308
IWudfIrp * MdIrp
Definition: mxum.h:103
struct _WDF_REQUEST_COMPLETION_PARAMS::@3640::@3641 Write
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
VOID CopyParameters(__in FxRequestBase *Request)
BOOLEAN HasValidStackSize(VOID)
IWudfIoIrp * GetIoIrp(VOID)
Definition: fxirpum.cpp:1777
struct _WDF_REQUEST_COMPLETION_PARAMS::@3640::@3643 Ioctl
WDF_REQUEST_COMPLETION_PARAMS m_CompletionParams
#define NULL
Definition: types.h:112
#define IRP_MJ_READ
Definition: rdpdr.c:46
IFxMemory * m_OtherMemory
Definition: fxiotarget.hpp:115
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
unsigned int ULONG
Definition: retypes.h:1
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
struct _WDF_REQUEST_COMPLETION_PARAMS::@3640::@3642 Read
virtual VOID Send(_In_ MdIrp Irp)
VOID SwapIrpBuffer(_In_ FxRequestBase *Request, _In_ ULONG NewInputBufferCb, _In_reads_bytes_opt_(NewInputBufferCb) PVOID NewInputBuffer, _In_ ULONG NewOutputBufferCb, _In_reads_bytes_opt_(NewOutputBufferCb) PVOID NewOutputBuffer)
#define __in
Definition: dbghelp.h:35
FxIrp * irp
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52