From: Vibhav Pant vibhavp@gmail.com
--- dlls/winebth.sys/winebth.c | 32 ++++++++++++++++++++++++++++++++ include/wine/winebth.h | 17 ++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/dlls/winebth.sys/winebth.c b/dlls/winebth.sys/winebth.c index 94aa2869b72..591779b13e5 100644 --- a/dlls/winebth.sys/winebth.c +++ b/dlls/winebth.sys/winebth.c @@ -257,6 +257,38 @@ static NTSTATUS WINAPI dispatch_bluetooth( DEVICE_OBJECT *device, IRP *irp ) case IOCTL_WINEBTH_RADIO_STOP_DISCOVERY: status = winebluetooth_radio_stop_discovery( ext->radio ); break; + case IOCTL_WINEBTH_RADIO_GET_LE_INFO: + { + struct winebth_radio_le_info_params *params = irp->AssociatedIrp.SystemBuffer; + + if (!params) + { + status = STATUS_INVALID_PARAMETER; + break; + } + if (outsize < sizeof( *params )) + { + status = STATUS_BUFFER_TOO_SMALL; + break; + } + + memset( params, 0, sizeof( *params ) ); + + EnterCriticalSection( &ext->props_cs ); + if ((params->le_supported = !!(ext->props_mask & WINEBLUETOOTH_RADIO_PROPERTY_LE))) + { + params->role_central = !!(ext->props.le.roles & WINEBLUETOOTH_LE_RADIO_ROLE_CENTRAL); + params->role_peripheral = !!(ext->props.le.roles & WINEBLUETOOTH_LE_RADIO_ROLE_PERIPHERAL); + params->phy_coded = ext->props.le.adv_phy_coded; + params->phy_2M_uncoded = ext->props.le.adv_phy_2M_uncoded; + params->adv_offload = ext->props.le.adv_offload; + params->adv_max_len = ext->props.le.adv_max_len; + } + LeaveCriticalSection( &ext->props_cs ); + irp->IoStatus.Information = sizeof( *params ); + status = STATUS_SUCCESS; + break; + } default: FIXME( "Unimplemented IOCTL code: %#lx\n", code ); break; diff --git a/include/wine/winebth.h b/include/wine/winebth.h index d05e4cad529..71ee1d367de 100644 --- a/include/wine/winebth.h +++ b/include/wine/winebth.h @@ -24,11 +24,13 @@
/* Set the discoverability or connectable flag for a local radio. Enabling discoverability will also enable incoming * connections, while disabling incoming connections disables discoverability as well. */ -#define IOCTL_WINEBTH_RADIO_SET_FLAG CTL_CODE(FILE_DEVICE_BLUETOOTH, 0xa3, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_WINEBTH_RADIO_SET_FLAG CTL_CODE(FILE_DEVICE_BLUETOOTH, 0xa3, METHOD_BUFFERED, FILE_ANY_ACCESS) /* Start device inquiry for a local radio. */ #define IOCTL_WINEBTH_RADIO_START_DISCOVERY CTL_CODE(FILE_DEVICE_BLUETOOTH, 0xa6, METHOD_BUFFERED, FILE_ANY_ACCESS) /* Stop device inquiry for a local radio. */ #define IOCTL_WINEBTH_RADIO_STOP_DISCOVERY CTL_CODE(FILE_DEVICE_BLUETOOTH, 0xa7, METHOD_BUFFERED, FILE_ANY_ACCESS) +/* Get information about the LE capabilities for a local radio. */ +#define IOCTL_WINEBTH_RADIO_GET_LE_INFO CTL_CODE(FILE_DEVICE_BLUETOOTH, 0xa8, METHOD_BUFFERED, FILE_ANY_ACCESS)
#include <pshpack1.h>
@@ -41,6 +43,19 @@ struct winebth_radio_set_flag_params unsigned int enable : 1; };
+struct winebth_radio_le_info_params +{ + unsigned int le_supported : 1; + unsigned int role_central : 1; + unsigned int role_peripheral: 1; + + unsigned int phy_coded : 1; + unsigned int phy_2M_uncoded: 1; + + unsigned int adv_offload: 1; + UINT32 adv_max_len; +}; + #include <poppack.h>
#endif /* __WINEBTH_H__ */