public void Close(RegistryKey rkey) { if (!Win32RegistryApi.IsHandleValid(rkey)) { return; } IntPtr handle = Win32RegistryApi.GetHandle(rkey); Win32RegistryApi.RegCloseKey(handle); }