Hi ,
I am trying to load an EFI from another EFI, it stuck when LoadImage is
called
both EFI are located on USB .
Here is code snippet
"
UINTN NumberFileSystemHandles;
EFI_HANDLE *FileSystemHandles;
UINTN Index;
EFI_BLOCK_IO* BlkIo;
EFI_DEVICE_PATH_PROTOCOL *FilePath;
EFI_HANDLE NewHandle;
UINTN ExitDataSizePtr;
EFI_BOOT_LOGO_PROTOCOL *BootLogo;
EFI_STATUS Status;
gBS->LocateHandleBuffer(ByProtocol,
&gEfiBlockIoProtocolGuid,
NULL,
&NumberFileSystemHandles,
&FileSystemHandles);
for(Index = 0; Index<NumberFileSystemHandles; ++Index) {
Status = gBS -> HandleProtocol(FileSystemHandles[Index],
&gEfiBlockIoProtocolGuid,
(VOID**) &BlkIo);
Print(L"after HandleProtocol %x - %r\n",FileSystemHandles[Index],
Status);
if(!EFI_ERROR(Status)) {
//check if it is usb
if(!BlkIo->Media->RemovableMedia ||
BlkIo->Media->RemovableMedia)
{
FilePath = FileDevicePath(FileSystemHandles[Index],
L"Hello.efi");
Status = gBS->LoadImage(
FALSE,
gImageHandle,
FilePath,
NULL,
0,
&NewHandle);
if (EFI_ERROR(Status)) {
if (NewHandle != NULL) {
gBS->UnloadImage(NewHandle);
}
//return (Status);
}
}
"
can any one help me what I am doing wrong here?
--
Regards
Saqib
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel