Driver is non-compliant with EFI_FILE_PROTOCOL.Read() specs (original) (raw)

Section 13.5 File Protocol of the UEFI Specification, Version 2.9 state that, for EFI_FILE_PROTOCOL.Read():

If This is a directory, the function reads the directory entry at the file’s current position and returns the entry in Buffer. If the Buffer is not large enough to hold the current directory entry, then EFI_BUFFER_TOO_SMALL is returned and (...) BufferSize is set to be the size of the buffer needed to read the entry.

However, as part of the investigation of pbatard/rufus#2210, we found that the current version of the driver may return 0 for BufferSize, if Buffer is not large enough, instead of the size of the buffer required to read the entry.