Bluetooth OnGetGattEventWin call back function has wrong calling convention |
||
Issue descriptionPrior to the Windows 10.0.14393 SDK the PFNBLUETOOTH_GATT_EVENT_CALLBACK typedef was incorrect which led to code that defined these callback functions to omit the CALLBACK calling convention modifier. This can lead to stack misalignment, and it also makes Chrome not compile with the Windows 10.0.14393 SDK. This article discusses the potential consequences of this bug: http://www.busydevelopers.com/article/43503478/Program+crashed+after+recived+Bluetooth+LE+Notification
,
Sep 6 2016
It looks like that was a different bluetooth declaration bug - mismatched pragma warning push/pop directives. I'm seeing a theme here - maybe the bluetooth at Microsoft team needs better testing?
,
Sep 6 2016
I was looking at the original here https://codereview.chromium.org/395633003/diff/40001/device/bluetooth/bluetooth_low_energy_defs_win.h which we used to avoid the header. But yes, the quality control on that header seems questionable anyway.
,
Sep 13 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2181e0ecc3172fc2a5f4eee62a125f784f5993f5 commit 2181e0ecc3172fc2a5f4eee62a125f784f5993f5 Author: brucedawson <brucedawson@chromium.org> Date: Tue Sep 13 01:53:39 2016 Fix bluetooth callback function declaration The PFNBLUETOOTH_GATT_EVENT_CALLBACK typedef has been incorrect for years and was fixed in the Windows 10.0.14393 SDK. This leads to compile errors when building with this SDK. The incorrect function declaration is missing CALLBACK which can lead to stack mismatches so fixing the code to use the new declaration is important. A fixed typedef needs to be used throughout Chromium to ensure consistent stack cleanup. A cast is needed when calling into Windows (so that Chrome will continue to build with the Windows 10.0.10586 SDK) and that is the only time that the SDK supplied typedef should be used. BUG= 644321 Review-Url: https://codereview.chromium.org/2317773002 Cr-Commit-Position: refs/heads/master@{#418138} [modify] https://crrev.com/2181e0ecc3172fc2a5f4eee62a125f784f5993f5/device/bluetooth/bluetooth_low_energy_win.cc [modify] https://crrev.com/2181e0ecc3172fc2a5f4eee62a125f784f5993f5/device/bluetooth/bluetooth_low_energy_win.h [modify] https://crrev.com/2181e0ecc3172fc2a5f4eee62a125f784f5993f5/device/bluetooth/bluetooth_low_energy_win_fake.cc [modify] https://crrev.com/2181e0ecc3172fc2a5f4eee62a125f784f5993f5/device/bluetooth/bluetooth_low_energy_win_fake.h [modify] https://crrev.com/2181e0ecc3172fc2a5f4eee62a125f784f5993f5/device/bluetooth/bluetooth_task_manager_win.cc
,
Sep 13 2016
Our callback is now correct, and we now build with either 10.0.10586 or 10.0.14393 SDKs. |
||
►
Sign in to add a comment |
||
Comment 1 by scottmg@chromium.org
, Sep 6 2016