They didn't keep the foreign corporations out. Having them as on-shore competitors is what keeps their own companies from merely seeking rents. Foreign companies also didn't bring their best products in the beginning out of the fear of getting copied, but that strategy is not sustainable over time as Chinese companies get better at making things.