RegSetKeySecurity(key, security_info, sd)
Sets the security on the specified registry key.
CommentsIf key is one of the predefined keys, the predefined key should be closed with win32api::RegCloseKey. That ensures that the new security information is in effect the next time the predefined key is referenced.
Win32 API References