From: Vibhav Pant vibhavp@gmail.com
--- dlls/bluetoothapis/main.c | 22 ++++++++++++++++------ dlls/bluetoothapis/tests/radio.c | 6 +++--- 2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/dlls/bluetoothapis/main.c b/dlls/bluetoothapis/main.c index c63d584e9a6..c9999ae92a8 100644 --- a/dlls/bluetoothapis/main.c +++ b/dlls/bluetoothapis/main.c @@ -96,8 +96,7 @@ HBLUETOOTH_RADIO_FIND WINAPI BluetoothFindFirstRadio(BLUETOOTH_FIND_RADIO_PARAMS { DWORD err; err = GetLastError(); - SetupDiDestroyDeviceInfoList(find->devinfo); - free(find); + BluetoothFindRadioClose(find); find = NULL; SetLastError(err); } @@ -110,11 +109,22 @@ HBLUETOOTH_RADIO_FIND WINAPI BluetoothFindFirstRadio(BLUETOOTH_FIND_RADIO_PARAMS /********************************************************************* * BluetoothFindRadioClose */ -BOOL WINAPI BluetoothFindRadioClose(HBLUETOOTH_RADIO_FIND find) +BOOL WINAPI BluetoothFindRadioClose(HBLUETOOTH_RADIO_FIND find_handle) { - FIXME("(%p): stub!\n", find); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + struct bluetooth_find_radio_handle *find = find_handle; + + TRACE("(%p)\n", find_handle); + + if (!find_handle) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + SetupDiDestroyDeviceInfoList(find->devinfo); + free(find); + SetLastError(ERROR_SUCCESS); + return TRUE; }
/********************************************************************* diff --git a/dlls/bluetoothapis/tests/radio.c b/dlls/bluetoothapis/tests/radio.c index 9d4dc8c26d2..ad8a0616fd9 100644 --- a/dlls/bluetoothapis/tests/radio.c +++ b/dlls/bluetoothapis/tests/radio.c @@ -61,7 +61,7 @@ void test_BluetoothFindFirstRadio( void ) if (find) { CloseHandle( radio ); - todo_wine ok( BluetoothFindRadioClose( find ), "BluetoothFindRadioClose failed: %lu\n", GetLastError() ); + ok( BluetoothFindRadioClose( find ), "BluetoothFindRadioClose failed: %lu\n", GetLastError() ); } }
@@ -102,7 +102,7 @@ void test_BluetoothFindNextRadio( void ) } CloseHandle( radio ); } - todo_wine ok( BluetoothFindRadioClose( find ), "BluetoothFindRadioClose failed: %lu\n", GetLastError() ); + ok( BluetoothFindRadioClose( find ), "BluetoothFindRadioClose failed: %lu\n", GetLastError() ); }
void test_BluetoothFindRadioClose( void ) @@ -112,7 +112,7 @@ void test_BluetoothFindRadioClose( void ) SetLastError( 0xdeadbeef ); ok( !BluetoothFindRadioClose( NULL ), "Expected BluetoothFindRadioClose to return FALSE\n" ); err = GetLastError(); - todo_wine ok( err == ERROR_INVALID_HANDLE, "%lu != %d\n", err, ERROR_INVALID_HANDLE ); + ok( err == ERROR_INVALID_HANDLE, "%lu != %d\n", err, ERROR_INVALID_HANDLE ); }
START_TEST( radio )