Index: device/sensors/data_fetcher_shared_memory_win.cc |
diff --git a/device/sensors/data_fetcher_shared_memory_win.cc b/device/sensors/data_fetcher_shared_memory_win.cc |
index 9405d005a1b6dbc16807de09a28c19b66b80516c..4ec59fa4641c282078ea4402ce735d4afe0a165a 100644 |
--- a/device/sensors/data_fetcher_shared_memory_win.cc |
+++ b/device/sensors/data_fetcher_shared_memory_win.cc |
@@ -317,7 +317,8 @@ bool DataFetcherSharedMemory::RegisterForSensor( |
return false; |
base::win::ScopedComPtr<ISensorManager> sensor_manager; |
- HRESULT hr = sensor_manager.CreateInstance(CLSID_SensorManager); |
+ HRESULT hr = ::CoCreateInstance(CLSID_SensorManager, nullptr, CLSCTX_ALL, |
+ IID_PPV_ARGS(&sensor_manager)); |
if (FAILED(hr) || !sensor_manager.Get()) |
return false; |
@@ -338,7 +339,8 @@ bool DataFetcherSharedMemory::RegisterForSensor( |
return false; |
base::win::ScopedComPtr<IPortableDeviceValues> device_values; |
- if (SUCCEEDED(device_values.CreateInstance(CLSID_PortableDeviceValues))) { |
+ if (SUCCEEDED(::CoCreateInstance(CLSID_PortableDeviceValues, nullptr, |
+ CLSCTX_ALL, IID_PPV_ARGS(&device_values)))) { |
if (SUCCEEDED(device_values->SetUnsignedIntegerValue( |
SENSOR_PROPERTY_CURRENT_REPORT_INTERVAL, |
GetInterval().InMilliseconds()))) { |