From: Vibhav Pant vibhavp@gmail.com
On BlueZ, "Trusted" devices are saved to the local cache, which makes them equivalent to Win32 devices with the BDIF_PERSONAL flag set. --- dlls/winebth.sys/dbus.c | 10 ++++++++++ dlls/winebth.sys/winebth.c | 3 +++ dlls/winebth.sys/winebth_priv.h | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/winebth.sys/dbus.c b/dlls/winebth.sys/dbus.c index 8fa43c79f18..ce5e2e38a6f 100644 --- a/dlls/winebth.sys/dbus.c +++ b/dlls/winebth.sys/dbus.c @@ -566,6 +566,16 @@ static void bluez_device_prop_from_dict_entry( const char *prop_name, DBusMessag props->legacy_pairing = !!legacy; *props_mask |= WINEBLUETOOTH_DEVICE_PROPERTY_LEGACY_PAIRING; } + else if (wanted_props_mask & WINEBLUETOOTH_DEVICE_PROPERTY_TRUSTED && + !strcmp( prop_name, "Trusted" ) && + p_dbus_message_iter_get_arg_type( variant ) == DBUS_TYPE_BOOLEAN) + { + dbus_bool_t trusted; + + p_dbus_message_iter_get_basic( variant, &trusted ); + props->trusted = !!trusted; + *props_mask |= WINEBLUETOOTH_DEVICE_PROPERTY_TRUSTED; + } }
static NTSTATUS bluez_adapter_get_props_async( void *connection, const char *radio_object_path, diff --git a/dlls/winebth.sys/winebth.c b/dlls/winebth.sys/winebth.c index 4b0918b1dd9..108c193fb69 100644 --- a/dlls/winebth.sys/winebth.c +++ b/dlls/winebth.sys/winebth.c @@ -206,6 +206,9 @@ static NTSTATUS WINAPI dispatch_bluetooth( DEVICE_OBJECT *device, IRP *irp ) device->props.paired) info->flags |= BDIF_SSP_PAIRED; } + if (device->props_mask & WINEBLUETOOTH_DEVICE_PROPERTY_TRUSTED && + device->props.trusted) + info->flags |= BDIF_PERSONAL; LeaveCriticalSection( &device->props_cs );
irp->IoStatus.Information += sizeof( *info ); diff --git a/dlls/winebth.sys/winebth_priv.h b/dlls/winebth.sys/winebth_priv.h index 72dcf4bf130..29e16b6bd22 100644 --- a/dlls/winebth.sys/winebth_priv.h +++ b/dlls/winebth.sys/winebth_priv.h @@ -145,11 +145,12 @@ typedef UINT16 winebluetooth_device_props_mask_t; #define WINEBLUETOOTH_DEVICE_PROPERTY_CONNECTED (1 << 2) #define WINEBLUETOOTH_DEVICE_PROPERTY_PAIRED (1 << 3) #define WINEBLUETOOTH_DEVICE_PROPERTY_LEGACY_PAIRING (1 << 4) +#define WINEBLUETOOTH_DEVICE_PROPERTY_TRUSTED (1 << 5)
#define WINEBLUETOOTH_DEVICE_ALL_PROPERTIES \ (WINEBLUETOOTH_DEVICE_PROPERTY_NAME | WINEBLUETOOTH_DEVICE_PROPERTY_ADDRESS | \ WINEBLUETOOTH_DEVICE_PROPERTY_CONNECTED | WINEBLUETOOTH_DEVICE_PROPERTY_PAIRED | \ - WINEBLUETOOTH_DEVICE_PROPERTY_LEGACY_PAIRING) + WINEBLUETOOTH_DEVICE_PROPERTY_LEGACY_PAIRING | WINEBLUETOOTH_DEVICE_PROPERTY_TRUSTED)
union winebluetooth_property { @@ -179,6 +180,7 @@ struct winebluetooth_device_properties BOOL connected; BOOL paired; BOOL legacy_pairing; + BOOL trusted; };
NTSTATUS winebluetooth_radio_get_unique_name( winebluetooth_radio_t radio, char *name,