In those circumstances, if you’re the driver and you don't stop another adult smoking, both of you will be committing an offence. You can both be issued with a warning or a £50 fixed penalty notice by police and enforcement agencies.
They can even refer the offence to a court.
Opening the sunroof or windows in a private vehicle with a wholly or partly enclosed roof won't protect you from this law, but a convertible with the roof down will be exempt – until you raise the roof at least.