diff options
-rw-r--r-- | base/registry.cc | 5 | ||||
-rw-r--r-- | base/registry.h | 4 | ||||
-rw-r--r-- | base/win_util.cc | 5 | ||||
-rw-r--r-- | chrome/app/breakpad_win.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_rlz_apitest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils_win.cc | 6 | ||||
-rw-r--r-- | chrome/browser/importer/ie_importer.cc | 5 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_provider_win.cc | 8 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_provider_win_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/shell_dialogs_win.cc | 2 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 2 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_distribution.cc | 2 | ||||
-rw-r--r-- | chrome/installer/util/install_util.cc | 4 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.cc | 16 | ||||
-rw-r--r-- | chrome/test/mini_installer_test/chrome_mini_installer.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.cc | 4 | ||||
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.cc | 4 | ||||
-rw-r--r-- | net/base/platform_mime_util_win.cc | 10 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list_win.cc | 6 |
19 files changed, 55 insertions, 43 deletions
diff --git a/base/registry.cc b/base/registry.cc index 0040e1a..f8e58b9 100644 --- a/base/registry.cc +++ b/base/registry.cc @@ -132,6 +132,11 @@ DWORD RegistryKeyIterator::SubkeyCount() const { return count; } +RegKey::RegKey() + : key_(NULL), + watch_event_(0) { +} + RegKey::RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access) : key_(NULL), watch_event_(0) { diff --git a/base/registry.h b/base/registry.h index 4702a78..b9427ea 100644 --- a/base/registry.h +++ b/base/registry.h @@ -20,8 +20,8 @@ // are "values", which are <name, data> pairs, with an associated data type. class RegKey { public: - RegKey(HKEY rootkey = NULL, const wchar_t* subkey = NULL, - REGSAM access = KEY_READ); + RegKey(); + RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access); ~RegKey(); bool Create(HKEY rootkey, const wchar_t* subkey, REGSAM access = KEY_READ); diff --git a/base/win_util.cc b/base/win_util.cc index 12cf241..49a20c8 100644 --- a/base/win_util.cc +++ b/base/win_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -350,7 +350,8 @@ std::wstring GetClassName(HWND window) { bool UserAccountControlIsEnabled() { RegKey key(HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"); + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", + KEY_READ); DWORD uac_enabled; if (!key.ReadValueDW(L"EnableLUA", &uac_enabled)) return true; diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 183887d..bf94f6e 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -397,13 +397,13 @@ bool ShowRestartDialogIfCrashed(bool* exit_now) { static bool MetricsReportingControlledByPolicy(bool* result) { std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); DWORD value; - RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey); + RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_READ); if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) { *result = value != 0; return true; } - RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey); + RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_READ); if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) { *result = value != 0; return true; diff --git a/chrome/browser/extensions/extension_rlz_apitest.cc b/chrome/browser/extensions/extension_rlz_apitest.cc index 3d0ea9e..910a530 100644 --- a/chrome/browser/extensions/extension_rlz_apitest.cc +++ b/chrome/browser/extensions/extension_rlz_apitest.cc @@ -51,7 +51,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Rlz) { rlz_lib::ClearProductState(rlz_lib::DESKTOP, access_points); // Check that the state has really been cleared. - RegKey key(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\N"); + RegKey key(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\N", + KEY_READ); ASSERT_FALSE(key.Valid()); // Mock out experimental.rlz.sendFinancialPing(). diff --git a/chrome/browser/importer/firefox_importer_utils_win.cc b/chrome/browser/importer/firefox_importer_utils_win.cc index 6887067..3200eb1 100644 --- a/chrome/browser/importer/firefox_importer_utils_win.cc +++ b/chrome/browser/importer/firefox_importer_utils_win.cc @@ -29,7 +29,7 @@ int GetCurrentFirefoxMajorVersionFromRegistry() { // HKCU\Mozilla. for (int i = 0; i < arraysize(kFireFoxRegistryPaths); ++i) { RegKey reg_key(kFireFoxRegistryPaths[i], - L"Software\\Mozilla\\Mozilla Firefox"); + L"Software\\Mozilla\\Mozilla Firefox", KEY_READ); bool result = reg_key.ReadValue(L"CurrentVersion", ver_buffer, &ver_buffer_length, NULL); @@ -45,14 +45,14 @@ std::wstring GetFirefoxInstallPathFromRegistry() { std::wstring registry_path = L"Software\\Mozilla\\Mozilla Firefox"; wchar_t buffer[MAX_PATH]; DWORD buffer_length = sizeof(buffer); - RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str()); + RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str(), KEY_READ); bool result = reg_key.ReadValue(L"CurrentVersion", buffer, &buffer_length, NULL); if (!result) return std::wstring(); registry_path += L"\\" + std::wstring(buffer) + L"\\Main"; buffer_length = sizeof(buffer); - RegKey reg_key_directory(HKEY_LOCAL_MACHINE, registry_path.c_str()); + RegKey reg_key_directory(HKEY_LOCAL_MACHINE, registry_path.c_str(), KEY_READ); result = reg_key_directory.ReadValue(L"Install Directory", buffer, &buffer_length, NULL); if (!result) diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index 21b36d1..ab0a61c 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -462,7 +462,8 @@ bool IEImporter::GetFavoritesInfo(IEImporter::FavoritesInfo *info) { // The Link folder name is stored in the registry. DWORD buffer_length = sizeof(buffer); RegKey reg_key(HKEY_CURRENT_USER, - L"Software\\Microsoft\\Internet Explorer\\Toolbar"); + L"Software\\Microsoft\\Internet Explorer\\Toolbar", + KEY_READ); if (!reg_key.ReadValue(L"LinksFolderName", buffer, &buffer_length, NULL)) return false; info->links_folder = buffer; @@ -571,7 +572,7 @@ int IEImporter::CurrentIEVersion() const { wchar_t buffer[128]; DWORD buffer_length = sizeof(buffer); RegKey reg_key(HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Internet Explorer"); + L"Software\\Microsoft\\Internet Explorer", KEY_READ); bool result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); version = (result ? _wtoi(buffer) : 0); } diff --git a/chrome/browser/policy/configuration_policy_provider_win.cc b/chrome/browser/policy/configuration_policy_provider_win.cc index eb6d92f..2e5904e 100644 --- a/chrome/browser/policy/configuration_policy_provider_win.cc +++ b/chrome/browser/policy/configuration_policy_provider_win.cc @@ -110,13 +110,13 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyStringList( bool ConfigurationPolicyProviderWin::GetRegistryPolicyBoolean( const string16& value_name, bool* result) { DWORD value; - RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey); + RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_READ); if (hkcu_policy_key.ReadValueDW(value_name.c_str(), &value)) { *result = value != 0; return true; } - RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey); + RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_READ); if (hklm_policy_key.ReadValueDW(value_name.c_str(), &value)) { *result = value != 0; return true; @@ -127,13 +127,13 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyBoolean( bool ConfigurationPolicyProviderWin::GetRegistryPolicyInteger( const string16& value_name, uint32* result) { DWORD value; - RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey); + RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_READ); if (hkcu_policy_key.ReadValueDW(value_name.c_str(), &value)) { *result = value; return true; } - RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey); + RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_READ); if (hklm_policy_key.ReadValueDW(value_name.c_str(), &value)) { *result = value; return true; diff --git a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc index ed499aa..236ccc6 100644 --- a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc +++ b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc @@ -149,8 +149,10 @@ class ConfigurationPolicyProviderWinTest : public testing::Test { }; ConfigurationPolicyProviderWinTest::ConfigurationPolicyProviderWinTest() - : temp_hklm_hive_key_(HKEY_CURRENT_USER, kUnitTestMachineOverrideSubKey), - temp_hkcu_hive_key_(HKEY_CURRENT_USER, kUnitTestUserOverrideSubKey) { + : temp_hklm_hive_key_(HKEY_CURRENT_USER, kUnitTestMachineOverrideSubKey, + KEY_READ), + temp_hkcu_hive_key_(HKEY_CURRENT_USER, kUnitTestUserOverrideSubKey, + KEY_READ) { } void ConfigurationPolicyProviderWinTest::SetUp() { diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc index fc8b96c..a90b7fb 100644 --- a/chrome/browser/views/shell_dialogs_win.cc +++ b/chrome/browser/views/shell_dialogs_win.cc @@ -48,7 +48,7 @@ std::wstring AppendExtensionIfNeeded(const std::wstring& filename, std::wstring file_extension(file_util::GetFileExtensionFromPath(filename)); std::wstring key(L"." + file_extension); if (!(filter_selected.empty() || filter_selected == L"*.*") && - !RegKey(HKEY_CLASSES_ROOT, key.c_str()).Valid() && + !RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).Valid() && file_extension != suggested_ext) { if (return_value[return_value.length() - 1] != L'.') return_value.append(L"."); diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 2d19ca4..f8c0482 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -72,7 +72,7 @@ bool CurrentUserHasDefaultBrowser(bool system_uninstall) { std::wstring reg_key(ShellUtil::kRegStartMenuInternet); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen); - RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str()); + RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ); std::wstring reg_exe; if (key.ReadValue(L"", ®_exe) && reg_exe.length() > 2) { std::wstring chrome_exe = installer::GetChromeInstallPath(system_uninstall); diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index 8a2069d..adb5b1a 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -412,7 +412,7 @@ std::wstring GoogleChromeDistribution::GetDistributionData(RegKey* key) { sub_key.append(L"\\"); sub_key.append(product_guid()); - RegKey client_state_key(key->Handle(), sub_key.c_str()); + RegKey client_state_key(key->Handle(), sub_key.c_str(), KEY_READ); std::wstring result; std::wstring brand_value; if (client_state_key.ReadValue(google_update::kRegRLZBrandField, diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index a64a7cc..3ace4bf 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -55,7 +55,7 @@ bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe, std::wstring InstallUtil::GetChromeUninstallCmd(bool system_install) { HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - RegKey key(root, dist->GetUninstallRegPath().c_str()); + RegKey key(root, dist->GetUninstallRegPath().c_str(), KEY_READ); std::wstring uninstall_cmd; key.ReadValue(installer_util::kUninstallStringField, &uninstall_cmd); return uninstall_cmd; diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 7d170d0..1655af7 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -191,7 +191,7 @@ class RegistryEntry { // Checks if the current registry entry exists in HKLM registry and the value // is same. bool ExistsInHKLM() const { - RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str()); + RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str(), KEY_READ); bool found = false; if (_is_string) { std::wstring read_value; @@ -211,7 +211,7 @@ class RegistryEntry { // Checks if the current registry entry exists in HKLM registry // (only the name). bool NameExistsInHKLM() const { - RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str()); + RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str(), KEY_READ); bool found = false; if (_is_string) { std::wstring read_value; @@ -303,7 +303,7 @@ bool ElevateAndRegisterChrome(const std::wstring& chrome_exe, BrowserDistribution* dist = BrowserDistribution::GetDistribution(); HKEY reg_root = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; - RegKey key(reg_root, dist->GetUninstallRegPath().c_str()); + RegKey key(reg_root, dist->GetUninstallRegPath().c_str(), KEY_READ); key.ReadValue(installer_util::kUninstallStringField, &exe_path); CommandLine command_line = CommandLine::FromString(exe_path); exe_path = command_line.program(); @@ -349,7 +349,7 @@ bool AnotherUserHasDefaultBrowser(const std::wstring& chrome_exe) { std::wstring reg_key(ShellUtil::kRegStartMenuInternet); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen); - RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str()); + RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ); std::wstring registry_chrome_exe; if (!key.ReadValue(L"", ®istry_chrome_exe) || registry_chrome_exe.length() < 2) @@ -569,15 +569,15 @@ void ShellUtil::GetRegisteredBrowsers(std::map<std::wstring, HKEY root = HKEY_LOCAL_MACHINE; for (RegistryKeyIterator iter(root, base_key.c_str()); iter.Valid(); ++iter) { std::wstring key = base_key + L"\\" + iter.Name(); - RegKey capabilities(root, (key + L"\\Capabilities").c_str()); + RegKey capabilities(root, (key + L"\\Capabilities").c_str(), KEY_READ); std::wstring name; if (!capabilities.Valid() || !capabilities.ReadValue(L"ApplicationName", &name)) { - RegKey base_key(root, key.c_str()); + RegKey base_key(root, key.c_str(), KEY_READ); if (!base_key.ReadValue(L"", &name)) continue; } - RegKey install_info(root, (key + L"\\InstallInfo").c_str()); + RegKey install_info(root, (key + L"\\InstallInfo").c_str(), KEY_READ); std::wstring command; if (!install_info.Valid() || !install_info.ReadValue(L"ReinstallCommand", &command)) @@ -600,7 +600,7 @@ bool ShellUtil::GetUserSpecificDefaultBrowserSuffix(std::wstring* entry) { std::wstring start_menu_entry(ShellUtil::kRegStartMenuInternet); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); start_menu_entry.append(L"\\" + dist->GetApplicationName() + *entry); - RegKey key(HKEY_LOCAL_MACHINE, start_menu_entry.c_str()); + RegKey key(HKEY_LOCAL_MACHINE, start_menu_entry.c_str(), KEY_READ); return key.Valid(); } diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 81e9460..9be3a24 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -506,7 +506,7 @@ std::wstring ChromeMiniInstaller::GetUninstallPath() { bool ChromeMiniInstaller::GetChromeVersionFromRegistry( std::wstring* build_key_value) { BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str()); + RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str(), KEY_READ); if (!key.ReadValue(L"pv", build_key_value)) { printf("registry key not found\n"); return false; diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc index f5b1315..9c43cb2 100644 --- a/chrome_frame/test/chrome_frame_test_utils.cc +++ b/chrome_frame/test/chrome_frame_test_utils.cc @@ -118,7 +118,7 @@ std::wstring GetExecutableAppPath(const std::wstring& file) { L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"; std::wstring app_path; - RegKey key(HKEY_LOCAL_MACHINE, (kAppPathsKey + file).c_str()); + RegKey key(HKEY_LOCAL_MACHINE, (kAppPathsKey + file).c_str(), KEY_READ); if (key.Handle()) { key.ReadValue(NULL, &app_path); } @@ -130,7 +130,7 @@ std::wstring FormatCommandForApp(const std::wstring& exe_name, const std::wstring& argument) { std::wstring reg_path(StringPrintf(L"Applications\\%ls\\shell\\open\\command", exe_name.c_str())); - RegKey key(HKEY_CLASSES_ROOT, reg_path.c_str()); + RegKey key(HKEY_CLASSES_ROOT, reg_path.c_str(), KEY_READ); std::wstring command; if (key.Handle()) { diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc index d53d407..d283b0c 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.cc +++ b/chrome_frame/test/perf/chrome_frame_perftest.cc @@ -1091,7 +1091,7 @@ TEST_F(ChromeFrameCreationTest, PerfCold) { // from the cache. This could also fail if the Flash control is in use. // On Vista this could fail because of UAC TEST_F(FlashCreationTest, PerfCold) { - RegKey flash_key(HKEY_CLASSES_ROOT, kFlashControlKey); + RegKey flash_key(HKEY_CLASSES_ROOT, kFlashControlKey, KEY_READ); std::wstring plugin_path; ASSERT_TRUE(flash_key.ReadValue(L"", &plugin_path)); @@ -1111,7 +1111,7 @@ TEST_F(FlashCreationTest, PerfCold) { // correctly causing the attempt to evict the dll from the system cache to // fail. TEST_F(SilverlightCreationTest, DISABLED_PerfCold) { - RegKey silverlight_key(HKEY_CLASSES_ROOT, kSilverlightControlKey); + RegKey silverlight_key(HKEY_CLASSES_ROOT, kSilverlightControlKey, KEY_READ); std::wstring plugin_path; ASSERT_TRUE(silverlight_key.ReadValue(L"", &plugin_path)); diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc index 26d924b..bffb81a 100644 --- a/net/base/platform_mime_util_win.cc +++ b/net/base/platform_mime_util_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,7 +16,8 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( // check windows registry for file extension's mime type (registry key // names are not case-sensitive). std::wstring value, key = L"." + ext; - RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Content Type", &value); + RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(L"Content Type", + &value); if (!value.empty()) { *result = WideToUTF8(value); return true; @@ -27,9 +28,10 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension( bool PlatformMimeUtil::GetPreferredExtensionForMimeType( const std::string& mime_type, FilePath::StringType* ext) const { std::wstring key(L"MIME\\Database\\Content Type\\" + UTF8ToWide(mime_type)); - if (!RegKey(HKEY_CLASSES_ROOT, key.c_str()).ReadValue(L"Extension", ext)) + if (!RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(L"Extension", + ext)) { return false; - + } // Strip off the leading dot, this should always be the case. if (!ext->empty() && ext->at(0) == L'.') ext->erase(ext->begin()); diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc index 9821928..28a6582 100644 --- a/webkit/glue/plugins/plugin_list_win.cc +++ b/webkit/glue/plugins/plugin_list_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -66,7 +66,7 @@ bool GetInstalledPath(const TCHAR* app, FilePath* out) { reg_path.append(L"\\"); reg_path.append(app); - RegKey key(HKEY_LOCAL_MACHINE, reg_path.c_str()); + RegKey key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ); std::wstring path; if (key.ReadValue(kRegistryPath, &path)) { *out = FilePath(path); @@ -87,7 +87,7 @@ void GetPluginsInRegistryDirectory( std::wstring reg_path = registry_folder; reg_path.append(L"\\"); reg_path.append(iter.Name()); - RegKey key(root_key, reg_path.c_str()); + RegKey key(root_key, reg_path.c_str(), KEY_READ); std::wstring path; if (key.ReadValue(kRegistryPath, &path)) |