I'll take a shot at answering this question. Necchi will, I'm sure, add his take on WD-40.
I do not rely on WD-40 to protect my guns in any manner except in removing the last traces of moisture from the bore after cleaniing with soapy water. WD-40 is a Water Displacer, hence the WD in the name. It does have some lubricating and rust preventing qualities but there are so many products taht are waaaay better at rust and corrosion protection and lubrication. After wiping the bore with several dry patches after washing with soapy water and rinsihg with clear water, I use WD-40 to remove the last traces of moisture. But, after spraying the WD-40 down my bore, I wipe with several dry patches to completely remove the WD-40 and once it has been wiped out, I use a patch with Barricaed on it to wipe my bore and all the metal surfaces with an oil that is designed to protect metal from rust and corrosion. I have also found a product called Frog Lube to provide excellent rust and corrosion protection but it is a good bit more expensive than Barricade. Barricaed is an excellent product and, for the money, I find it hard to beat. But, it, like any othe rust inhibiting product, must be thoroughly wiped out of the bore before loading and shooting your gun.