ReactOS
0.4.16-dev-746-g329a414
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
27
friend
FxMemoryBufferFromLookaside
;
28
29
public
:
30
FxLookasideList
(
31
__in
PFX_DRIVER_GLOBALS
FxDriverGlobals,
32
__in
USHORT
ObjectSize,
33
__in
ULONG
PoolTag
34
);
35
36
virtual
37
_Must_inspect_result_
38
NTSTATUS
39
Initialize
(
40
__in
size_t
BufferSize
,
41
__in
PWDF_OBJECT_ATTRIBUTES
MemoryAttributes
42
) =0;
43
44
virtual
45
_Must_inspect_result_
46
NTSTATUS
47
Allocate
(
48
__out
FxMemoryObject
** PPMemory
49
) =0;
50
51
size_t
52
GetBufferSize
(
53
VOID
54
)
55
{
56
return
m_BufferSize
;
57
}
58
59
protected
:
60
virtual
61
~FxLookasideList
(
62
);
63
64
//
65
// Function used by IFxMemoryBuffer to return itself to the lookaside list
66
//
67
virtual
68
VOID
69
Reclaim
(
70
__in
FxMemoryBufferFromLookaside
*
Memory
71
) =0;
72
73
_Must_inspect_result_
74
NTSTATUS
75
InitializeLookaside
(
76
__in
USHORT
BufferSize
,
77
__in
USHORT
MemoryObjectSize,
78
__in
PWDF_OBJECT_ATTRIBUTES
MemoryAttributes
79
);
80
81
PVOID
82
InitObjectAlloc
(
83
__out_bcount
(this->
m_MemoryObjectSize
)
PVOID
Alloc
84
);
85
86
static
87
VOID
88
_Reclaim
(
89
__in
PFX_DRIVER_GLOBALS
FxDriverGlobals,
90
__inout
PNPAGED_LOOKASIDE_LIST
List
,
91
__in
FxMemoryBufferFromLookaside
*
Memory
92
);
93
94
public
:
95
WDF_OBJECT_ATTRIBUTES
m_MemoryAttributes
;
96
97
protected
:
98
size_t
m_BufferSize
;
99
100
size_t
m_MemoryObjectSize
;
101
102
ULONG
m_PoolTag
;
103
};
104
105
class
FxLookasideListFromPool
:
public
FxLookasideList
{
106
friend
FxMemoryBufferFromPoolLookaside
;
107
108
public
:
109
FxLookasideListFromPool
(
110
__in
PFX_DRIVER_GLOBALS
FxDriverGlobals,
111
__in
USHORT
ObjectSize,
112
__in
ULONG
PoolTag
113
) :
FxLookasideList
(FxDriverGlobals, ObjectSize,
PoolTag
)
114
{
115
}
116
117
protected
:
118
virtual
119
VOID
120
ReclaimPool
(
121
__inout
PVOID
Pool
122
) =0;
123
};
124
125
126
#endif
// _FXLOOKASIDELIST_H_
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
Alloc
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition:
main.c:63
FxLookasideListFromPool
Definition:
fxlookasidelist.hpp:105
FxLookasideListFromPool::ReclaimPool
virtual VOID ReclaimPool(__inout PVOID Pool)=0
FxLookasideListFromPool::FxLookasideListFromPool
FxLookasideListFromPool(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize, __in ULONG PoolTag)
Definition:
fxlookasidelist.hpp:109
FxLookasideListFromPool::FxMemoryBufferFromPoolLookaside
friend FxMemoryBufferFromPoolLookaside
Definition:
fxlookasidelist.hpp:106
FxLookasideList
Definition:
fxlookasidelist.hpp:25
FxLookasideList::InitObjectAlloc
PVOID InitObjectAlloc(__out_bcount(this->m_MemoryObjectSize) PVOID Alloc)
Definition:
fxlookasidelist.cpp:147
FxLookasideList::GetBufferSize
size_t GetBufferSize(VOID)
Definition:
fxlookasidelist.hpp:52
FxLookasideList::m_PoolTag
ULONG m_PoolTag
Definition:
fxlookasidelist.hpp:102
FxLookasideList::FxMemoryBufferFromLookaside
friend FxMemoryBufferFromLookaside
Definition:
fxlookasidelist.hpp:27
FxLookasideList::Allocate
virtual _Must_inspect_result_ NTSTATUS Allocate(__out FxMemoryObject **PPMemory)=0
FxLookasideList::_Reclaim
static VOID _Reclaim(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __inout PNPAGED_LOOKASIDE_LIST List, __in FxMemoryBufferFromLookaside *Memory)
Definition:
fxlookasidelist.cpp:206
FxLookasideList::Reclaim
virtual VOID Reclaim(__in FxMemoryBufferFromLookaside *Memory)=0
FxLookasideList::InitializeLookaside
_Must_inspect_result_ NTSTATUS InitializeLookaside(__in USHORT BufferSize, __in USHORT MemoryObjectSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)
Definition:
fxlookasidelist.cpp:71
FxLookasideList::m_MemoryAttributes
WDF_OBJECT_ATTRIBUTES m_MemoryAttributes
Definition:
fxlookasidelist.hpp:95
FxLookasideList::m_BufferSize
size_t m_BufferSize
Definition:
fxlookasidelist.hpp:98
FxLookasideList::Initialize
virtual _Must_inspect_result_ NTSTATUS Initialize(__in size_t BufferSize, __in PWDF_OBJECT_ATTRIBUTES MemoryAttributes)=0
FxLookasideList::~FxLookasideList
virtual ~FxLookasideList()
Definition:
fxlookasidelist.cpp:51
FxLookasideList::m_MemoryObjectSize
size_t m_MemoryObjectSize
Definition:
fxlookasidelist.hpp:100
FxMemoryBufferFromLookaside
Definition:
fxmemorybufferfromlookaside.hpp:24
FxMemoryObject
Definition:
fxmemoryobject.hpp:72
FxObject
Definition:
fxobject.hpp:232
Pool
Definition:
bufpool.h:50
__in
#define __in
Definition:
dbghelp.h:35
__out_bcount
#define __out_bcount(x)
Definition:
dbghelp.h:68
__inout
#define __inout
Definition:
dbghelp.h:50
__out
#define __out
Definition:
dbghelp.h:62
void
Definition:
nsiface.idl:2307
_Must_inspect_result_
#define _Must_inspect_result_
Definition:
no_sal2.h:62
USHORT
unsigned short USHORT
Definition:
pedump.c:61
_FX_DRIVER_GLOBALS
Definition:
fxglobals.h:165
_WDF_OBJECT_ATTRIBUTES
Definition:
wdfobject.h:100
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
MemoryAttributes
_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
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
BufferSize
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition:
wdfmemory.h:254
PoolTag
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition:
wdfmemory.h:164
List
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition:
wdfresource.h:550
PNPAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
sdk
lib
drivers
wdf
shared
inc
private
common
fxlookasidelist.hpp
Generated on Thu Feb 13 2025 06:14:22 for ReactOS by
1.9.6