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

Function Ext2IsWearingCloak

Ext4Fsd/dirctl.c:369–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367
368
369BOOLEAN
370Ext2IsWearingCloak(
371 IN PEXT2_VCB Vcb,
372 IN POEM_STRING OemName
373)
374{
375 size_t PatLen = 0;
376
377 /* we could not filter the files: "." and ".." */
378 if (OemName->Length >= 1 && OemName->Buffer[0] == '.') {
379
380 if ( OemName->Length == 2 && OemName->Buffer[1] == '.') {
381 return FALSE;
382 } else if (OemName->Length == 1) {
383 return FALSE;
384 }
385 }
386
387 /* checking name prefix */
388 if (Vcb->bHidingPrefix) {
389 PatLen = strlen(&Vcb->sHidingPrefix[0]);
390 if (PatLen > 0 && PatLen <= OemName->Length) {
391 if ( _strnicmp( OemName->Buffer,
392 Vcb->sHidingPrefix,
393 PatLen ) == 0) {
394 return TRUE;
395 }
396 }
397 }
398
399 /* checking name suffix */
400 if (Vcb->bHidingSuffix) {
401 PatLen = strlen(&Vcb->sHidingSuffix[0]);
402 if (PatLen > 0 && PatLen <= OemName->Length) {
403 if ( _strnicmp(&OemName->Buffer[OemName->Length - PatLen],
404 Vcb->sHidingSuffix, PatLen ) == 0) {
405 return TRUE;
406 }
407 }
408 }
409
410 return FALSE;
411}
412
413static int Ext2FillEntry(void *context, const char *name, int namlen,
414 ULONG offset, __u32 ino, unsigned int d_type)

Callers 2

Ext2FillEntryFunction · 0.85
Ext2QueryDirectoryFunction · 0.85

Calls 1

_strnicmpFunction · 0.85

Tested by

no test coverage detected