RegConnectRegistry() private method

private RegConnectRegistry ( string machineName, IntPtr hKey, IntPtr &keyHandle ) : int
machineName string
hKey System.IntPtr
keyHandle System.IntPtr
return int
        public RegistryKey OpenRemoteBaseKey(RegistryHive hKey, string machineName)
        {
            IntPtr hKey2 = new IntPtr((int)hKey);
            IntPtr keyHandle;
            int    num = Win32RegistryApi.RegConnectRegistry(machineName, hKey2, out keyHandle);

            if (num != 0)
            {
                this.GenerateException(num);
            }
            return(new RegistryKey(hKey, keyHandle, true));
        }