MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2IsSpecialSystemFile

Function Ext2IsSpecialSystemFile

Ext4Fsd/create.c:223–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223BOOLEAN
224Ext2IsSpecialSystemFile(
225 IN PUNICODE_STRING FileName,
226 IN BOOLEAN bDirectory
227)
228{
229 PWSTR SpecialFileList[] = {
230 L"pagefile.sys",
231 L"swapfile.sys",
232 L"hiberfil.sys",
233 NULL
234 };
235
236 PWSTR SpecialDirList[] = {
237 L"Recycled",
238 L"RECYCLER",
239 L"$RECYCLE.BIN",
240 NULL
241 };
242
243 PWSTR entryName;
244 ULONG length;
245 int i;
246
247 for (i = 0; TRUE; i++) {
248
249 if (bDirectory) {
250 entryName = SpecialDirList[i];
251 } else {
252 entryName = SpecialFileList[i];
253 }
254
255 if (NULL == entryName) {
256 break;
257 }
258
259 length = wcslen(entryName) * sizeof(WCHAR);
260 if (FileName->Length == length) {
261 if ( 0 == _wcsnicmp( entryName,
262 FileName->Buffer,
263 length / sizeof(WCHAR) )) {
264 return TRUE;
265 }
266 }
267 }
268
269 return FALSE;
270}
271
272NTSTATUS
273Ext2LookupFile (

Callers 2

Ext2ProcessEntryFunction · 0.85
Ext2LookupFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected