Bailey, if you have your gun in the car when you get a DUI, do you get it confiscated?

Also, let's say that you are caught carrying without a permit, but not otherwise commiting any other crimes. The police department takes your gun, but what right do they have to keep it, and can you get it back?