| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/dns/dns_config_service_win.h" | 5 #include "net/dns/dns_config_service_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (!policy_reader.ReadDword(L"AppendToMultiLabelName", | 204 if (!policy_reader.ReadDword(L"AppendToMultiLabelName", |
| 205 &settings->append_to_multi_label_name)) { | 205 &settings->append_to_multi_label_name)) { |
| 206 return CONFIG_PARSE_WIN_READ_APPEND_MULTILABEL; | 206 return CONFIG_PARSE_WIN_READ_APPEND_MULTILABEL; |
| 207 } | 207 } |
| 208 | 208 |
| 209 if (!primary_dns_suffix_reader.ReadString(L"PrimaryDnsSuffix", | 209 if (!primary_dns_suffix_reader.ReadString(L"PrimaryDnsSuffix", |
| 210 &settings->primary_dns_suffix)) { | 210 &settings->primary_dns_suffix)) { |
| 211 return CONFIG_PARSE_WIN_READ_PRIMARY_SUFFIX; | 211 return CONFIG_PARSE_WIN_READ_PRIMARY_SUFFIX; |
| 212 } | 212 } |
| 213 | 213 |
| 214 base::win::RegistryKeyIterator nrpt_rules(HKEY_LOCAL_MACHINE, kNRPTPath); | 214 // This registry key is "shared" between 32-bit and 64-bit hive so safe to |
| 215 // access without any WOW64 access flag. See |
| 216 // http://msdn.microsoft.com/en-us/library/windows/desktop/aa384253.aspx. |
| 217 base::win::RegistryKeyIterator nrpt_rules(HKEY_LOCAL_MACHINE, kNRPTPath, 0); |
| 215 settings->have_name_resolution_policy = (nrpt_rules.SubkeyCount() > 0); | 218 settings->have_name_resolution_policy = (nrpt_rules.SubkeyCount() > 0); |
| 216 | 219 |
| 217 return CONFIG_PARSE_WIN_OK; | 220 return CONFIG_PARSE_WIN_OK; |
| 218 } | 221 } |
| 219 | 222 |
| 220 // Default address of "localhost" and local computer name can be overridden | 223 // Default address of "localhost" and local computer name can be overridden |
| 221 // by the HOSTS file, but if it's not there, then we need to fill it in. | 224 // by the HOSTS file, but if it's not there, then we need to fill it in. |
| 222 HostsParseWinResult AddLocalhostEntries(DnsHosts* hosts) { | 225 HostsParseWinResult AddLocalhostEntries(DnsHosts* hosts) { |
| 223 const unsigned char kIPv4Localhost[] = { 127, 0, 0, 1 }; | 226 const unsigned char kIPv4Localhost[] = { 127, 0, 0, 1 }; |
| 224 const unsigned char kIPv6Localhost[] = { 0, 0, 0, 0, 0, 0, 0, 0, | 227 const unsigned char kIPv6Localhost[] = { 0, 0, 0, 0, 0, 0, 0, 0, |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 } | 762 } |
| 760 | 763 |
| 761 } // namespace internal | 764 } // namespace internal |
| 762 | 765 |
| 763 // static | 766 // static |
| 764 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { | 767 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { |
| 765 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin()); | 768 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin()); |
| 766 } | 769 } |
| 767 | 770 |
| 768 } // namespace net | 771 } // namespace net |
| OLD | NEW |