Yes,,, some barres your index finger will actually only hold down a couple strings and sort of mute the others just automatically by the shape your hand takes.
But generally barre all the strings and if you lifted up the other fingers the notes being barred would sound out.
You are doing it correctly... The only difference would be if you used a mini-barre then of course you are only catching a couple or maybe three strings.
Barring is pretty much automatic.