Yes, the correct way of proceeding is to use the available mixin Msf::Post::Windows::Registry (if there are API's availables awright). If there is any problem by using the mixin, the way to proceed is to fix the mixin :P 

If you're experiencing issues, detecting bugs by using Msf::Post::Windows::Registry, please let us know :) Bugs can be reported through redmine: https://github.com/rapid7/metasploit-framework/wiki/Reporting-a-Bug