ReactOS  0.4.15-dev-2720-g5ee0925
FxRequestOutputBuffer Struct Reference

#include <fxrequest.hpp>

Inheritance diagram for FxRequestOutputBuffer:
Collaboration diagram for FxRequestOutputBuffer:

Public Member Functions

 FxRequestOutputBuffer (VOID)
 
virtual PVOID GetBuffer (VOID)
 
virtual size_t GetBufferSize (VOID)
 
virtual _Must_inspect_result_ PMDL GetMdl (VOID)
 
virtual WDFMEMORY GetHandle (VOID)
 
virtual USHORT GetFlags (VOID)
 
virtual PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
virtual ULONG AddRef (__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
 
virtual ULONG Release (__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
 
virtual VOID Delete (VOID)
 
__inline BOOLEAN IsBufferSet (VOID)
 
__inline VOID ClearBufferMdl (VOID)
 
- Public Member Functions inherited from IFxMemory
_Must_inspect_result_ NTSTATUS ValidateMemoryOffsets (__in_opt PWDFMEMORY_OFFSET Offsets)
 
_Must_inspect_result_ NTSTATUS CopyFromPtr (__in_opt PWDFMEMORY_OFFSET DestinationOffsets, __in_bcount(SourceBufferLength) PVOID SourceBuffer, __in size_t SourceBufferLength, __in_opt PWDFMEMORY_OFFSET SourceOffsets)
 
_Must_inspect_result_ NTSTATUS CopyToPtr (__in_opt PWDFMEMORY_OFFSET SourceOffsets, __out_bcount(DestinationBufferLength) PVOID DestinationBuffer, __in size_t DestinationBufferLength, __in_opt PWDFMEMORY_OFFSET DestinationOffsets)
 
_Must_inspect_result_ NTSTATUS ValidateMemoryOffsets (__in_opt PWDFMEMORY_OFFSET Offsets)
 
_Must_inspect_result_ NTSTATUS CopyFromPtr (__in_opt PWDFMEMORY_OFFSET DestinationOffsets, __in_bcount(SourceBufferLength) PVOID SourceBuffer, __in size_t SourceBufferLength, __in_opt PWDFMEMORY_OFFSET SourceOffsets)
 
_Must_inspect_result_ NTSTATUS CopyToPtr (__in_opt PWDFMEMORY_OFFSET SourceOffsets, __out_bcount(DestinationBufferLength) PVOID DestinationBuffer, __in size_t DestinationBufferLength, __in_opt PWDFMEMORY_OFFSET DestinationOffsets)
 

Public Attributes

friend FxRequest
 
PVOID m_Buffer
 
PMDL m_Mdl
 

Protected Member Functions

__inline VOID SetBuffer (__in PVOID Buffer)
 
__inline VOID SetMdl (__in PMDL Mdl)
 
FxRequestGetRequest (VOID)
 

Protected Attributes

union {
   PVOID   m_Buffer
 
   PMDL   m_Mdl
 
}; 
 

Additional Inherited Members

- Static Protected Member Functions inherited from IFxMemory
static _Must_inspect_result_ NTSTATUS _CopyPtrToPtr (__in_bcount(SourceBufferLength) PVOID SourceBuffer, __in size_t SourceBufferLength, __in_opt PWDFMEMORY_OFFSET SourceOffsets, __out_bcount(DestinationBufferLength) PVOID DestinationBuffer, __in size_t DestinationBufferLength, __in_opt PWDFMEMORY_OFFSET DestinationOffsets)
 
static _Must_inspect_result_ NTSTATUS _CopyPtrToPtr (__in_bcount(SourceBufferLength) PVOID SourceBuffer, __in size_t SourceBufferLength, __in_opt PWDFMEMORY_OFFSET SourceOffsets, __out_bcount(DestinationBufferLength) PVOID DestinationBuffer, __in size_t DestinationBufferLength, __in_opt PWDFMEMORY_OFFSET DestinationOffsets)
 

Detailed Description

Definition at line 242 of file fxrequest.hpp.

Constructor & Destructor Documentation

◆ FxRequestOutputBuffer()

FxRequestOutputBuffer::FxRequestOutputBuffer ( VOID  )
inline

Definition at line 246 of file fxrequest.hpp.

249  {
250  m_Buffer = NULL;
251  }
#define NULL
Definition: types.h:112

Member Function Documentation

◆ AddRef()

ULONG FxRequestOutputBuffer::AddRef ( __in PVOID  Tag,
__in LONG  Line,
__in_opt PSTR  File 
)
virtual

Implements IFxMemory.

Definition at line 218 of file fxrequestoutputbuffer.cpp.

241 {
245 
247 
248  return 2;
249 }
VOID AddIrpReference(VOID)
Definition: fxrequest.cpp:2470
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
Definition: ncftp.h:79
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
Definition: File.h:15

◆ ClearBufferMdl()

__inline VOID FxRequestOutputBuffer::ClearBufferMdl ( VOID  )
inline

Definition at line 323 of file fxrequest.hpp.

326  {
327  m_Buffer = NULL;
328  m_Mdl = NULL;
329  }
#define NULL
Definition: types.h:112

Referenced by FxRequest::ClearFieldsForReuse().

◆ Delete()

VOID FxRequestOutputBuffer::Delete ( VOID  )
virtual

Implements IFxMemory.

Definition at line 306 of file fxrequestoutputbuffer.cpp.

324 {
325  // this function should never be called
326  ASSERT(FALSE);
327 }
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44

◆ GetBuffer()

PVOID FxRequestOutputBuffer::GetBuffer ( VOID  )
virtual

Implements IFxMemory.

Definition at line 36 of file fxrequestoutputbuffer.cpp.

51 {
52  FxIrp* irp = GetRequest()->GetFxIrp();
53 
56 
58  case METHOD_BUFFERED:
59  //
60  // For buffered ioctls, input and output buffer pointers are same.
61  //
62  return m_Buffer;
63 
64  case METHOD_IN_DIRECT:
65  case METHOD_OUT_DIRECT:
66  //
67  // FxRequest::GetDeviceControlOutputMemoryObject has already called
68  // MmGetSystemAddressForMdlSafe and returned success, so we know that
69  // we can safely call MmGetSystemAddressForMdlSafe again to get a
70  // valid VA pointer.
71  //
73 
74  case METHOD_NEITHER:
75  return m_Buffer;
76 
77  default:
78  ASSERT(FALSE);
79  return NULL;
80  }
81 }
Definition: fxirp.hpp:28
#define METHOD_IN_DIRECT
Definition: nt_native.h:595
#define METHOD_NEITHER
Definition: nt_native.h:597
#define FALSE
Definition: types.h:117
#define METHOD_OUT_DIRECT
Definition: nt_native.h:596
#define ASSERT(a)
Definition: mode.c:44
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
#define METHOD_BUFFERED
Definition: nt_native.h:594
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
#define NULL
Definition: types.h:112
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
FxIrp * irp
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by FxRequest::CompleteInternal().

◆ GetBufferSize()

size_t FxRequestOutputBuffer::GetBufferSize ( VOID  )
virtual

Implements IFxMemory.

Definition at line 84 of file fxrequestoutputbuffer.cpp.

99 {
100  FxIrp* irp = GetRequest()->GetFxIrp();
101 
104 
106 }
Definition: fxirp.hpp:28
#define ASSERT(a)
Definition: mode.c:44
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
ULONG GetParameterIoctlOutputBufferLength(VOID)
Definition: fxirpum.cpp:1504
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
FxIrp * irp
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by FxRequest::CompleteInternal().

◆ GetDriverGlobals()

PFX_DRIVER_GLOBALS FxRequestOutputBuffer::GetDriverGlobals ( VOID  )
virtual

Implements IFxMemory.

Definition at line 198 of file fxrequestoutputbuffer.cpp.

213 {
214  return GetRequest()->GetDriverGlobals();
215 }
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734

◆ GetFlags()

USHORT FxRequestOutputBuffer::GetFlags ( VOID  )
virtual

Implements IFxMemory.

Definition at line 163 of file fxrequestoutputbuffer.cpp.

179 {
180  FxIrp* irp = GetRequest()->GetFxIrp();
181 
184 
186  case METHOD_IN_DIRECT:
187  return IFxMemoryFlagReadOnly;
188 
189  case METHOD_BUFFERED:
190  case METHOD_OUT_DIRECT:
191  case METHOD_NEITHER: // since it is neither, we can't tell, so leave it as 0
192  default:
193  return 0;
194  }
195 }
Definition: fxirp.hpp:28
#define METHOD_IN_DIRECT
Definition: nt_native.h:595
#define METHOD_NEITHER
Definition: nt_native.h:597
#define METHOD_OUT_DIRECT
Definition: nt_native.h:596
#define ASSERT(a)
Definition: mode.c:44
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
#define METHOD_BUFFERED
Definition: nt_native.h:594
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
FxIrp * irp
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

