| Index: device/bluetooth/bluetooth_low_energy_win.cc
|
| diff --git a/device/bluetooth/bluetooth_low_energy_win.cc b/device/bluetooth/bluetooth_low_energy_win.cc
|
| index 77cfc225312f13a6495d468122675bdad817ff60..29abbad9eef86626b24e792fdd7cacd6d2078dbb 100644
|
| --- a/device/bluetooth/bluetooth_low_energy_win.cc
|
| +++ b/device/bluetooth/bluetooth_low_energy_win.cc
|
| @@ -836,15 +836,20 @@ HRESULT BluetoothLowEnergyWrapper::RegisterGattEvents(
|
| base::FilePath& service_path,
|
| BTH_LE_GATT_EVENT_TYPE event_type,
|
| PVOID event_parameter,
|
| - PFNBLUETOOTH_GATT_EVENT_CALLBACK callback,
|
| + PFNBLUETOOTH_GATT_EVENT_CALLBACK_CORRECTED callback,
|
| PVOID context,
|
| BLUETOOTH_GATT_EVENT_HANDLE* out_handle) {
|
| base::File file(service_path, base::File::FLAG_OPEN | base::File::FLAG_READ);
|
| if (!file.IsValid())
|
| return HRESULT_FROM_WIN32(ERROR_OPEN_FAILED);
|
| - return BluetoothGATTRegisterEvent(file.GetPlatformFile(), event_type,
|
| - event_parameter, callback, context,
|
| - out_handle, BLUETOOTH_GATT_FLAG_NONE);
|
| + // Cast to the official callback type for compatibility with the Windows
|
| + // 10.0.10586 definition, even though it is incorrect. This cast can be
|
| + // removed when we mandate building Chromium with the 10.0.14393 SDK or
|
| + // higher.
|
| + return BluetoothGATTRegisterEvent(
|
| + file.GetPlatformFile(), event_type, event_parameter,
|
| + reinterpret_cast<PFNBLUETOOTH_GATT_EVENT_CALLBACK>(callback), context,
|
| + out_handle, BLUETOOTH_GATT_FLAG_NONE);
|
| }
|
|
|
| HRESULT BluetoothLowEnergyWrapper::UnregisterGattEvent(
|
|
|