We have reconsidered the problem of spin injection across ferromagnet/nonmagnetic-semiconductor (FM/NMS) and dilute-magnetic-semiconductor/nonmagnetic-semiconductor (DMS/NMS) interfaces, for structures with finite width d of the magnetic layer (FM or DMS). By using appropriate physical boundary conditions, we find expressions for the resistances of these structures which are in general different from previous results in the literature. When the magnetoresistance of the contacts is negligible, we find that the spin-accumulation effect alone cannot account for the d dependence observed in recent magnetoresistance data. In a limited parameter range, our formulas predict a strong d dependence arising from the magnetic contacts in systems where their magnetoresistances are sizable.