/* Searches DxeCore in all firmware Volumes and loads the first instance that contains DxeCore. */
EFI_PEI_FILE_HANDLE DxeIplFindDxeCore(VOID)
/* Searches DxeCore in all firmware Volumes and loads the first instance that contains DxeCore. */
EFI_PEI_FILE_HANDLE DxeIplFindDxeCore(VOID)
{
  EFI_STATUS           Status;
  UINTN                Instance;
  EFI_PEI_FV_HANDLE    VolumeHandle;
  EFI_PEI_FILE_HANDLE  FileHandle;
  Instance = 0;
  while (TRUE) {
    Status = PeiServicesFfsFindNextVolume (Instance, &VolumeHandle);
    if (EFI_ERROR (Status)) {
      REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_EC_DXE_CORRUPT));
    }
    ASSERT_EFI_ERROR (Status);
    FileHandle = NULL;
    Status     = PeiServicesFfsFindNextFile (EFI_FV_FILETYPE_DXE_CORE, VolumeHandle, &FileHandle);
    if (!EFI_ERROR (Status)) {
      return FileHandle;
    }
    Instance++;
  }
}