From ee57bd9187ccacc6c85c97677774a811c2814eb8 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 3 Apr 2024 20:09:39 +0100 Subject: [PATCH] Always start at the top of the directory in SetPathCase() * 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. --- path.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/path.c b/path.c index 506735a..da97b15 100644 --- a/path.c +++ b/path.c @@ -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);