OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/importer/ie_importer.h" | 5 #include "chrome/browser/importer/ie_importer.h" |
6 | 6 |
7 #include <ole2.h> | 7 #include <ole2.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <pstore.h> | 9 #include <pstore.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 254 } |
255 | 255 |
256 const wchar_t kStorage2Path[] = | 256 const wchar_t kStorage2Path[] = |
257 L"Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2"; | 257 L"Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2"; |
258 | 258 |
259 RegKey key(HKEY_CURRENT_USER, kStorage2Path, KEY_READ); | 259 RegKey key(HKEY_CURRENT_USER, kStorage2Path, KEY_READ); |
260 RegistryValueIterator reg_iterator(HKEY_CURRENT_USER, kStorage2Path); | 260 RegistryValueIterator reg_iterator(HKEY_CURRENT_USER, kStorage2Path); |
261 while (reg_iterator.Valid() && !cancelled()) { | 261 while (reg_iterator.Valid() && !cancelled()) { |
262 // Get the size of the encrypted data. | 262 // Get the size of the encrypted data. |
263 DWORD value_len = 0; | 263 DWORD value_len = 0; |
264 if (key.ReadValue(reg_iterator.Name(), NULL, &value_len) && value_len) { | 264 if (key.ReadValue(reg_iterator.Name(), NULL, &value_len, NULL) && |
| 265 value_len) { |
265 // Query the encrypted data. | 266 // Query the encrypted data. |
266 std::vector<unsigned char> value; | 267 std::vector<unsigned char> value; |
267 value.resize(value_len); | 268 value.resize(value_len); |
268 if (key.ReadValue(reg_iterator.Name(), &value.front(), &value_len)) { | 269 if (key.ReadValue(reg_iterator.Name(), &value.front(), &value_len, |
| 270 NULL)) { |
269 IE7PasswordInfo password_info; | 271 IE7PasswordInfo password_info; |
270 password_info.url_hash = reg_iterator.Name(); | 272 password_info.url_hash = reg_iterator.Name(); |
271 password_info.encrypted_data = value; | 273 password_info.encrypted_data = value; |
272 password_info.date_created = Time::Now(); | 274 password_info.date_created = Time::Now(); |
273 | 275 |
274 bridge_->AddIE7PasswordInfo(password_info); | 276 bridge_->AddIE7PasswordInfo(password_info); |
275 } | 277 } |
276 } | 278 } |
277 | 279 |
278 ++reg_iterator; | 280 ++reg_iterator; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 if (version < 0) { | 575 if (version < 0) { |
574 wchar_t buffer[128]; | 576 wchar_t buffer[128]; |
575 DWORD buffer_length = sizeof(buffer); | 577 DWORD buffer_length = sizeof(buffer); |
576 RegKey reg_key(HKEY_LOCAL_MACHINE, | 578 RegKey reg_key(HKEY_LOCAL_MACHINE, |
577 L"Software\\Microsoft\\Internet Explorer", KEY_READ); | 579 L"Software\\Microsoft\\Internet Explorer", KEY_READ); |
578 bool result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 580 bool result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
579 version = (result ? _wtoi(buffer) : 0); | 581 version = (result ? _wtoi(buffer) : 0); |
580 } | 582 } |
581 return version; | 583 return version; |
582 } | 584 } |
OLD | NEW |