-- v2: winebth.sys: Initially set numOfDevices to 0 in IOCTL_BTH_GET_DEVICE_INFO.
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 );
From: Vibhav Pant vibhavp@gmail.com
--- dlls/winebth.sys/dbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winebth.sys/dbus.c b/dlls/winebth.sys/dbus.c index 13e4bbe29e5..75e72249234 100644 --- a/dlls/winebth.sys/dbus.c +++ b/dlls/winebth.sys/dbus.c @@ -345,12 +345,12 @@ NTSTATUS bluez_adapter_set_prop( void *connection, struct bluetooth_adapter_set_ switch (params->prop_flag) { case LOCAL_RADIO_CONNECTABLE: - prop_name = "Discoverable"; + prop_name = "Connectable"; val.bool_val = params->prop->boolean; val_type = DBUS_TYPE_BOOLEAN; break; case LOCAL_RADIO_DISCOVERABLE: - prop_name = "Connectable"; + prop_name = "Discoverable"; val.bool_val = params->prop->boolean; val_type = DBUS_TYPE_BOOLEAN; break;
From: Vibhav Pant vibhavp@gmail.com
--- dlls/winebth.sys/winebth.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winebth.sys/winebth.c b/dlls/winebth.sys/winebth.c index 39e5a7cd988..15f7e9586f5 100644 --- a/dlls/winebth.sys/winebth.c +++ b/dlls/winebth.sys/winebth.c @@ -168,6 +168,7 @@ static NTSTATUS WINAPI dispatch_bluetooth( DEVICE_OBJECT *device, IRP *irp ) rem_devices = (outsize - sizeof( *list ))/sizeof(BTH_DEVICE_INFO) + 1; status = STATUS_SUCCESS; irp->IoStatus.Information = 0; + list->numOfDevices = 0;
EnterCriticalSection( &ext->remote_devices_cs ); LIST_FOR_EACH_ENTRY( device, &ext->remote_devices, struct bluetooth_remote_device, entry )