/* Verify the current pointer points to a valid FV header. */
EFI_STATUS VerifyFv(IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader)
/* Verify the current pointer points to a valid FV header. */
EFI_STATUS VerifyFv(IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader)
{
  UINT16  Checksum;
  if (FvHeader == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  if (FvHeader->Signature != EFI_FVH_SIGNATURE) {
    Error (NULL, 0, 0006, "invalid FV header signature", NULL);
    return EFI_VOLUME_CORRUPTED;
  }
  Checksum = CalculateSum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
  if (Checksum != 0) {
    Error (NULL, 0, 0006, "invalid FV header checksum", NULL);
    return EFI_ABORTED;
  }
  return EFI_SUCCESS;
}