ReactOS 0.4.16-dev-112-g52265ae
FxLookasideList Class Referenceabstract

#include <fxlookasidelist.hpp>

Inheritance diagram for FxLookasideList:
Collaboration diagram for FxLookasideList:

Public Member Functions

 FxLookasideList (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in ULONG PoolTag)
 
virtual _Must_inspect_result_ NTSTATUS Initialize (__in size_t BufferSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)=0
 
virtual _Must_inspect_result_ NTSTATUS Allocate (__out FxMemoryObject **PPMemory)=0
 
size_t GetBufferSize (VOID)
 
- Public Member Functions inherited from FxObject
PVOID GetCOMWrapper ()
 
void SetCOMWrapper (__drv_aliasesMem PVOID Wrapper)
 
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxObject (VOID)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType Type)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize=0)
 
VOID operator delete (__in PVOID Memory)
 
VOID SetNoContextHeader (VOID)
 
PVOID __inline GetObjectHandle (VOID)
 
__inline FxContextHeaderGetContextHeader (VOID)
 
__inline PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
WDFTYPE GetType (VOID)
 
USHORT GetObjectSize (VOID)
 
LONG GetRefCnt (VOID)
 
FxTagTrackerGetTagTracker (VOID)
 
CfxDeviceGetDevice (VOID)
 
CfxDeviceBaseGetDeviceBase (VOID)
 
VOID SetDeviceBase (__in CfxDeviceBase *DeviceBase)
 
__inline VOID CallCleanup (VOID)
 
