Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Side by Side Diff: net/dns/dns_config_service_win.cc

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698