Fired at the muzzle, a representative .40 S&W load (11.7 g, FMJ, 300 m/s) reaches roughly 116 mm (4.6 inches) into pine wood. That is enough to defeat a typical barrier of this material — treat anything behind it as exposed.
Construction pine — a 2x4 stud is ~38 mm thick.