/* Decides whether a PE/COFF image can execute on this system, either natively or via emulation/interpretation. In the latter case, the PeCoffEmu member of the LOADED_IMAGE_PRIVATE_DATA struct pointer is populated with a pointer to the emulator protocol that supports this image. */
STATIC BOOLEAN CoreIsImageTypeSupported(IN OUT LOADED_IMAGE_PRIVATE_DATA *Image)
/* Decides whether a PE/COFF image can execute on this system, either natively or via emulation/interpretation. In the latter case, the PeCoffEmu member of the LOADED_IMAGE_PRIVATE_DATA struct pointer is populated with a pointer to the emulator protocol that supports this image. */
STATIC BOOLEAN CoreIsImageTypeSupported(IN OUT LOADED_IMAGE_PRIVATE_DATA *Image)
{
  LIST_ENTRY      *Link;
  EMULATOR_ENTRY  *Entry;
  for (Link = GetFirstNode (&mAvailableEmulators);
       !IsNull (&mAvailableEmulators, Link);
       Link = GetNextNode (&mAvailableEmulators, Link))
  {
    Entry = BASE_CR (Link, EMULATOR_ENTRY, Link);
    if (Entry->MachineType != Image->ImageContext.Machine) {
      continue;
    }
    if (Entry->Emulator->IsImageSupported (
                           Entry->Emulator,
                           Image->ImageContext.ImageType,
                           Image->Info.FilePath
                           ))
    {
      Image->PeCoffEmu = Entry->Emulator;
      return TRUE;
    }
  }
  return EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Image->ImageContext.Machine) ||
         EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED (Image->ImageContext.Machine);
}