From 629352bdc4683a5059f6d9c735df6930b1ea30c3 Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Tue, 14 Jun 2005 17:22:41 +0000
Subject: [PATCH] Moved network configuration parameters to
 HKCU\Software\Wine\Network.

---
 dlls/iphlpapi/iphlpapi_main.c |  6 ++----
 dlls/kernel/computername.c    | 13 +++++++------
 dlls/netapi32/nbt.c           |  8 +++-----
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index af07c35e1a2..77475555e96 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -619,10 +619,8 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
             IP_ADDRESS_STRING primaryWINS, secondaryWINS;
 
             memset(pAdapterInfo, 0, size);
-            /* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\Network */
-            if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
-             "Software\\Wine\\Wine\\Config\\Network", 0, KEY_READ,
-             &hKey) == ERROR_SUCCESS) {
+            /* @@ Wine registry key: HKCU\Software\Wine\Network */
+            if (RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Network", &hKey) == ERROR_SUCCESS) {
               DWORD size = sizeof(primaryWINS.String);
               unsigned long addr;
 
diff --git a/dlls/kernel/computername.c b/dlls/kernel/computername.c
index abe13f09f3c..ae36d1dc64b 100644
--- a/dlls/kernel/computername.c
+++ b/dlls/kernel/computername.c
@@ -198,23 +198,23 @@ inline static void _init_attr ( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *name )
  */
 static BOOL get_use_dns_option(void)
 {
-    static const WCHAR NetworkW[] = {'M','a','c','h','i','n','e','\\',
-                                  'S','o','f','t','w','a','r','e','\\',
-                                  'W','i','n','e','\\','W','i','n','e','\\',
-                                  'C','o','n','f','i','g','\\','N','e','t','w','o','r','k',0};
+    static const WCHAR NetworkW[] = {'S','o','f','t','w','a','r','e','\\',
+                                     'W','i','n','e','\\','N','e','t','w','o','r','k',0};
     static const WCHAR UseDNSW[] = {'U','s','e','D','n','s','C','o','m','p','u','t','e','r','N','a','m','e',0};
 
     char tmp[80];
-    HKEY hkey;
+    HKEY root, hkey;
     DWORD dummy;
     OBJECT_ATTRIBUTES attr;
     UNICODE_STRING nameW;
     BOOL ret = TRUE;
 
     _init_attr( &attr, &nameW );
+    RtlOpenCurrentUser( KEY_ALL_ACCESS, &root );
+    attr.RootDirectory = root;
     RtlInitUnicodeString( &nameW, NetworkW );
 
-    /* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\Network */
+    /* @@ Wine registry key: HKCU\Software\Wine\Network */
     if (!NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ))
     {
         RtlInitUnicodeString( &nameW, UseDNSW );
@@ -225,6 +225,7 @@ static BOOL get_use_dns_option(void)
         }
         NtClose( hkey );
     }
+    NtClose( root );
     return ret;
 }
 
diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c
index 9cd6296334d..f8872cd1a78 100644
--- a/dlls/netapi32/nbt.c
+++ b/dlls/netapi32/nbt.c
@@ -1435,8 +1435,7 @@ static const WCHAR ScopeIDW[] = { 'S','c','o','p','e','I','D','\0' };
 static const WCHAR CacheTimeoutW[] = { 'C','a','c','h','e','T','i','m','e','o',
  'u','t','\0' };
 static const WCHAR Config_NetworkW[] = { 'S','o','f','t','w','a','r','e','\\',
- 'W','i','n','e','\\','W','i','n','e','\\','C','o','n','f','i','g','\\','N','e',
- 't','w','o','r','k','\0' };
+                                         'W','i','n','e','\\','N','e','t','w','o','r','k','\0' };
 
 /* Initializes global variables and registers the NetBT transport */
 void NetBTInit(void)
@@ -1517,9 +1516,8 @@ void NetBTInit(void)
      * different than MS', we can't do per-adapter WINS configuration in the
      * same place.  Just do a global WINS configuration instead.
      */
-    /* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\Network */
-    if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, Config_NetworkW, 0, KEY_READ, &hKey)
-     == ERROR_SUCCESS)
+    /* @@ Wine registry key: HKCU\Software\Wine\Network */
+    if (RegOpenKeyW(HKEY_CURRENT_USER, Config_NetworkW, &hKey) == ERROR_SUCCESS)
     {
         static const char *nsValueNames[] = { "WinsServer", "BackupWinsServer" };
         char nsString[16];