38 return ImageType == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION;
49 UINTN PeCoffHeaderOffset;
52 UINTN NumberOfSections;
57 if (DosHdr->
e_magic != EFI_IMAGE_DOS_SIGNATURE) {
61 PeCoffHeaderOffset = DosHdr->
e_lfanew;
65 Pe32->FileHeader.SizeOfOptionalHeader);
66 NumberOfSections = (
UINTN)Pe32->FileHeader.NumberOfSections;
68 while (NumberOfSections--) {
69 if (!
CompareMem (Section->Name,
".compat", sizeof (Section->Name))) {
74 PeCompatEnd = (
UINTN)(VOID *)PeCompat + Section->Misc.VirtualSize;
76 while (PeCompat->Type != 0 && (
UINTN)(VOID *)PeCompat < PeCompatEnd) {
77 if ((PeCompat->Type == 1) &&
79 EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCompat->MachineType))
85 ASSERT ((
UINTN)(VOID *)PeCompat < PeCompatEnd);
107 CompatEntryPoint = GetCompatEntryPoint (ImageBase);
108 if (CompatEntryPoint ==
NULL) {
109 return EFI_UNSUPPORTED;
112 *EntryPoint = CompatEntryPoint;
131 EDKII_PECOFF_IMAGE_EMULATOR_VERSION,
137CompatImageLoaderDxeEntryPoint (
142 return gBS->InstallProtocolInterface (
144 &gEdkiiPeCoffImageEmulatorProtocolGuid,
146 &mCompatLoaderPeCoffEmuProtocol
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_IMAGE_MACHINE_X64
EFI_STATUS(EFIAPI * EFI_IMAGE_ENTRY_POINT)(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
UINT32 e_lfanew
File address of new exe header.
UINT16 e_magic
Magic number.