ReactOS  0.4.15-dev-3324-gda4e15f
fxlookasidelist.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxLookasideList.hpp
8 
9 Abstract:
10 
11 Author:
12 
13 Environment:
14 
15  kernel mode only
16 
17 Revision History:
18 
19 
20 --*/
21 
22 #ifndef _FXLOOKASIDELIST_H_
23 #define _FXLOOKASIDELIST_H_
24 
25 class FxLookasideList : public FxObject {
26 
28 
29 public:
31  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
32  __in USHORT ObjectSize,
34  );
35 
36  virtual
38  NTSTATUS
39  Initialize(
40  __in size_t BufferSize,
42  ) =0;
43 
44  virtual
46  NTSTATUS
47  Allocate(
48  __out FxMemoryObject** PPMemory
49  ) =0;
50 
51  size_t
53  VOID
54  )
55  {
56  return m_BufferSize;
57  }
58 
59 protected:
60  virtual
62  );
63 
64  //
65  // Function used by IFxMemoryBuffer to return itself to the lookaside list
66  //
67  virtual
68  VOID
69  Reclaim(
71  ) =0;
72 
74  NTSTATUS
77  __in USHORT MemoryObjectSize,
79  );
80 
81  PVOID
84  );
85 
86  static
87  VOID
88  _Reclaim(
89  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
92  );
93 
94 public:
96 
97 protected:
98  size_t m_BufferSize;
99 
101 
103 };
104 
107 
108 public:
110  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
111  __in USHORT ObjectSize,
113  ) : FxLookasideList(FxDriverGlobals, ObjectSize, PoolTag)
114  {
115  }
116 
117 protected:
118  virtual
119  VOID
120  ReclaimPool(
122  ) =0;
123 };
124 
125 
126 #endif // _FXLOOKASIDELIST_H_
FxLookasideList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in ULONG PoolTag)
PVOID InitObjectAlloc(__out_bcount(this->m_MemoryObjectSize) PVOID Alloc)
static VOID _Reclaim(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __inout PNPAGED_LOOKASIDE_LIST List, __in FxMemoryBufferFromLookaside *Memory)
_Must_inspect_result_ NTSTATUS InitializeLookaside(__in USHORT BufferSize, __in USHORT MemoryObjectSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)
#define __out_bcount(x)
Definition: dbghelp.h:68
LONG NTSTATUS
Definition: precomp.h:26
virtual VOID Reclaim(__in FxMemoryBufferFromLookaside *Memory)=0
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
size_t GetBufferSize(VOID)
virtual _Must_inspect_result_ NTSTATUS Allocate(__out FxMemoryObject **PPMemory)=0
#define __out
Definition: dbghelp.h:62
FxLookasideListFromPool(__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 _In_ _Out_ WDFMEMORY * Memory
Definition: wdfmemory.h:169
virtual _Must_inspect_result_ NTSTATUS Initialize(__in size_t BufferSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)=0
friend FxMemoryBufferFromLookaside
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
Definition: bufpool.h:50
virtual VOID ReclaimPool(__inout PVOID Pool)=0
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:159
_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
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define __inout
Definition: dbghelp.h:50
#define _Must_inspect_result_
Definition: ms_sal.h:558
WDF_OBJECT_ATTRIBUTES m_MemoryAttributes
unsigned short USHORT
Definition: pedump.c:61
virtual ~FxLookasideList()
unsigned int ULONG
Definition: retypes.h:1
#define __in
Definition: dbghelp.h:35
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251