You've already gotten good answers about the desiccant, but I'll address the "shooting in space" part of your post.
Yes, firearms would function just fine in space (at least, the combustion part would - some of the moving parts might not work too well in the cold vacuum of space).
Combustion requires oxygen, but both the primer compound and the gunpowder itself contain oxygen-bearing chemicals that release their oxygen to support combustion. Essentially, the rounds "make their own oxygen", allowing them to work even when there's no atmospheric oxygen available.