Index: device/generic_sensor/platform_sensor_provider_win.cc |
diff --git a/device/generic_sensor/platform_sensor_provider_win.cc b/device/generic_sensor/platform_sensor_provider_win.cc |
index dec5a572c3cb4fd54344f8f3a877b69247fcc636..e8948375a5e4f10f6e5ac83b90fb85e793f6b86f 100644 |
--- a/device/generic_sensor/platform_sensor_provider_win.cc |
+++ b/device/generic_sensor/platform_sensor_provider_win.cc |
@@ -4,6 +4,8 @@ |
#include "device/generic_sensor/platform_sensor_provider_win.h" |
+#include <objbase.h> |
+ |
#include "base/memory/ptr_util.h" |
#include "base/memory/singleton.h" |
#include "base/task_runner_util.h" |
@@ -50,7 +52,8 @@ bool PlatformSensorProviderWin::InitializeSensorManager() { |
if (sensor_manager_) |
return true; |
- HRESULT hr = sensor_manager_.CreateInstance(CLSID_SensorManager); |
+ HRESULT hr = ::CoCreateInstance(CLSID_SensorManager, nullptr, CLSCTX_ALL, |
+ IID_PPV_ARGS(&sensor_manager_)); |
return SUCCEEDED(hr); |
} |