manniru / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

CloseHandle needs to be called after BluetoothFindFirstRadio and BluetoothFindNextRadio #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When BluetoothFindFirstRadio and BluetoothFindNextRadio are called (in 
bluecove/src/main/c/intelbth/intelbth.cpp), CloseHandle() needs to be called on 
the returned radio handle.  Otherwise, outbound Bluetooth connections will fail 
after the machine in suspended & resumed, or the Bluetooth adapter is removed 
and re-inserted.

From the documentation for these functions:

phRadio [out]

    Pointer to where the next enumerated radio handle will be returned. When no longer needed, this handle must be released via CloseHandle.

I just thought I'd point this out since I recently got bitten by this bug while 
developing some Bluetooth software, and thought I'd share the results of my 
investigation to save others the grief I went through to solve this!

Original issue reported on code.google.com by arg...@gmail.com on 3 Dec 2011 at 8:29