From: Vibhav Pant vibhavp@gmail.com
A PropertiesChanged signal only contains the updated properties for the object, so the PE driver should only modify the properties which have their corresponding mask bit set. Additionally, unset the mask bits for invalidated properties. --- dlls/winebth.sys/winebth.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/winebth.sys/winebth.c b/dlls/winebth.sys/winebth.c index 28cc67c123c..39e5a7cd988 100644 --- a/dlls/winebth.sys/winebth.c +++ b/dlls/winebth.sys/winebth.c @@ -399,8 +399,6 @@ static void update_bluetooth_radio_properties( struct winebluetooth_watcher_even { struct bluetooth_radio *device; winebluetooth_radio_t radio = event.radio; - winebluetooth_radio_props_mask_t mask = event.changed_props_mask; - struct winebluetooth_radio_properties props = event.props;
EnterCriticalSection( &device_list_cs ); LIST_FOR_EACH_ENTRY( device, &device_list, struct bluetooth_radio, entry ) @@ -408,8 +406,27 @@ static void update_bluetooth_radio_properties( struct winebluetooth_watcher_even if (winebluetooth_radio_equal( radio, device->radio ) && !device->removed) { EnterCriticalSection( &device->props_cs ); - device->props_mask = mask; - device->props = props; + device->props_mask |= event.changed_props_mask; + device->props_mask &= ~event.invalid_props_mask; + + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_NAME) + memcpy( device->props.name, event.props.name, sizeof( event.props.name )); + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_ADDRESS) + device->props.address.ullLong = RtlUlonglongByteSwap( event.props.address.ullLong ); + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_DISCOVERABLE) + device->props.discoverable = event.props.discoverable; + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_CONNECTABLE) + device->props.connectable = event.props.connectable; + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_CLASS) + device->props.class = event.props.class; + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_MANUFACTURER) + device->props.manufacturer = event.props.manufacturer; + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_VERSION) + device->props.version = event.props.version; + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_DISCOVERING) + device->props.discovering = event.props.discovering; + if (event.changed_props_mask & WINEBLUETOOTH_RADIO_PROPERTY_PAIRABLE) + device->props.pairable = event.props.pairable; bluetooth_radio_set_properties( device->device_obj, device->props_mask, &device->props ); LeaveCriticalSection( &device->props_cs );