Process Hacker
filepoolp.h
Go to the documentation of this file.
1 #ifndef _PH_FILEPOOLP_H
2 #define _PH_FILEPOOLP_H
3 
4 typedef struct _PH_FILE_POOL_VIEW
5 {
6  LIST_ENTRY ByIndexListEntry;
9 
10  ULONG RefCount;
11  ULONG SegmentIndex;
12  PVOID Base;
14 
16  _Inout_ PPH_FILE_POOL_PARAMETERS Parameters
17  );
18 
20  _Out_ PPH_FILE_POOL_PARAMETERS Parameters
21  );
22 
23 // Range mapping
24 
25 NTSTATUS PhFppExtendRange(
26  _Inout_ PPH_FILE_POOL Pool,
27  _In_ ULONG NewSize
28  );
29 
30 NTSTATUS PhFppMapRange(
31  _Inout_ PPH_FILE_POOL Pool,
32  _In_ ULONG Offset,
33  _In_ ULONG Size,
34  _Out_ PVOID *Base
35  );
36 
37 NTSTATUS PhFppUnmapRange(
38  _Inout_ PPH_FILE_POOL Pool,
39  _In_ PVOID Base
40  );
41 
42 // Segments
43 
45  _Inout_ PPH_FILE_POOL Pool,
46  _Out_ PPH_FP_BLOCK_HEADER BlockOfSegmentHeader,
47  _In_ ULONG AdditionalBlocksUsed
48  );
49 
51  _Inout_ PPH_FILE_POOL Pool,
52  _Out_ PULONG NewSegmentIndex
53  );
54 
56  _Inout_ PPH_FILE_POOL Pool,
57  _In_ PPH_FP_BLOCK_HEADER FirstBlock
58  );
59 
60 // Views
61 
63  _Inout_ PPH_FILE_POOL Pool,
64  _Inout_ PPH_FILE_POOL_VIEW View
65  );
66 
68  _Inout_ PPH_FILE_POOL Pool,
69  _Inout_ PPH_FILE_POOL_VIEW View
70  );
71 
72 PPH_FILE_POOL_VIEW PhFppFindViewByIndex(
73  _Inout_ PPH_FILE_POOL Pool,
74  _In_ ULONG SegmentIndex
75  );
76 
78  _In_ PPH_AVL_LINKS Links1,
80  );
81 
83  _Inout_ PPH_FILE_POOL Pool,
84  _Inout_ PPH_FILE_POOL_VIEW View
85  );
86 
88  _Inout_ PPH_FILE_POOL Pool,
89  _Inout_ PPH_FILE_POOL_VIEW View
90  );
91 
92 PPH_FILE_POOL_VIEW PhFppFindViewByBase(
93  _Inout_ PPH_FILE_POOL Pool,
94  _In_ PVOID Base
95  );
96 
97 PPH_FILE_POOL_VIEW PhFppCreateView(
98  _Inout_ PPH_FILE_POOL Pool,
99  _In_ ULONG SegmentIndex
100  );
101 
103  _Inout_ PPH_FILE_POOL Pool,
104  _Inout_ PPH_FILE_POOL_VIEW View
105  );
106 
108  _Inout_ PPH_FILE_POOL Pool,
109  _Inout_ PPH_FILE_POOL_VIEW View
110  );
111 
113  _Inout_ PPH_FILE_POOL Pool,
114  _Inout_ PPH_FILE_POOL_VIEW View
115  );
116 
118  _Inout_ PPH_FILE_POOL Pool,
119  _Inout_ PPH_FILE_POOL_VIEW View
120  );
121 
123  _Inout_ PPH_FILE_POOL Pool,
124  _Inout_ PPH_FILE_POOL_VIEW View
125  );
126 
128  _Inout_ PPH_FILE_POOL Pool,
129  _In_ ULONG SegmentIndex
130  );
131 
133  _Inout_ PPH_FILE_POOL Pool,
134  _In_ ULONG SegmentIndex
135  );
136 
138  _Inout_ PPH_FILE_POOL Pool,
139  _In_ PVOID Base
140  );
141 
143  _Inout_ PPH_FILE_POOL Pool,
144  _In_ PVOID Base
145  );
146 
147 // Bitmap allocation
148 
150  _Inout_ PPH_FILE_POOL Pool,
151  _In_ PPH_FP_BLOCK_HEADER FirstBlock,
152  _Inout_ PPH_FP_SEGMENT_HEADER SegmentHeader,
153  _In_ ULONG NumberOfBlocks
154  );
155 
157  _Inout_ PPH_FILE_POOL Pool,
158  _In_ PPH_FP_BLOCK_HEADER FirstBlock,
159  _Inout_ PPH_FP_SEGMENT_HEADER SegmentHeader,
160  _In_ PPH_FP_BLOCK_HEADER BlockHeader
161  );
162 
163 // Free list
164 
166  _In_ PPH_FILE_POOL Pool,
167  _In_ ULONG NumberOfBlocks
168  );
169 
170 BOOLEAN PhFppInsertFreeList(
171  _Inout_ PPH_FILE_POOL Pool,
172  _In_ ULONG FreeListIndex,
173  _In_ ULONG SegmentIndex,
174  _In_ PPH_FP_SEGMENT_HEADER SegmentHeader
175  );
176 
177 BOOLEAN PhFppRemoveFreeList(
178  _Inout_ PPH_FILE_POOL Pool,
179  _In_ ULONG FreeListIndex,
180  _In_ ULONG SegmentIndex,
181  _In_ PPH_FP_SEGMENT_HEADER SegmentHeader
182  );
183 
184 // Misc.
185 
187  _In_ PPH_FILE_POOL Pool,
188  _In_ PVOID Block
189  );
190 
191 ULONG PhFppEncodeRva(
192  _In_ PPH_FILE_POOL Pool,
193  _In_ ULONG SegmentIndex,
194  _In_ PPH_FP_BLOCK_HEADER FirstBlock,
195  _In_ PVOID Address
196  );
197 
198 ULONG PhFppDecodeRva(
199  _In_ PPH_FILE_POOL Pool,
200  _In_ ULONG Rva,
201  _Out_ PULONG SegmentIndex
202  );
203 
204 #endif