Endomorphism rings of projective modules