/* Find the deferred image which matches the device path. */
DEFERRED_3RD_PARTY_IMAGE_INFO* LookupImage(IN CONST EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath, IN BOOLEAN BootOption)
/* Find the deferred image which matches the device path. */
DEFERRED_3RD_PARTY_IMAGE_INFO* LookupImage(IN CONST EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath, IN BOOLEAN BootOption)
{
  UINTN  Index;
  UINTN  DevicePathSize;
  DevicePathSize = GetDevicePathSize (ImageDevicePath);
  for (Index = 0; Index < mDeferred3rdPartyImage.Count; Index++) {
    if (CompareMem (ImageDevicePath, mDeferred3rdPartyImage.ImageInfo[Index].ImageDevicePath, DevicePathSize) == 0) {
      ASSERT (mDeferred3rdPartyImage.ImageInfo[Index].BootOption == BootOption);
      return &mDeferred3rdPartyImage.ImageInfo[Index];
    }
  }
  return NULL;
}