Module: wine Branch: master Commit: 0fb31cfc5d7f0377b63540acf2eb925852238eba URL: https://gitlab.winehq.org/wine/wine/-/commit/0fb31cfc5d7f0377b63540acf2eb925...
Author: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Sun Jul 2 01:56:11 2023 -0400
windows.devices.bluetooth: Implement IBluetoothAdapterStatics::GetDeviceSelector().
Needed for Revo Scan 5.
---
dlls/windows.devices.bluetooth/bluetoothadapter.c | 9 +++++++-- dlls/windows.devices.bluetooth/tests/bluetooth.c | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/dlls/windows.devices.bluetooth/bluetoothadapter.c b/dlls/windows.devices.bluetooth/bluetoothadapter.c index 367cd464e42..bc8e04a9d33 100644 --- a/dlls/windows.devices.bluetooth/bluetoothadapter.c +++ b/dlls/windows.devices.bluetooth/bluetoothadapter.c @@ -119,8 +119,13 @@ DEFINE_IINSPECTABLE( bluetoothadapter_statics, IBluetoothAdapterStatics, struct
static HRESULT WINAPI bluetoothadapter_statics_GetDeviceSelector( IBluetoothAdapterStatics *iface, HSTRING *result ) { - FIXME( "iface %p, result %p stub!\n", iface, result ); - return E_NOTIMPL; + static const WCHAR *default_res = L"System.Devices.InterfaceClassGuid:="{92383B0E-F90E-4AC9-8D44-8C2D0D0EBDA2}" " + L"AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True"; + + TRACE( "iface %p, result %p.\n", iface, result ); + + if (!result) return E_POINTER; + return WindowsCreateString( default_res, wcslen(default_res), result ); }
static HRESULT WINAPI bluetoothadapter_statics_FromIdAsync( IBluetoothAdapterStatics *iface, HSTRING id, IAsyncOperation_BluetoothAdapter **operation ) diff --git a/dlls/windows.devices.bluetooth/tests/bluetooth.c b/dlls/windows.devices.bluetooth/tests/bluetooth.c index 8ee77bcf4ed..dc1b61b6e2f 100644 --- a/dlls/windows.devices.bluetooth/tests/bluetooth.c +++ b/dlls/windows.devices.bluetooth/tests/bluetooth.c @@ -87,14 +87,14 @@ static void test_BluetoothAdapterStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IBluetoothAdapterStatics_GetDeviceSelector( bluetoothadapter_statics, NULL ); - todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); hr = IBluetoothAdapterStatics_GetDeviceSelector( bluetoothadapter_statics, &str ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCreateString( default_res, wcslen(default_res), &default_str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCompareStringOrdinal( str, default_str, &res ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine ok( !res, "got unexpected string %s.\n", debugstr_hstring(str) ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( !res, "got unexpected string %s.\n", debugstr_hstring(str) );
WindowsDeleteString( str ); WindowsDeleteString( default_str );