storage miniport settings erasure problem

A virtual storport miniport needs to store some adapter specific and disk specific data. The idea is to store this in the corresponding instance path of the registry. This works, however the problem is when the miniport is uninstalled and re-installed, all of these settings are erased.

What I see happening for the controller (Enum/ROOT/SCSIADAPTER/0000) is windows deletes the instance id key, thus completely erasing the settings and then recreates the same key again. And for the attached disks (Enum/SCSI/Disk&Ven…/1&…) windows curiously creates brand new, unique instance IDs each time leaving the old ones with settings orphaned behind. Is there a way to solve this erasure issue for the controller or disk drives or is there a better place for storing persistent device specific settings?