/* This routine also will remove the FV information found by given FV format GUID from PrivateData->UnknownFvInfo. */
EFI_STATUS FindUnknownFormatFvInfo(IN PEI_CORE_INSTANCE *PrivateData, IN EFI_GUID *Format, OUT VOID **FvInfo, OUT UINT32 *FvInfoSize, OUT UINT32 *AuthenticationStatus)
/* This routine also will remove the FV information found by given FV format GUID from PrivateData->UnknownFvInfo. */
EFI_STATUS FindUnknownFormatFvInfo(IN PEI_CORE_INSTANCE *PrivateData, IN EFI_GUID *Format, OUT VOID **FvInfo, OUT UINT32 *FvInfoSize, OUT UINT32 *AuthenticationStatus)
{
  UINTN  Index;
  UINTN  Index2;
  Index = 0;
  for ( ; Index < PrivateData->UnknownFvInfoCount; Index++) {
    if (CompareGuid (Format, &PrivateData->UnknownFvInfo[Index].FvFormat)) {
      break;
    }
  }
  if (Index == PrivateData->UnknownFvInfoCount) {
    return EFI_NOT_FOUND;
  }
  *FvInfo               = PrivateData->UnknownFvInfo[Index].FvInfo;
  *FvInfoSize           = PrivateData->UnknownFvInfo[Index].FvInfoSize;
  *AuthenticationStatus = PrivateData->UnknownFvInfo[Index].AuthenticationStatus;
  Index2 = Index + 1;
  for ( ; Index2 < PrivateData->UnknownFvInfoCount; Index2++, Index++) {
    CopyMem (&PrivateData->UnknownFvInfo[Index], &PrivateData->UnknownFvInfo[Index2], sizeof (PEI_CORE_UNKNOW_FORMAT_FV_INFO));
  }
  PrivateData->UnknownFvInfoCount--;
  return EFI_SUCCESS;
}