Chromium Code Reviews| Index: device/bluetooth/bluetooth_low_energy_win.h |
| diff --git a/device/bluetooth/bluetooth_low_energy_win.h b/device/bluetooth/bluetooth_low_energy_win.h |
| index edb17e933caa729b14afed0458d59cf649bd9a25..11dbf239e1a05705c571c440f596d43c35e9db32 100644 |
| --- a/device/bluetooth/bluetooth_low_energy_win.h |
| +++ b/device/bluetooth/bluetooth_low_energy_win.h |
| @@ -20,6 +20,19 @@ |
| namespace device { |
| namespace win { |
| +// |
| +// Callback function signature for Bluetooth GATT events. This fixes a bug in |
| +// the prototype in the Windows 10.0.10586 SDK which is missing the CALLBACK |
| +// modifier. This typedef should be used throughout Chromium except when casting |
|
scheib
2016/09/12 19:28:16
Would be nice to include the 'why' you mention in
|
| +// to the 'official' definition when calling Microsoft functions. This allows |
| +// Chromium to build with 10.0.10586 or later SDKs (with the fix) while doing |
| +// the correct thing. |
| +// |
| +typedef VOID(CALLBACK* PFNBLUETOOTH_GATT_EVENT_CALLBACK_CORRECTED)( |
| + _In_ BTH_LE_GATT_EVENT_TYPE EventType, |
| + _In_ PVOID EventOutParameter, |
| + _In_opt_ PVOID Context); |
| + |
| // Represents a device registry property value |
| class DEVICE_BLUETOOTH_EXPORT DeviceRegistryPropertyValue { |
| public: |
| @@ -181,12 +194,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothLowEnergyWrapper { |
| // is the function to be invoked if the event happened. |context| is the input |
| // parameter to be given back through |callback|. |*out_handle| stores the |
| // unique handle in OS for this registration. |
| - virtual HRESULT RegisterGattEvents(base::FilePath& service_path, |
| - BTH_LE_GATT_EVENT_TYPE event_type, |
| - PVOID event_parameter, |
| - PFNBLUETOOTH_GATT_EVENT_CALLBACK callback, |
| - PVOID context, |
| - BLUETOOTH_GATT_EVENT_HANDLE* out_handle); |
| + virtual HRESULT RegisterGattEvents( |
| + base::FilePath& service_path, |
| + BTH_LE_GATT_EVENT_TYPE event_type, |
| + PVOID event_parameter, |
| + PFNBLUETOOTH_GATT_EVENT_CALLBACK_CORRECTED callback, |
| + PVOID context, |
| + BLUETOOTH_GATT_EVENT_HANDLE* out_handle); |
| virtual HRESULT UnregisterGattEvent(BLUETOOTH_GATT_EVENT_HANDLE event_handle); |
| // Writes |descriptor| value in service with service device path |