ReactOS 0.4.15-dev-8236-g99f0937
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
virtual PVOID GetBuffer (VOID)=0
 
virtual size_t GetBufferSize (VOID)=0
 
virtual PMDL GetMdl (VOID)=0
 
virtual WDFMEMORY GetHandle (VOID)=0
 
virtual USHORT GetFlags (VOID)=0
 
virtual PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)=0
 
virtual ULONG AddRef (__in PVOID Tag, __in LONG Line, __in_opt PSTR File)=0
 
virtual ULONG Release (__in PVOID Tag, __in LONG Line, __in_opt PSTR File)=0
 
virtual VOID Delete (VOID)=0
 
_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)
 
virtual PVOID GetBuffer (VOID)=0
 
virtual size_t GetBufferSize (VOID)=0
 
virtual PMDL GetMdl (VOID)=0
 
virtual WDFMEMORY GetHandle (VOID)=0
 
virtual USHORT GetFlags (VOID)=0
 
virtual PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)=0
 
virtual ULONG AddRef (__in PVOID Tag, __in LONG Line, __in_opt PSTR File)=0
 
virtual ULONG Release (__in PVOID Tag, __in LONG Line, __in_opt PSTR File)=0
 
virtual VOID Delete (VOID)=0
 
_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}
Definition: File.h:16
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:4065

◆ 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 }

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{
53
56
58 case METHOD_BUFFERED:
59 //
60 // For buffered ioctls, input and output buffer pointers are same.
61 //
62 return m_Buffer;
63
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:
79 return NULL;
80 }
81}
Definition: fxirp.hpp:28
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
FxIrp * irp
@ NormalPagePriority
Definition: imports.h:56
#define METHOD_NEITHER
Definition: nt_native.h:597
#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
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_INTERNAL_DEVICE_CONTROL

Referenced by FxRequest::CompleteInternal().

◆ GetBufferSize()

size_t FxRequestOutputBuffer::GetBufferSize ( VOID  )
virtual

Implements IFxMemory.

Definition at line 84 of file fxrequestoutputbuffer.cpp.

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{
181
184
186 case METHOD_IN_DIRECT:
188
189 case METHOD_BUFFERED:
191 case METHOD_NEITHER: // since it is neither, we can't tell, so leave it as 0
192 default:
193 return 0;
194 }
195}
@ IFxMemoryFlagReadOnly
Definition: ifxmemory.hpp:35

◆ 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{
127
130
132 case METHOD_IN_DIRECT:
134 return m_Mdl;
135
136 default:
137 return NULL;
138 }
139}

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}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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

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}
VOID ReleaseIrpReference(VOID)
Definition: fxrequest.cpp:2512

◆ SetBuffer()

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

Definition at line 334 of file fxrequest.hpp.

337 {
338 ASSERT(m_Buffer == NULL);
340 }
Definition: bufpool.h:45

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 }
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequest::GetDeviceControlOutputMemoryObject().

Member Data Documentation

◆ 

union { ... } FxRequestOutputBuffer::@4810

◆ 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: