At least three dozen Virginia residents have been prohibited temporarily or permanently from having firearms or purchasing them based on a new state law letting courts decide they would be a danger to themselves or others.