◆ GetHandle()

WDFMEMORY FxRequestOutputBuffer::GetHandle ( VOID  )
virtual

Implements IFxMemory.

Definition at line 142 of file fxrequestoutputbuffer.cpp.

157 {
158  return GetRequest()->GetMemoryHandle(
159  FIELD_OFFSET(FxRequest, m_OutputBufferOffset));
160 }
WDFMEMORY GetMemoryHandle(__in USHORT Offset)
Definition: fxrequest.hpp:658
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by FxRequest::CompleteInternal().

◆ GetMdl()

_Must_inspect_result_ PMDL FxRequestOutputBuffer::GetMdl ( VOID  )
virtual

Implements IFxMemory.

Definition at line 110 of file fxrequestoutputbuffer.cpp.

125 {
126  FxIrp* irp = GetRequest()->GetFxIrp();
127 
130 
132  case METHOD_IN_DIRECT:
133  case METHOD_OUT_DIRECT:
134  return m_Mdl;
135 
136  default:
137  return NULL;
138  }
139 }
Definition: fxirp.hpp:28
#define METHOD_IN_DIRECT
Definition: nt_native.h:595
#define METHOD_OUT_DIRECT
Definition: nt_native.h:596
#define ASSERT(a)
Definition: mode.c:44
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
#define NULL
Definition: types.h:112
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
FxIrp * irp
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by FxRequest::CompleteInternal().

