Testing gives
Failed to create key "StorageDevicePolicies"
, no further error messages..
In my test, this code is before the createkey part:
if (Registry.OpenKey('\CurrentControlSet\Control', true)) then showmessage('First openkey worked.');so OpenKey fails as well. I'd look into the required syntax and paths for openkey first.
Perhaps a forum search here will give some results.