/* Check if it's a valid FFS file header. */
BOOLEAN IsValidFfsHeader(IN UINT8 ErasePolarity, IN EFI_FFS_FILE_HEADER *FfsHeader, OUT EFI_FFS_FILE_STATE *FileState)
/* Check if it's a valid FFS file header. */
BOOLEAN IsValidFfsHeader(IN UINT8 ErasePolarity, IN EFI_FFS_FILE_HEADER *FfsHeader, OUT EFI_FFS_FILE_STATE *FileState)
{
  *FileState = GetFileState (ErasePolarity, FfsHeader);
  switch (*FileState) {
    case EFI_FILE_HEADER_VALID:
    case EFI_FILE_DATA_VALID:
    case EFI_FILE_MARKED_FOR_UPDATE:
    case EFI_FILE_DELETED:
      return VerifyHeaderChecksum (FfsHeader);
    case EFI_FILE_HEADER_CONSTRUCTION:
    case EFI_FILE_HEADER_INVALID:
    default:
      return FALSE;
  }
}