23 IN CHAR16 *LongNameString
27 CHAR16 UpCasedLongFileName[EFI_PATH_STRING_LENGTH];
36 gBS->CalculateCrc32 (UpCasedLongFileName,
StrSize (UpCasedLongFileName), &HashValue);
37 return (HashValue & HASH_TABLE_MASK);
52 IN CHAR8 *ShortNameString
57 gBS->CalculateCrc32 (ShortNameString, FAT_NAME_LEN, &HashValue);
58 return (HashValue & HASH_TABLE_MASK);
74 IN CHAR16 *LongNameString
79 for (PreviousHashNode = &ODir->LongNameHashTable[
FatHashLongName (LongNameString)];
80 *PreviousHashNode !=
NULL;
81 PreviousHashNode = &(*PreviousHashNode)->LongNameForwardLink
84 if (
FatStriCmp (LongNameString, (*PreviousHashNode)->FileString) == 0) {
89 return PreviousHashNode;
105 IN CHAR8 *ShortNameString
110 for (PreviousHashNode = &ODir->ShortNameHashTable[
FatHashShortName (ShortNameString)];
111 *PreviousHashNode !=
NULL;
112 PreviousHashNode = &(*PreviousHashNode)->ShortNameForwardLink
115 if (
CompareMem (ShortNameString, (*PreviousHashNode)->Entry.FileName, FAT_NAME_LEN) == 0) {
120 return PreviousHashNode;
138 UINT32 HashTableIndex;
144 HashTable = ODir->ShortNameHashTable;
145 DirEnt->ShortNameForwardLink = HashTable[HashTableIndex];
146 HashTable[HashTableIndex] = DirEnt;
151 HashTable = ODir->LongNameHashTable;
152 DirEnt->LongNameForwardLink = HashTable[HashTableIndex];
153 HashTable[HashTableIndex] = DirEnt;
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
INTN FatStriCmp(IN CHAR16 *Str1, IN CHAR16 *Str2)
VOID FatStrUpr(IN CHAR16 *Str)
FAT_DIRENT ** FatShortNameHashSearch(IN FAT_ODIR *ODir, IN CHAR8 *ShortNameString)
VOID FatInsertToHashTable(IN FAT_ODIR *ODir, IN FAT_DIRENT *DirEnt)
STATIC UINT32 FatHashShortName(IN CHAR8 *ShortNameString)
STATIC UINT32 FatHashLongName(IN CHAR16 *LongNameString)
VOID FatDeleteFromHashTable(IN FAT_ODIR *ODir, IN FAT_DIRENT *DirEnt)
FAT_DIRENT ** FatLongNameHashSearch(IN FAT_ODIR *ODir, IN CHAR16 *LongNameString)
#define ARRAY_SIZE(Array)