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

Side by Side Diff: chrome/installer/util/wmi.cc

Issue 609593004: Add an explicit bool conversion to scoped_refptr<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix WMI? 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
« no previous file with comments | « base/memory/ref_counted_unittest.cc ('k') | 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) 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/installer/util/wmi.h" 5 #include "chrome/installer/util/wmi.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/win/scoped_bstr.h" 10 #include "base/win/scoped_bstr.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 hr = wmi_services->GetObject(b_class_name, 0, NULL, 62 hr = wmi_services->GetObject(b_class_name, 0, NULL,
63 class_object.Receive(), NULL); 63 class_object.Receive(), NULL);
64 if (FAILED(hr)) 64 if (FAILED(hr))
65 return false; 65 return false;
66 66
67 base::win::ScopedComPtr<IWbemClassObject> params_def; 67 base::win::ScopedComPtr<IWbemClassObject> params_def;
68 hr = class_object->GetMethod(b_method_name, 0, params_def.Receive(), NULL); 68 hr = class_object->GetMethod(b_method_name, 0, params_def.Receive(), NULL);
69 if (FAILED(hr)) 69 if (FAILED(hr))
70 return false; 70 return false;
71 71
72 if (NULL == params_def) { 72 if (!params_def) {
73 // You hit this special case if the WMI class is not a CIM class. MSDN 73 // You hit this special case if the WMI class is not a CIM class. MSDN
74 // sometimes tells you this. Welcome to WMI hell. 74 // sometimes tells you this. Welcome to WMI hell.
75 return false; 75 return false;
76 } 76 }
77 77
78 hr = params_def->SpawnInstance(0, class_instance); 78 hr = params_def->SpawnInstance(0, class_instance);
79 return(SUCCEEDED(hr)); 79 return(SUCCEEDED(hr));
80 } 80 }
81 81
82 bool SetParameter(IWbemClassObject* class_method, 82 bool SetParameter(IWbemClassObject* class_method,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (model.type() == VT_BSTR) 168 if (model.type() == VT_BSTR)
169 model_string += L" "; 169 model_string += L" ";
170 } 170 }
171 if (model.type() == VT_BSTR) 171 if (model.type() == VT_BSTR)
172 model_string += V_BSTR(&model); 172 model_string += V_BSTR(&model);
173 173
174 return model_string; 174 return model_string;
175 } 175 }
176 176
177 } // namespace installer 177 } // namespace installer
OLDNEW
« no previous file with comments | « base/memory/ref_counted_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698