AdvApi32RegLoadKey(RegistryHive, String, String) Method

Creates a subkey under HKEY_USERS or HKEY_LOCAL_MACHINE and loads the data from the specified registry hive into that subkey.

Applications that back up or restore system state including system files and registry hives should use the Volume Shadow Copy service instead of the registry functions.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("AdvApi32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static Win32ErrorCode RegLoadKey(
	RegistryHive hive,
	string subKey,
	string file
)

Parameters

hive  RegistryHive
The key where the subkey will be created.
subKey  String
The name of the key to be created under hive parameter.

This subkey is where the registration information from the file will be loaded.

Key names are not case sensitive.

file  String
The name of the file containing the registry data.

This file must be a local file that was created with the RegSaveKey function.

If this file does not exist, a file is created with the specified name.

Return Value

Win32ErrorCode
If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is other Win32ErrorCode error code.

To get extended error information, call GetLastWin32Error.

Remarks

See Also