ReactOS 0.4.15-dev-7834-g00c4b3d
fxpagedlookasidelist.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxPagedLookasideList.hpp
8
9Abstract:
10
11Author:
12
13Environment:
14
15 kernel mode only
16
17Revision History:
18
19--*/
20
21#ifndef _FXPAGEDLOOKASIDELIST_H_
22#define _FXPAGEDLOOKASIDELIST_H_
23
25
27
28public:
30 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
32 __in FxDeviceBase* DeviceBase,
33 __in FxDeviceBase* MemoryDeviceBase
34 );
35
36 virtual
40 __in size_t BufferSize,
42 );
43
44 virtual
48 __out FxMemoryObject** PPMemory
49 );
50
51protected:
53 VOID
54 );
55
56 virtual
57 VOID
58 Reclaim(
60 );
61
62 virtual
63 VOID
66 )
67 {
68 if (m_BufferSize < PAGE_SIZE) {
70
71 //
72 // For < PAGE_SIZE, we track the allocation
73 //
74 pHeader = CONTAINING_RECORD(Pool, FX_POOL_HEADER, AllocationStart);
75
76 //
77 // If PoolTracker is on then do....
78 //
79 if (GetDriverGlobals()->IsPoolTrackingOn()) {
80 //
81 // Decommission this Paged Allocation tracker
82 //
83#pragma prefast(suppress:__WARNING_BUFFER_UNDERFLOW, "Accessing pool's header to reclaim pool");
85 }
86
87#pragma prefast(suppress:__WARNING_BUFFER_UNDERFLOW, "Accessing pool's header to reclaim pool");
89 }
90 else {
91 //
92 // Page or greater size has no allocation tracking info prepended
93 // to the allocation.
94 //
96 }
97 }
98
99 PVOID
102 );
103
104 BOOLEAN
106 VOID
107 )
108 {
109 return m_MemoryDeviceBase != NULL ? TRUE : FALSE;
110 }
111
112protected:
113 //
114 // m_BufferSize is the size of the allocation that client sees.
115 // m_RawBufferSize is m_BufferSize + whatever else we need to track the
116 // allocation.
117 //
119
121
123
125};
126
127#endif // _FXPAGEDLOOKASIDELIST_H_
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
virtual VOID Reclaim(__in FxMemoryBufferFromLookaside *Memory)
virtual VOID ReclaimPool(__inout PVOID Pool)
NPAGED_LOOKASIDE_LIST m_ObjectLookaside
PVOID InitPagedAlloc(__out_bcount(this->m_RawBufferSize) PVOID Alloc)
Definition: bufpool.h:50
#define __in
Definition: dbghelp.h:35
#define __out_bcount(x)
Definition: dbghelp.h:68
#define __inout
Definition: dbghelp.h:50
#define __out
Definition: dbghelp.h:62
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define PAGE_SIZE
Definition: env_spec_w32.h:49
__inline VOID FxFreeToPagedLookasideList(__in PPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalskm.h:694
FX_POOL_TRACKER * PFX_POOL_TRACKER
Definition: fxpool.h:109
VOID __inline FxPoolRemovePagedAllocateTracker(__in PFX_POOL_TRACKER Tracker)
FxContextHeader * pHeader
Definition: handleapi.cpp:604
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_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
_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
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
static void Initialize()
Definition: xlate.c:212