| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |