def patch_from_records(fhdest, records):
    """
    Apply an list of :class:`IpsRecord` a file. Destructive processes.

    :param fhdest: File handler to-be-patched
    :param fhpatch: File handler of the patch

    :returns: Number of records applied by the patch
    """
    for r in records:
        fhdest.seek(r.offset)
        fhdest.write(r.inflate().data)
    return len(records)
