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

Function Ext2IsEaNameValid

Ext4Fsd/ea.c:388–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388BOOLEAN
389Ext2IsEaNameValid(
390 IN OEM_STRING Name
391)
392{
393 ULONG Index;
394 UCHAR Char;
395
396 //
397 // Empty names are not valid
398 //
399
400 if (Name.Length == 0)
401 return FALSE;
402
403 //
404 // Do not allow EA name longer than 255 bytes
405 //
406 if (Name.Length > 255)
407 return FALSE;
408
409 for (Index = 0; Index < (ULONG)Name.Length; Index += 1) {
410
411 Char = Name.Buffer[Index];
412
413 //
414 // Skip over and Dbcs chacters
415 //
416 if (FsRtlIsLeadDbcsCharacter(Char)) {
417
418 ASSERT(Index != (ULONG)(Name.Length - 1));
419 Index += 1;
420 continue;
421 }
422
423 //
424 // Make sure this character is legal, and if a wild card, that
425 // wild cards are permissible.
426 //
427 if (!FsRtlIsAnsiCharacterLegalFat(Char, FALSE))
428 return FALSE;
429
430 }
431
432 return TRUE;
433}
434
435NTSTATUS
436Ext2SetEa (

Callers 2

Ext2SetEaFunction · 0.85
Ext2OverwriteEaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected