From: Vibhav Pant vibhavp@gmail.com
--- .../bluetoothdevice.c | 46 ++++++++++++++++++- dlls/windows.devices.bluetooth/main.c | 3 +- .../tests/bluetooth.c | 4 +- 3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.devices.bluetooth/bluetoothdevice.c b/dlls/windows.devices.bluetooth/bluetoothdevice.c index 6eff705c352..e0b32575d19 100644 --- a/dlls/windows.devices.bluetooth/bluetoothdevice.c +++ b/dlls/windows.devices.bluetooth/bluetoothdevice.c @@ -1,4 +1,4 @@ -/* BluetoothDevice Implementation +/* BluetoothDevice, BluetoothLEDevice Implementation * * Copyright 2025 Vibhav Pant * @@ -26,6 +26,7 @@ struct bluetoothdevice_statics { IActivationFactory IActivationFactory_iface; IBluetoothDeviceStatics IBluetoothDeviceStatics_iface; + IBluetoothLEDeviceStatics IBluetoothLEDeviceStatics_iface; LONG ref; };
@@ -53,6 +54,11 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID IBluetoothDeviceStatics_AddRef(( *out = &impl->IBluetoothDeviceStatics_iface )); return S_OK; } + if (IsEqualGUID( iid, &IID_IBluetoothLEDeviceStatics )) + { + IBluetoothLEDeviceStatics_AddRef(( *out = &impl->IBluetoothLEDeviceStatics_iface )); + return S_OK; + } *out = NULL; FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); return E_NOINTERFACE; @@ -155,10 +161,48 @@ static const IBluetoothDeviceStaticsVtbl bluetoothdevice_statics_vtbl = bluetoothdevice_statics_GetDeviceSelector, };
+DEFINE_IINSPECTABLE( bluetoothledevice_statics, IBluetoothLEDeviceStatics, struct bluetoothdevice_statics, IActivationFactory_iface ); + +static HRESULT WINAPI bluetoothledevice_statics_FromIdAsync( IBluetoothLEDeviceStatics *iface, HSTRING id, IAsyncOperation_BluetoothLEDevice **async_op ) +{ + FIXME( "(%p, %s, %p): stub!\n", iface, debugstr_hstring( id ), async_op ); + return E_NOTIMPL; +} + +static HRESULT WINAPI bluetoothledevice_statics_FromBluetoothAddressAsync( IBluetoothLEDeviceStatics *iface, UINT64 addr, IAsyncOperation_BluetoothLEDevice **async_op ) +{ + FIXME( "(%p, %#I64x, %p): stub!\n", iface, addr, async_op ); + return E_NOTIMPL; +} + +static HRESULT WINAPI bluetoothledevice_statics_GetDeviceSelector( IBluetoothLEDeviceStatics *iface, HSTRING *result ) +{ + FIXME( "(%p, %p): stub!\n", iface, result ); + return E_NOTIMPL; +} + +static const IBluetoothLEDeviceStaticsVtbl bluetoothledevice_statics_vtbl = +{ + /* IUnknown */ + bluetoothledevice_statics_QueryInterface, + bluetoothledevice_statics_AddRef, + bluetoothledevice_statics_Release, + /* IInspectable */ + bluetoothledevice_statics_GetIids, + bluetoothledevice_statics_GetRuntimeClassName, + bluetoothledevice_statics_GetTrustLevel, + /* IBluetoothLEDeviceStatics */ + bluetoothledevice_statics_FromIdAsync, + bluetoothledevice_statics_FromBluetoothAddressAsync, + bluetoothledevice_statics_GetDeviceSelector +}; + + static struct bluetoothdevice_statics bluetoothdevice_statics = { {&factory_vtbl}, {&bluetoothdevice_statics_vtbl}, + {&bluetoothledevice_statics_vtbl}, 1 };
diff --git a/dlls/windows.devices.bluetooth/main.c b/dlls/windows.devices.bluetooth/main.c index b94599103a8..1d89f77eb97 100644 --- a/dlls/windows.devices.bluetooth/main.c +++ b/dlls/windows.devices.bluetooth/main.c @@ -40,7 +40,8 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa
if (!wcscmp( buffer, RuntimeClass_Windows_Devices_Bluetooth_BluetoothAdapter )) IActivationFactory_QueryInterface( bluetoothadapter_factory, &IID_IActivationFactory, (void **)factory ); - if (!wcscmp( buffer, RuntimeClass_Windows_Devices_Bluetooth_BluetoothDevice )) + if (!wcscmp( buffer, RuntimeClass_Windows_Devices_Bluetooth_BluetoothDevice ) + || !wcscmp( buffer, RuntimeClass_Windows_Devices_Bluetooth_BluetoothLEDevice )) IActivationFactory_QueryInterface( bluetoothdevice_statics_factory, &IID_IActivationFactory, (void **)factory );
if (*factory) return S_OK; diff --git a/dlls/windows.devices.bluetooth/tests/bluetooth.c b/dlls/windows.devices.bluetooth/tests/bluetooth.c index 03e6dbda30a..f8c75250271 100644 --- a/dlls/windows.devices.bluetooth/tests/bluetooth.c +++ b/dlls/windows.devices.bluetooth/tests/bluetooth.c @@ -302,10 +302,10 @@ static void test_BluetoothLEDeviceStatics( void ) WindowsCreateString( class_name, wcslen( class_name ), &str ); hr = RoGetActivationFactory( str, &IID_IActivationFactory, (void *)&factory ); WindowsDeleteString( str ); - todo_wine ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); + ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); if (hr == REGDB_E_CLASSNOTREG) { - todo_wine win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( class_name ) ); + win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( class_name ) ); return; } check_interface( factory, &IID_IUnknown );