+ Status = gBS->LocateProtocol(&gEfiRamDiskProtocolGuid, NULL, (VOID **)&RamDisk);
+ if (EFI_ERROR(Status))
+ {
+ debug("Failed to locate ramdisk protocol %r", Status);
+ return Status;
+ }
+ debug("Locate RamDisk Protocol %r ...", Status);
+
+ Status = RamDisk->Register((UINTN)g_chain, (UINT64)g_iso_buf_size, &gEfiVirtualCdGuid, NULL, &DevicePath);
+ if (EFI_ERROR(Status))
+ {
+ debug("Failed to register ramdisk %r", Status);
+ return Status;
+ }
+
+ debug("Register RamDisk %r ...", Status);
+ debug("RamDisk DevicePath:<%s> ...", ConvertDevicePathToText(DevicePath, FALSE, FALSE));
+
+ ventoy_debug_pause();
+
+ gBlockData.Path = DevicePath;
+ gBlockData.DevicePathCompareLen = GetDevicePathSize(DevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
+
+ Status = ventoy_boot(ImageHandle);
+ if (EFI_NOT_FOUND == Status)
+ {
+ gST->ConOut->OutputString(gST->ConOut, L"No bootfile found for UEFI!\r\n");
+ gST->ConOut->OutputString(gST->ConOut, L"Maybe the image does not support " VENTOY_UEFI_DESC L"!\r\n");
+ sleep(300);
+ }
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS EFIAPI VentoyEfiMain