| 386 | } |
| 387 | |
| 388 | BOOLEAN |
| 389 | Ext2IsEaNameValid( |
| 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 | |
| 435 | NTSTATUS |
| 436 | Ext2SetEa ( |
no outgoing calls
no test coverage detected