ReactOS 0.4.15-dev-7906-g1b85a5f
FxRequestSystemBuffer Struct Reference

#include <fxrequest.hpp>

Inheritance diagram for FxRequestSystemBuffer:
Collaboration diagram for FxRequestSystemBuffer:

Public Member Functions

 FxRequestSystemBuffer (VOID)
 
virtual _Must_inspect_result_ 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 (PVOID Buffer)
 
__inline VOID SetMdl (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 95 of file fxrequest.hpp.

Constructor & Destructor Documentation

◆ FxRequestSystemBuffer()

FxRequestSystemBuffer::FxRequestSystemBuffer ( VOID  )
inline

Definition at line 99 of file fxrequest.hpp.

102 {
103 m_Buffer = NULL;
104 }
#define NULL
Definition: types.h:112

Member Function Documentation

◆ AddRef()

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

Implements IFxMemory.

Definition at line 205 of file fxrequestsystembuffer.cpp.

228{
232
234
235 //
236 // This value should never be used by the caller
237 //
238 return 2;
239}
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 FxRequestSystemBuffer::ClearBufferMdl ( VOID  )
inline

Definition at line 177 of file fxrequest.hpp.

180 {
181 m_Buffer = NULL;
182 m_Mdl = NULL;
183 }

Referenced by FxRequest::ClearFieldsForReuse().

◆ Delete()

VOID FxRequestSystemBuffer::Delete ( VOID  )
virtual

Implements IFxMemory.

Definition at line 296 of file fxrequestsystembuffer.cpp.

314{
315 // this function should never be called
316 ASSERT(FALSE);
317}
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44

◆ GetBuffer()

_Must_inspect_result_ PVOID FxRequestSystemBuffer::GetBuffer ( VOID  )
virtual

Implements IFxMemory.

Definition at line 38 of file fxrequestsystembufferkm.cpp.

53{
56 WDF_DEVICE_IO_TYPE ioType;
57
58 switch (irp->GetMajorFunction()) {
61 return m_Buffer;
62
63 case IRP_MJ_READ:
64 case IRP_MJ_WRITE:
66 ioType = pDevice->GetIoType();
67
68 switch (ioType) {
70 return m_Buffer;
71
73 //
74 // FxRequest::GetMemoryObject has already called MmGetSystemAddressForMdlSafe
75 // and returned success, so we know that we can safely call
76 // MmGetSystemAddressForMdlSafe again to get a valid VA pointer.
77 //
79
81 return m_Buffer;
82
83 default:
85 return NULL;
86 }
87
88 default:
90 return NULL;
91 }
92}
__inline WDF_DEVICE_IO_TYPE GetIoType(VOID)
Definition: fxdevice.hpp:1084
static FxDevice * GetFxDevice(__in MdDeviceObject DeviceObject)
Definition: fxdeviceum.cpp:60
Definition: fxirp.hpp:28
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
MdDeviceObject GetDeviceObject(VOID)
Definition: fxirpum.cpp:1352
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
FxDevice * pDevice
FxIrp * irp
@ NormalPagePriority
Definition: imports.h:56
#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
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
@ WdfDeviceIoNeither
Definition: wdfdevice.h:451
@ WdfDeviceIoBuffered
Definition: wdfdevice.h:452
@ WdfDeviceIoDirect
Definition: wdfdevice.h:453
#define IRP_MJ_INTERNAL_DEVICE_CONTROL

Referenced by FxRequest::CompleteInternal().

◆ GetBufferSize()

size_t FxRequestSystemBuffer::GetBufferSize ( VOID  )
virtual

Implements IFxMemory.

Definition at line 37 of file fxrequestsystembuffer.cpp.

52{
54
55 switch (irp->GetMajorFunction()) {
56 case IRP_MJ_READ:
58
59 case IRP_MJ_WRITE:
61
65
66 default:
67 // should not get here
69 return 0;
70 }
71}
ULONG GetParameterWriteLength(VOID)
Definition: fxirpum.cpp:1601
ULONG GetParameterIoctlInputBufferLength(VOID)
Definition: fxirpum.cpp:1518
ULONG GetParameterReadLength(VOID)
Definition: fxirpum.cpp:1589

Referenced by FxRequest::CompleteInternal().

◆ GetDriverGlobals()

PFX_DRIVER_GLOBALS FxRequestSystemBuffer::GetDriverGlobals ( VOID  )
virtual

Implements IFxMemory.

Definition at line 185 of file fxrequestsystembuffer.cpp.

200{
201 return GetRequest()->GetDriverGlobals();
202}
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734

◆ GetFlags()

USHORT FxRequestSystemBuffer::GetFlags ( VOID  )
virtual

Implements IFxMemory.

Definition at line 140 of file fxrequestsystembuffer.cpp.

156{
158
159 switch (irp->GetMajorFunction()) {
163 case METHOD_BUFFERED:
164 case METHOD_NEITHER:
165 return 0;
166
167 case METHOD_IN_DIRECT:
170 }
171
172 case IRP_MJ_READ:
173 return 0;
174
175 case IRP_MJ_WRITE:
177
178 default:
179 ASSERT(FALSE);
180 return 0;
181 }
182}
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
@ IFxMemoryFlagReadOnly
Definition: ifxmemory.hpp:35
#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

