It may technically require the same salary, but the
actual implementation and enforcement renders these requirements meaningless. I've been in situations where I directly observed it happening.
Requirement to advertise for US workers first? No Problem, just advertise where nobody looks, like the physical local newspaper's classifieds. Advertise for a different lower-paid job title, even though the coding duties will be exactly the same. Hire via an outsourcing company whose entire operation is to game the system, and the costs are still less than a US programmer.
The worst part is the sponsorship structure -- when you hire an H1-B worker, you are "sponsoring" his or her presence in the US. they have only the right to work at your business, and nowhere else. They lose that job, and they will have to leave within days (60?). They would not only have to find a new job in that time, but a new job willing to sponsor them and capable of getting their H1-B approved in that time -- very unlikely. This means that the H1-Bs will take all kinds of abuse and lower pay without complaining, as complaining is the quick ticket home.
The simple change of allowing H1Bs to be a 2-year visa, and they are allowed to change to any job after 6 months would go a long way to clearing out the abuses, since the sponsoring company would need to treat them at their full worth to keep them.