Changeset 48955 in vbox for trunk/src/VBox/Main/src-server/win
- Timestamp:
- Oct 7, 2013 9:59:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp
r48805 r48955 14 14 HostDnsServiceWin::HostDnsServiceWin() 15 15 { 16 RegOpenKeyEx(HKEY_LOCAL_MACHINE, 17 TEXT("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"), 18 16 RegOpenKeyEx(HKEY_LOCAL_MACHINE, 17 TEXT("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"), 18 0, KEY_READ, &g_hKeyTcpipParameters); 19 19 } 20 20 … … 24 24 if (!g_hKeyTcpipParameters) 25 25 { 26 26 RegCloseKey(g_hKeyTcpipParameters); 27 27 g_hKeyTcpipParameters = 0; 28 28 } … … 69 69 RT_ZERO(abNameServers); 70 70 RT_ZERO(abSearchList); 71 71 72 72 regIndex = 0; 73 73 do { … … 77 77 BYTE keyData[1024]; 78 78 DWORD cbKeyData = 1024; 79 79 80 80 hrc = RegEnumValueA(g_hKeyTcpipParameters, regIndex, keyName, &cbKeyName, 0, 81 81 &keyType, keyData, &cbKeyData); 82 if ( hrc == ERROR_SUCCESS 82 if ( hrc == ERROR_SUCCESS 83 83 || hrc == ERROR_MORE_DATA) 84 84 { 85 if ( RTStrICmp("Domain", keyName) == 0 85 if ( RTStrICmp("Domain", keyName) == 0 86 86 && cbKeyData > 1 87 87 && cbKeyData < 256) … … 94 94 memcpy(abDomain, keyData, cbKeyData); 95 95 96 else if ( RTStrICmp("NameServer", keyName) == 0 96 else if ( RTStrICmp("NameServer", keyName) == 0 97 97 && cbKeyData > 1 98 98 && cbKeyData < 256) 99 99 memcpy(abNameServers, keyData, cbKeyData); 100 101 else if ( RTStrICmp("DhcpNameServer", keyName) == 0 100 101 else if ( RTStrICmp("DhcpNameServer", keyName) == 0 102 102 && cbKeyData > 1 103 103 && abNameServers[0] == 0 … … 105 105 memcpy(abNameServers, keyData, cbKeyData); 106 106 107 else if ( RTStrICmp("SearchList", keyName) == 0 107 else if ( RTStrICmp("SearchList", keyName) == 0 108 108 && cbKeyData > 1 109 109 && cbKeyData < 256) … … 120 120 /* search list */ 121 121 strList2List(m_llSearchStrings, (char *)abNameServers); 122 122 123 123 return S_OK; 124 124 }
Note:
See TracChangeset
for help on using the changeset viewer.