diff --git a/MdeModulePkg/Core/Dxe/DxeRing3/Ring3UefiBootServices.c b/MdeModulePkg/Core/Dxe/DxeRing3/Ring3UefiBootServices.c index 54f0b2abd1..0dab6fc79e 100644 --- a/MdeModulePkg/Core/Dxe/DxeRing3/Ring3UefiBootServices.c +++ b/MdeModulePkg/Core/Dxe/DxeRing3/Ring3UefiBootServices.c @@ -594,7 +594,8 @@ Ring3LocateHandleBuffer ( Buffer ); - if ((NumberHandles != NULL) && (*NumberHandles != 0) && (Buffer != NULL) && (*Buffer != NULL)) { + if ((!EFI_ERROR (StatusBS)) && (NumberHandles != NULL) && (*NumberHandles != 0) + && (Buffer != NULL) && (*Buffer != NULL)) { PoolSize = *NumberHandles * sizeof (EFI_HANDLE *); Status = CoreAllocatePool (EfiRing3MemoryType, PoolSize, &Pool); diff --git a/MdeModulePkg/Core/Dxe/SysCall/BootServices.c b/MdeModulePkg/Core/Dxe/SysCall/BootServices.c index f6d004c012..8ae1175bdf 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/BootServices.c +++ b/MdeModulePkg/Core/Dxe/SysCall/BootServices.c @@ -18,6 +18,44 @@ typedef struct { UINTN mRing3InterfacePointer = 0; +CHAR8 *SysCallNames[] = { + // + // BootServices + // + "SysCallReturnToCore", // Must always be zero for CoreBootServices.nasm. + "SysCallLocateProtocol", + "SysCallOpenProtocol", + "SysCallInstallMultipleProtocolInterfaces", + "SysCallCloseProtocol", + "SysCallHandleProtocol", + "SysCallAllocatePages", + "SysCallFreePages", + "SysCallRaiseTpl", + "SysCallRestoreTpl", + "SysCallLocateHandleBuffer", + "SysCallCalculateCrc32", + // + // RuntimeServices + // + "SysCallGetVariable", + // + // Protocols + // + "SysCallBlockIoReset", + "SysCallBlockIoRead", + "SysCallBlockIoWrite", + "SysCallBlockIoFlush", + "SysCallDiskIoRead", + "SysCallDiskIoWrite", + "SysCallUnicodeStriColl", + "SysCallUnicodeMetaiMatch", + "SysCallUnicodeStrLwr", + "SysCallUnicodeStrUpr", + "SysCallUnicodeFatToStr", + "SysCallUnicodeStrToFat", + "SysCallMax" +}; + EFI_STATUS EFIAPI CallInstallMultipleProtocolInterfaces (