/* Swap two code sections in a single IMAGE_PROPERTIES_RECORD. */
EFI_STATUS EFIAPI SwapImageRecordCodeSection(IN IMAGE_PROPERTIES_RECORD_CODE_SECTION *FirstImageRecordCodeSection, IN IMAGE_PROPERTIES_RECORD_CODE_SECTION *SecondImageRecordCodeSection)
/* Swap two code sections in a single IMAGE_PROPERTIES_RECORD. */
EFI_STATUS EFIAPI SwapImageRecordCodeSection(IN IMAGE_PROPERTIES_RECORD_CODE_SECTION *FirstImageRecordCodeSection, IN IMAGE_PROPERTIES_RECORD_CODE_SECTION *SecondImageRecordCodeSection)
{
  IMAGE_PROPERTIES_RECORD_CODE_SECTION  TempImageRecordCodeSection;
  if ((FirstImageRecordCodeSection == NULL) || (SecondImageRecordCodeSection == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  TempImageRecordCodeSection.CodeSegmentBase = FirstImageRecordCodeSection->CodeSegmentBase;
  TempImageRecordCodeSection.CodeSegmentSize = FirstImageRecordCodeSection->CodeSegmentSize;
  FirstImageRecordCodeSection->CodeSegmentBase = SecondImageRecordCodeSection->CodeSegmentBase;
  FirstImageRecordCodeSection->CodeSegmentSize = SecondImageRecordCodeSection->CodeSegmentSize;
  SecondImageRecordCodeSection->CodeSegmentBase = TempImageRecordCodeSection.CodeSegmentBase;
  SecondImageRecordCodeSection->CodeSegmentSize = TempImageRecordCodeSection.CodeSegmentSize;
  return EFI_SUCCESS;
}