ReactOS  0.4.15-dev-2703-g05fb0f1
FxNPagedLookasideList Class Reference

#include <fxnpagedlookasidelist.hpp>

Inheritance diagram for FxNPagedLookasideList:
Collaboration diagram for FxNPagedLookasideList:

Public Member Functions

 FxNPagedLookasideList (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in ULONG PoolTag)
 
virtual _Must_inspect_result_ NTSTATUS Initialize (__in size_t BufferSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)
 
virtual _Must_inspect_result_ NTSTATUS Allocate (__out FxMemoryObject **PPMemory)
 
- Public Member Functions inherited from FxLookasideList
 FxLookasideList (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in ULONG PoolTag)
 
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)
 

Protected Member Functions

 ~FxNPagedLookasideList ()
 
virtual VOID Reclaim (__in FxMemoryBufferFromLookaside *Memory)
 
- Protected Member Functions inherited from FxLookasideList
virtual ~FxLookasideList ()
 
_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)
 

Protected Attributes

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

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)
 
- Public Attributes inherited from FxLookasideList
WDF_OBJECT_ATTRIBUTES m_MemoryAttributes
 
- Static Protected Member Functions inherited from FxLookasideList
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)
 

Detailed Description

Definition at line 24 of file fxnpagedlookasidelist.hpp.

Constructor & Destructor Documentation

◆ FxNPagedLookasideList()

FxNPagedLookasideList::FxNPagedLookasideList ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in ULONG  PoolTag 
)

Definition at line 29 of file fxnpagedlookasidelistkm.cpp.

32  :
33  FxLookasideList(FxDriverGlobals, sizeof(*this), PoolTag)
34 {
35 }
FxLookasideList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in ULONG PoolTag)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:159

◆ ~FxNPagedLookasideList()

FxNPagedLookasideList::~FxNPagedLookasideList ( )
protected

Definition at line 37 of file fxnpagedlookasidelistkm.cpp.

38 {
39  if (m_MemoryObjectSize != 0) {
41  }
42 }
NPAGED_LOOKASIDE_LIST m_ObjectLookaside
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170

Member Function Documentation

◆ Allocate()

_Must_inspect_result_ NTSTATUS FxNPagedLookasideList::Allocate ( __out FxMemoryObject **  PPMemory)
virtual

Implements FxLookasideList.

Definition at line 93 of file fxnpagedlookasidelistkm.cpp.

96 {
98  PVOID p;
99 
100  if (PPMemory == NULL) {
102  }
103 
104  *PPMemory = NULL;
105 
106  //
107  // Get the raw memory allocation.
108  //
110  if (p == NULL) {
112  }
113 
114  p = InitObjectAlloc(p);
115 
116  //
117  // Construct new FxMemoryBufferFromLookaside
118  //
121 
122  //
123  // pBuffer might be displaced if there is a debug extension
124  //
125  ASSERT(_GetBase(pBuffer) == p);
126 
127  *PPMemory = pBuffer;
128 
129  return STATUS_SUCCESS;
130 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PVOID InitObjectAlloc(__out_bcount(this->m_MemoryObjectSize) PVOID Alloc)
static PVOID _GetBase(__in FxObject *Object)
Definition: fxobject.hpp:418
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
__inline PVOID FxAllocateFromNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ size_t ElementSize=0)
Definition: fxglobalskm.h:565
PVOID pBuffer
#define ASSERT(a)
Definition: mode.c:44
NPAGED_LOOKASIDE_LIST m_ObjectLookaside
friend FxMemoryBufferFromLookaside
WDF_OBJECT_ATTRIBUTES m_MemoryAttributes
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
GLfloat GLfloat p
Definition: glext.h:8902

◆ Initialize()

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

Implements FxLookasideList.

Definition at line 46 of file fxnpagedlookasidelistkm.cpp.

50 {
52 
53  //
54  // This type of class does not support BufferSize greater than 0xFFFF.
55  // The verification below ensures this contract is respected in both
56  // free and chk builds.
57  //
58  if (BufferSize > MAXUSHORT) {
59  ASSERT(FALSE);
61  goto Done;
62  }
63 
67 
68  //
69  // Must be called after InitializeLookaside so that m_MemoryObjectSize is
70  // computed correctly.
71  //
72  if (NT_SUCCESS(status)) {
74 
75  //
76  // Initialize a non-paged pool with these characteristics.
77  //
79  NULL,
80  NULL,
81  0,
83  m_PoolTag,
84  0);
85  }
86 
87 Done:
88  return status;
89 }
_Must_inspect_result_ NTSTATUS InitializeLookaside(__in USHORT BufferSize, __in USHORT MemoryObjectSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)
LONG NTSTATUS
Definition: precomp.h:26
#define FALSE
Definition: types.h:117
#define STATUS_INVALID_BUFFER_SIZE
Definition: ntstatus.h:650
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NPAGED_LOOKASIDE_LIST m_ObjectLookaside
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES MemoryAttributes
Definition: wdfmemory.h:407
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
#define MAXUSHORT
Definition: typedefs.h:83
static SERVICE_STATUS status
Definition: service.c:31
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251
Definition: ps.c:97

◆ Reclaim()

VOID FxNPagedLookasideList::Reclaim ( __in FxMemoryBufferFromLookaside Memory)
protectedvirtual

Implements FxLookasideList.

Definition at line 133 of file fxnpagedlookasidelistkm.cpp.

136 {
138 }
static VOID _Reclaim(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __inout PNPAGED_LOOKASIDE_LIST List, __in FxMemoryBufferFromLookaside *Memory)
_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
NPAGED_LOOKASIDE_LIST m_ObjectLookaside
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734

Member Data Documentation

◆ m_ObjectLookaside

NPAGED_LOOKASIDE_LIST FxNPagedLookasideList::m_ObjectLookaside
protected

Definition at line 56 of file fxnpagedlookasidelist.hpp.

Referenced by Allocate(), Initialize(), Reclaim(), and ~FxNPagedLookasideList().


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