◆ GetHandle()

WDFMEMORY FxRequestSystemBuffer::GetHandle ( VOID  )
virtual

Implements IFxMemory.

Definition at line 119 of file fxrequestsystembuffer.cpp.

134{
135 return GetRequest()->GetMemoryHandle(
136 FIELD_OFFSET(FxRequest, m_SystemBufferOffset));
137}
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 FxRequestSystemBuffer::GetMdl ( VOID  )
virtual

Implements IFxMemory.

Definition at line 75 of file fxrequestsystembuffer.cpp.

90{
93
94 switch (irp->GetMajorFunction()) {
95 case IRP_MJ_READ:
96 case IRP_MJ_WRITE:
98
100 return m_Mdl;
101 }
102 // || || Fall through || ||
103 // \/ \/ \/ \/
104
107 //
108 // For IOCLs, the outbuffer will return the PMDL
109 //
110 // || || Fall through || ||
111 // \/ \/ \/ \/
112
113 default:
114 return NULL;
115 }
116}

Referenced by FxRequest::CompleteInternal().

◆ GetRequest()

FxRequest * FxRequestSystemBuffer::GetRequest ( VOID  )
protected

Definition at line 276 of file fxrequestsystembuffer.cpp.

291{
292 return CONTAINING_RECORD(this, FxRequest, m_SystemBuffer);
293}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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

◆ IsBufferSet()

__inline BOOLEAN FxRequestSystemBuffer::IsBufferSet ( VOID  )
inline

Definition at line 168 of file fxrequest.hpp.

171 {
172 return m_Buffer != NULL ? TRUE : FALSE;
173 }
#define TRUE
Definition: types.h:120

Referenced by FxRequest::AssignMemoryBuffers().

◆ Release()

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

Implements IFxMemory.

Definition at line 242 of file fxrequestsystembuffer.cpp.

265{
269
271
272 return 1;
273}
VOID ReleaseIrpReference(VOID)
Definition: fxrequest.cpp:2512

◆ SetBuffer()

__inline VOID FxRequestSystemBuffer::SetBuffer ( PVOID  Buffer)
inlineprotected

Definition at line 188 of file fxrequest.hpp.

191 {
192 ASSERT(m_Buffer == NULL);
194 }
Definition: bufpool.h:45

Referenced by FxRequest::AssignMemoryBuffers().

◆ SetMdl()

__inline VOID FxRequestSystemBuffer::SetMdl ( PMDL  Mdl)
inlineprotected

Definition at line 198 of file fxrequest.hpp.

201 {
202 ASSERT(m_Mdl == NULL);
203 m_Mdl = Mdl;
204 }
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by FxRequest::GetMemoryObject().

Member Data Documentation

◆ 

union { ... } FxRequestSystemBuffer::@4795

◆ FxRequest

friend FxRequestSystemBuffer::FxRequest

Definition at line 96 of file fxrequest.hpp.

◆ m_Buffer

PVOID FxRequestSystemBuffer::m_Buffer

◆ m_Mdl

PMDL FxRequestSystemBuffer::m_Mdl

Definition at line 238 of file fxrequest.hpp.

Referenced by ClearBufferMdl(), GetBuffer(), GetMdl(), FxRequest::GetMemoryObject(), and SetMdl().


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