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

Function Ext2IsNameValid

Ext4Fsd/create.c:35–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35BOOLEAN
36Ext2IsNameValid(PUNICODE_STRING FileName)
37{
38 USHORT i = 0;
39 PUSHORT pName = (PUSHORT) FileName->Buffer;
40
41 if (FileName == NULL) {
42 return FALSE;
43 }
44
45 while (i < (FileName->Length / sizeof(WCHAR))) {
46
47 if (pName[i] == 0) {
48 break;
49 }
50
51 if (pName[i] == L'|' || pName[i] == L':' ||
52 pName[i] == L'/' || pName[i] == L'*' ||
53 pName[i] == L'?' || pName[i] == L'\"' ||
54 pName[i] == L'<' || pName[i] == L'>' ) {
55
56 return FALSE;
57 }
58
59 i++;
60 }
61
62 return TRUE;
63}
64
65
66NTSTATUS

Callers 2

Ext2LookupFileFunction · 0.85
Ext2CreateFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected