From: Vibhav Pant vibhavp@gmail.com
--- dlls/bluetoothapis/bluetoothapis.spec | 2 +- dlls/bluetoothapis/main.c | 41 +++++++++++++++++++++++++++ dlls/bthprops.cpl/bthprops.cpl.spec | 2 +- dlls/irprops.cpl/irprops.cpl.spec | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/dlls/bluetoothapis/bluetoothapis.spec b/dlls/bluetoothapis/bluetoothapis.spec index 77a3a931a55..2a2a657fabe 100644 --- a/dlls/bluetoothapis/bluetoothapis.spec +++ b/dlls/bluetoothapis/bluetoothapis.spec @@ -43,7 +43,7 @@ @ stub BluetoothGATTSetCharacteristicValue @ stub BluetoothGATTSetDescriptorValue @ stub BluetoothGATTUnregisterEvent -@ stub BluetoothGetDeviceInfo +@ stdcall BluetoothGetDeviceInfo(ptr long) @ stub BluetoothGetLocalServiceInfo @ stdcall BluetoothGetRadioInfo(ptr ptr) @ stub BluetoothGetServicePnpInstance diff --git a/dlls/bluetoothapis/main.c b/dlls/bluetoothapis/main.c index 4f82381acc9..7cf89b23fc9 100644 --- a/dlls/bluetoothapis/main.c +++ b/dlls/bluetoothapis/main.c @@ -391,6 +391,47 @@ DWORD WINAPI BluetoothGetRadioInfo( HANDLE radio, PBLUETOOTH_RADIO_INFO info ) return ERROR_SUCCESS; }
+/********************************************************************* + * BluetoothGetDeviceInfo + */ +DWORD WINAPI BluetoothGetDeviceInfo( HANDLE radio, BLUETOOTH_DEVICE_INFO *info ) +{ + const static BYTE addr_zero[6]; + BTH_DEVICE_INFO_LIST *devices; + DWORD i, ret = ERROR_NOT_FOUND; + + TRACE( "(%p, %p)\n", radio, info ); + + if (!radio) + return E_HANDLE; + if (!info) + return ERROR_INVALID_PARAMETER; + if (info->dwSize != sizeof( *info )) + return ERROR_REVISION_MISMATCH; + if (!memcmp( info->Address.rgBytes, addr_zero, sizeof( addr_zero ) )) + return ERROR_NOT_FOUND; + + devices = radio_get_devices( radio ); + if (!devices) + return GetLastError(); + for (i = 0; i < devices->numOfDevices; i++) + { + if (devices->deviceList[i].address == info->Address.ullLong) + { + device_info_from_bth_info( info, &devices->deviceList[i] ); + if (info->fConnected) + GetSystemTime( &info->stLastSeen ); + else + FIXME( "semi-stub!\n" ); + ret = ERROR_SUCCESS; + break; + } + } + + free( devices ); + return ret; +} + /********************************************************************* * BluetoothIsConnectable */ diff --git a/dlls/bthprops.cpl/bthprops.cpl.spec b/dlls/bthprops.cpl/bthprops.cpl.spec index dee5544baaf..2b263c7627e 100644 --- a/dlls/bthprops.cpl/bthprops.cpl.spec +++ b/dlls/bthprops.cpl/bthprops.cpl.spec @@ -34,7 +34,7 @@ @ stub BluetoothFindProtocolEntryClose @ stdcall -import BluetoothFindRadioClose(ptr) @ stub BluetoothFindServiceClose -@ stub BluetoothGetDeviceInfo +@ stdcall BluetoothGetDeviceInfo(ptr long) @ stdcall -import BluetoothGetRadioInfo(ptr ptr) @ stdcall -import BluetoothIsConnectable(ptr) @ stdcall -import BluetoothIsDiscoverable(ptr) diff --git a/dlls/irprops.cpl/irprops.cpl.spec b/dlls/irprops.cpl/irprops.cpl.spec index 1f6116addc5..483ae4e288e 100644 --- a/dlls/irprops.cpl/irprops.cpl.spec +++ b/dlls/irprops.cpl/irprops.cpl.spec @@ -30,7 +30,7 @@ @ stub BluetoothFindProtocolEntryClose @ stdcall -import BluetoothFindRadioClose(ptr) @ stub BluetoothFindServiceClose -@ stub BluetoothGetDeviceInfo +@ stdcall BluetoothGetDeviceInfo(ptr long) @ stdcall -import BluetoothGetRadioInfo(ptr ptr) @ stdcall BluetoothIsConnectable(ptr) bthprops.cpl.BluetoothIsConnectable @ stdcall BluetoothIsDiscoverable(ptr) bthprops.cpl.BluetoothIsDiscoverable