AdvApi32RegCloseKey(SafeRegistryHandle) Method

Closes a handle to the specified registry key.

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", SetLastError = true)]
public static Win32ErrorCode RegCloseKey(
	SafeRegistryHandle hKey
)

Parameters

hKey  SafeRegistryHandle
A handle to the open key to be closed.

The handle must have been opened by the RegCreateKeyEx, RegCreateKeyTransacted, RegOpenKeyEx(SafeRegistryHandle, String, UInt32, Int32, IntPtr), RegOpenKeyTransacted, or RegConnectRegistry function.

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