/* Searches the Fv for a file by its name */
EFI_STATUS FvBufFindFileByName(IN VOID *Fv, IN EFI_GUID *Name, OUT VOID **File)
/* Searches the Fv for a file by its name */
EFI_STATUS FvBufFindFileByName(IN VOID *Fv, IN EFI_GUID *Name, OUT VOID **File)
{
  EFI_STATUS Status;
  UINTN Key;
  EFI_FFS_FILE_HEADER *NextFile;
  Key = 0;
  while (TRUE) {
    Status = FvBufFindNextFile (Fv, &Key, (VOID **)&NextFile);
    if (EFI_ERROR (Status)) {
      return Status;
    }
    if (CommonLibBinderCompareGuid (Name, &NextFile->Name)) {
      if (File != NULL) {
        *File = NextFile;
      }
      return EFI_SUCCESS;
    }
  }
  return EFI_NOT_FOUND;
}