_RegRemapPreDefKey

include vmm.h

DWORD _RegRemapPreDefKey(HKEY hKey, HKEY hkRootKey)
 

Changes the current predefined hkRootKey to point to the given open key, specified by hKey. This operation is only allowed on HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG. This service is intended for use by the system and is not for general use by drivers.

ERROR_KEY_DELETED
ERROR_BADKEY
ERROR_REGISTRY_IO_FAILED
ERROR_REGISTRY_CORRUPT
ERROR_BADDB

hKey
A previously opened key.
hkRootKey
One of HKEY_CURRENT_USER or HKEY_CURRENT_CONFIG.

This function invalidates all open handles opened through the previous HKEY_CURRENT_USER or HKEY_CURRENT_CONFIG.