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

Side by Side Diff: base/win/registry.cc

Issue 9601001: Coverity: Fix dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/win/registry.h" 5 #include "base/win/registry.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return result; 217 return result;
218 } 218 }
219 219
220 LONG RegKey::ReadValues(const wchar_t* name, 220 LONG RegKey::ReadValues(const wchar_t* name,
221 std::vector<std::wstring>* values) { 221 std::vector<std::wstring>* values) {
222 base::ThreadRestrictions::AssertIOAllowed(); 222 base::ThreadRestrictions::AssertIOAllowed();
223 values->clear(); 223 values->clear();
224 224
225 DWORD type = REG_MULTI_SZ; 225 DWORD type = REG_MULTI_SZ;
226 DWORD size = 0; 226 DWORD size = 0;
227 LONG result = ReadValue(name, NULL, &size, NULL); 227 LONG result = ReadValue(name, NULL, &size, &type);
228 if (FAILED(result) || size == 0) 228 if (FAILED(result) || size == 0)
229 return result; 229 return result;
230 230
231 if (type != REG_MULTI_SZ) 231 if (type != REG_MULTI_SZ)
232 return ERROR_CANTREAD; 232 return ERROR_CANTREAD;
233 233
234 std::vector<wchar_t> buffer(size / sizeof(wchar_t)); 234 std::vector<wchar_t> buffer(size / sizeof(wchar_t));
235 result = ReadValue(name, &buffer[0], &size, NULL); 235 result = ReadValue(name, &buffer[0], &size, NULL);
236 if (FAILED(result) || size == 0) 236 if (FAILED(result) || size == 0)
237 return result; 237 return result;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (ERROR_SUCCESS == r) 439 if (ERROR_SUCCESS == r)
440 return true; 440 return true;
441 } 441 }
442 442
443 name_[0] = '\0'; 443 name_[0] = '\0';
444 return false; 444 return false;
445 } 445 }
446 446
447 } // namespace win 447 } // namespace win
448 } // namespace base 448 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698