◆ GetRequest()

FxRequest * FxRequestOutputBuffer::GetRequest ( VOID  )
protected

Definition at line 286 of file fxrequestoutputbuffer.cpp.

301 {
302  return CONTAINING_RECORD(this, FxRequest, m_OutputBuffer);
303 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by AddRef(), GetBuffer(), GetBufferSize(), GetDriverGlobals(), GetFlags(), GetHandle(), GetMdl(), and Release().

◆ IsBufferSet()

__inline BOOLEAN FxRequestOutputBuffer::IsBufferSet ( VOID  )
inline

Definition at line 314 of file fxrequest.hpp.

317  {
318  return m_Buffer != NULL ? TRUE : FALSE;
319  }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NULL
Definition: types.h:112

Referenced by FxRequest::AssignMemoryBuffers().

◆ Release()

ULONG FxRequestOutputBuffer::Release ( __in PVOID  Tag,
__in LONG  Line,
__in_opt PSTR  File 
)
virtual

Implements IFxMemory.

Definition at line 252 of file fxrequestoutputbuffer.cpp.

275 {
279 
281 
282  return 1;
283 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
Definition: ncftp.h:79
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
VOID ReleaseIrpReference(VOID)
Definition: fxrequest.cpp:2512
Definition: File.h:15

◆ SetBuffer()

__inline VOID FxRequestOutputBuffer::SetBuffer ( __in PVOID  Buffer)
inlineprotected

Definition at line 334 of file fxrequest.hpp.

337  {
338  ASSERT(m_Buffer == NULL);
339  m_Buffer = Buffer;
340  }
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define ASSERT(a)
Definition: mode.c:44
#define NULL
Definition: types.h:112

Referenced by FxRequest::AssignMemoryBuffers().

◆ SetMdl()

__inline VOID FxRequestOutputBuffer::SetMdl ( __in PMDL  Mdl)
inlineprotected

Definition at line 344 of file fxrequest.hpp.

347  {
348  ASSERT(m_Mdl == NULL);
349  m_Mdl = Mdl;
350  }
#define ASSERT(a)
Definition: mode.c:44
#define NULL
Definition: types.h:112
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequest::GetDeviceControlOutputMemoryObject().

Member Data Documentation

◆ @4587

union { ... }

◆ FxRequest

friend FxRequestOutputBuffer::FxRequest

Definition at line 243 of file fxrequest.hpp.

◆ m_Buffer

◆ m_Mdl

PMDL FxRequestOutputBuffer::m_Mdl

The documentation for this struct was generated from the following files: