As for the D40 you are stuck with what you have i believe, so doesn't matter.
Free-wheeling hubs allow the wheels to spin freely. This means your CV's, front diff, and front driveshaft are not spinning if the hubs are unlocked. If you then either engage 4wd with the hubs unlocked, or leave it in 2wd but lock the hubs, it means all of that will spin, but as the whole "circuit" is not connected you still wont have drive. If the hubs are locked and you engage 4wd then it is complete and you get drive to front wheels.
you will know how to lock them if you ever see them. Ever seen a D22 or a patrol or an old rodeo that in the middle of the front wheel has what looks like a dial with lock and unlock, well you can turn it to lock and also unlock the hubs.