Skip to content

Commit

Permalink
Always start at the top of the directory in SetPathCase()
Browse files Browse the repository at this point in the history
* When uefi-ntfs is being chainloaded, we can't guarantee that the file system
  will not have some directories already opened, in which case directory listing
  may continue from an existing location when invoking SetPathCase(), instead of
  starting from the beginning of that directory.
* Alleviate this by always issuing a SetPosition(0) when entering a directory.
  • Loading branch information
pbatard committed Apr 3, 2024
1 parent ae74e6a commit ee57bd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions path.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ EFI_STATUS SetPathCase(CONST EFI_FILE_HANDLE Root, CHAR16* Path)
if (EFI_ERROR(Status))
goto out;

// Make sure we always start at the top of the directory list
FileHandle->SetPosition(FileHandle, 0);

do {
Size = FileInfoSize;
ZeroMem(FileInfo, Size);
Expand Down

0 comments on commit ee57bd9

Please sign in to comment.