public RegistryKey CreateSubKey(RegistryKey rkey, string keyName) { IntPtr handle = Win32RegistryApi.GetHandle(rkey); IntPtr intPtr; int num = Win32RegistryApi.RegCreateKey(handle, keyName, out intPtr); if (num == 1018) { throw RegistryKey.CreateMarkedForDeletionException(); } if (num != 0) { this.GenerateException(num); } return(new RegistryKey(intPtr, Win32RegistryApi.CombineName(rkey, keyName), true)); }