/* Find image record according to image base and size. */
IMAGE_PROPERTIES_RECORD* EFIAPI FindImageRecord(IN EFI_PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize, IN LIST_ENTRY *ImageRecordList)
/* Find image record according to image base and size. */
IMAGE_PROPERTIES_RECORD* EFIAPI FindImageRecord(IN EFI_PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize, IN LIST_ENTRY *ImageRecordList)
{
  IMAGE_PROPERTIES_RECORD  *ImageRecord;
  LIST_ENTRY               *ImageRecordLink;
  if (ImageRecordList == NULL) {
    return NULL;
  }
  for (ImageRecordLink = ImageRecordList->ForwardLink;
       ImageRecordLink != ImageRecordList;
       ImageRecordLink = ImageRecordLink->ForwardLink)
  {
    ImageRecord = CR (
                    ImageRecordLink,
                    IMAGE_PROPERTIES_RECORD,
                    Link,
                    IMAGE_PROPERTIES_RECORD_SIGNATURE
                    );
    if ((ImageBase == ImageRecord->ImageBase) &&
        (ImageSize == ImageRecord->ImageSize))
    {
      return ImageRecord;
    }
  }
  return NULL;
}