Index: device/generic_sensor/platform_sensor_reader_win.cc |
diff --git a/device/generic_sensor/platform_sensor_reader_win.cc b/device/generic_sensor/platform_sensor_reader_win.cc |
index 89d7819053d3e1342522ff8cd0a0a10c5ac4d828..2a0f3761ad16722463fd5da95b9277f93206d32a 100644 |
--- a/device/generic_sensor/platform_sensor_reader_win.cc |
+++ b/device/generic_sensor/platform_sensor_reader_win.cc |
@@ -5,6 +5,7 @@ |
#include "device/generic_sensor/platform_sensor_reader_win.h" |
#include <Sensors.h> |
+#include <objbase.h> |
#include "base/callback.h" |
#include "base/memory/ptr_util.h" |
@@ -430,7 +431,8 @@ void PlatformSensorReaderWin::ListenSensorEvent() { |
bool PlatformSensorReaderWin::SetReportingInterval( |
const PlatformSensorConfiguration& configuration) { |
base::win::ScopedComPtr<IPortableDeviceValues> props; |
- if (SUCCEEDED(props.CreateInstance(CLSID_PortableDeviceValues))) { |
+ if (SUCCEEDED(::CoCreateInstance(CLSID_PortableDeviceValues, nullptr, |
+ CLSCTX_ALL, IID_PPV_ARGS(&props)))) { |
unsigned interval = |
(1 / configuration.frequency()) * base::Time::kMillisecondsPerSecond; |