ULONG __inline AddRef (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG Release (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG AddRefOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG ReleaseOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual _Must_inspect_result_ NTSTATUS QueryInterface (__in FxQueryInterfaceParams *Params)
 
VOID MarkTraceState (VOID)
 
BOOLEAN __inline IsTraceState (VOID)
 
VOID __inline TraceDroppedEvent (__in FxObjectDroppedEvent Event)
 
VOID MarkPassiveDispose (__in FxObjectLockState State=ObjectLock)
 
VOID MarkPassiveCallbacks (__in FxObjectLockState State=ObjectLock)
 
VOID MarkForceDisposeThread (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsPassiveCallbacks (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsPassiveDispose (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsForceDisposeThread (__in BOOLEAN AcquireLock=TRUE)
 
VOID MarkCommitted (VOID)
 
BOOLEAN IsCommitted (VOID)
 
VOID MarkDisposeOverride (__in FxObjectLockState State=ObjectLock)
 
VOID MarkNoDeleteDDI (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsNoDeleteDDI (VOID)
 
_Must_inspect_result_ NTSTATUS Commit (__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
 
VOID DeleteFromFailedCreate (VOID)
 
VOID ClearEvtCallbacks (VOID)
 
BOOLEAN EarlyDispose (VOID)
 
virtual VOID DeleteObject (VOID)
 
virtual BOOLEAN Dispose (VOID)
 
_Must_inspect_result_ NTSTATUS AssignParentObject (__in FxObject *ParentObject)
 
_Must_inspect_result_ NTSTATUS AddContext (__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
 
_Must_inspect_result_ NTSTATUS RemoveParentAssignment (VOID)
 
_Must_inspect_result_ FxObjectGetParentObjectReferenced (__in PVOID Tag)
 
BOOLEAN IsDisposed (VOID)
 

Public Attributes

WDF_OBJECT_ATTRIBUTES m_MemoryAttributes
 

Protected Member Functions

virtual ~FxLookasideList ()
 
virtual VOID Reclaim (__in FxMemoryBufferFromLookaside *Memory)=0
 
_Must_inspect_result_ NTSTATUS InitializeLookaside (__in USHORT BufferSize, __in USHORT MemoryObjectSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)
 
PVOID InitObjectAlloc (__out_bcount(this->m_MemoryObjectSize) PVOID Alloc)
 
- Protected Member Functions inherited from FxObject
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
FxObjectDebugExtensionGetDebugExtension (VOID)
 
BOOLEAN IsDebug (VOID)
 
VOID AllocateTagTracker (__in WDFTYPE Type)
 
virtual VOID SelfDestruct (VOID)
 
PVOID __inline GetObjectHandleUnchecked (VOID)
 
VOID __inline DestroyChildren (VOID)
 
VOID DeleteEarlyDisposedObject (VOID)
 

Static Protected Member Functions

static VOID _Reclaim (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __inout PNPAGED_LOOKASIDE_LIST List, __in FxMemoryBufferFromLookaside *Memory)
 
- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 

Protected Attributes

size_t m_BufferSize
 
size_t m_MemoryObjectSize
 
ULONG m_PoolTag
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Private Attributes

friend FxMemoryBufferFromLookaside
 

Additional Inherited Members

- Static Public Member Functions inherited from FxObject
static FxObject_FromDisposeEntry (__in PSINGLE_LIST_ENTRY Entry)
 
static FxObject_GetObjectFromHandle (__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
 
static PVOID __inline _ToHandle (__in FxObject *Object)
 
static VOID __inline _ReferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static VOID __inline _DereferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static PVOID _GetDebugBase (__in FxObject *Object)
 
static PFX_POOL_HEADER _CleanupPointer (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
 
static _Must_inspect_result_ NTSTATUS _GetEffectiveLock (__in FxObject *Object, __in_opt IFxHasCallbacks *Callbacks, __in BOOLEAN AutomaticLocking, __in BOOLEAN PassiveCallbacks, __out FxCallbackLock **CallbackLock, __out_opt FxObject **CallbackLockObject)
 
static _Must_inspect_result_ NTSTATUS _ObjectQuery (_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
 

Detailed Description

Definition at line 25 of file fxlookasidelist.hpp.

Constructor & Destructor Documentation

◆ FxLookasideList()

FxLookasideList::FxLookasideList ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in USHORT  ObjectSize,
__in ULONG  PoolTag 
)

Definition at line 27 of file fxlookasidelist.cpp.

31 :
32 FxObject(FX_TYPE_LOOKASIDE, ObjectSize, FxDriverGlobals),
34/*++
35
36Routine Description:
37 Constructor for FxLookasideList
38
39Arguments:
40 ObjectSize - Size of the derived object.
41
42 PoolTag - Tag to use when allocating memory.
43
44Return Value:
45 None
46
47 --*/
48{
49}
@ FX_TYPE_LOOKASIDE
Definition: fxtypes.h:54
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164

◆ ~FxLookasideList()

FxLookasideList::~FxLookasideList ( )
protectedvirtual

Definition at line 51 of file fxlookasidelist.cpp.

66{
67}

Member Function Documentation

◆ _Reclaim()

VOID FxLookasideList::_Reclaim ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__inout PNPAGED_LOOKASIDE_LIST  List,
__in FxMemoryBufferFromLookaside Memory 
)
staticprotected

Definition at line 206 of file fxlookasidelist.cpp.

211{
213
214 pHeader = FxObject::_CleanupPointer(FxDriverGlobals, (FxObject*) Memory);
215
217}
static PFX_POOL_HEADER _CleanupPointer(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
Definition: fxobject.hpp:1273
__inline VOID FxFreeToNPagedLookasideList(__in PNPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalskm.h:611
FxContextHeader * pHeader
Definition: handleapi.cpp:604
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
Definition: wdfmemory.h:169
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by FxNPagedLookasideList::Reclaim(), FxNPagedLookasideListFromPool::Reclaim(), and FxPagedLookasideListFromPool::Reclaim().

◆ Allocate()

◆ GetBufferSize()

size_t FxLookasideList::GetBufferSize ( VOID  )
inline

Definition at line 52 of file fxlookasidelist.hpp.

55 {
56 return m_BufferSize;
57 }

◆ Initialize()

virtual _Must_inspect_result_ NTSTATUS FxLookasideList::Initialize ( __in size_t  BufferSize,
__in PWDF_OBJECT_ATTRIBUTES  MemoryAttributes 
)
pure virtual

◆ InitializeLookaside()

_Must_inspect_result_ NTSTATUS FxLookasideList::InitializeLookaside ( __in USHORT  BufferSize,
__in USHORT  MemoryObjectSize,
__in PWDF_OBJECT_ATTRIBUTES  MemoryAttributes 
)
protected

Definition at line 71 of file fxlookasidelist.cpp.

95{
96 size_t size;
98
99 if (MemoryAttributes != NULL) {
102 sizeof(m_MemoryAttributes));
103 }
104 else {
106 }
107
109 MemoryObjectSize,
112 &size);
113
114 if (!NT_SUCCESS(status)) {
115 //
116 // FxCalculateObjectTotalSize logs an error to the IFR
117 //
118 return status;
119 }
120
122 if (!NT_SUCCESS(status)) {
123 //
124 // FxPoolAddHeaderSize logs to the IFR on error
125 //
126 return status;
127 }
128
129 //
130 // It is *required* to set these values only once we know we are returning
131 // success b/c the derived classes use == 0 as an indication that Initialization
132 // failed and that any associated lookaside lists were not initialized.
133 //
136
137 return status;
138}
LONG NTSTATUS
Definition: precomp.h:26
WDF_OBJECT_ATTRIBUTES m_MemoryAttributes
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define BufferSize
Definition: mmc.h:75
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
_Must_inspect_result_ NTSTATUS FxCalculateObjectTotalSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT RawObjectSize, __in USHORT ExtraSize, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out size_t *Total)
Definition: handleapi.cpp:147
_Must_inspect_result_ NTSTATUS __inline FxPoolAddHeaderSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in size_t AllocationSize, __out size_t *NewSize)
GLsizeiptr size
Definition: glext.h:5919
Definition: ps.c:97
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES MemoryAttributes
Definition: wdfmemory.h:409
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

Referenced by FxNPagedLookasideList::Initialize(), FxNPagedLookasideListFromPool::Initialize(), and FxPagedLookasideListFromPool::Initialize().

◆ InitObjectAlloc()

PVOID FxLookasideList::InitObjectAlloc ( __out_bcount(this->m_MemoryObjectSize) PVOID  Alloc)
protected

Definition at line 147 of file fxlookasidelist.cpp.

163{
166 PFX_POOL_TRACKER tracker;
167
169
171
173 //
174 // PoolTracking is active, so format and insert
175 // a tracker in the NonPagedHeader list of the pool.
176 //
177 tracker = (PFX_POOL_TRACKER) Alloc;
179 sizeof(FX_POOL_TRACKER),
181
182 pHeader->Base = Alloc;
183 pHeader->FxDriverGlobals = pFxDriverGlobals;
184
187 tracker,
189 m_PoolTag,
191 }
192 else {
193 //
194 // PoolTracking is inactive, only format FX_POOL_HEADER area.
195 //
197 pHeader->Base = Alloc;
198 pHeader->FxDriverGlobals = pFxDriverGlobals;
199 }
200
201 return &pHeader->AllocationStart[0];
202}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
PFX_DRIVER_GLOBALS pFxDriverGlobals
FX_POOL_TRACKER * PFX_POOL_TRACKER
Definition: fxpool.h:109
FX_POOL_HEADER * PFX_POOL_HEADER
Definition: fxpool.h:51
VOID __inline FxPoolInsertNonPagedAllocateTracker(__in PFX_POOL Pool, __in PFX_POOL_TRACKER Tracker, __in SIZE_T Size, __in ULONG Tag, __in PVOID Caller)
#define _ReturnAddress()
Definition: intrin_arm.h:35
FX_POOL FxPoolFrameworks
Definition: fxglobals.h:388
BOOLEAN IsPoolTrackingOn(VOID)
Definition: fxglobals.h:215
#define WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, _type)
Definition: wdfcore.h:141

Referenced by FxNPagedLookasideList::Allocate(), FxNPagedLookasideListFromPool::Allocate(), and FxPagedLookasideListFromPool::Allocate().

◆ Reclaim()

virtual VOID FxLookasideList::Reclaim ( __in FxMemoryBufferFromLookaside Memory)
protectedpure virtual

Member Data Documentation

◆ FxMemoryBufferFromLookaside

friend FxLookasideList::FxMemoryBufferFromLookaside
private

Definition at line 27 of file fxlookasidelist.hpp.

Referenced by FxNPagedLookasideList::Allocate().

◆ m_BufferSize

◆ m_MemoryAttributes

◆ m_MemoryObjectSize

◆ m_PoolTag


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