From 2/4:
``` + .ProviderId = {0xadbb1448, 0x7c08, 0x7c08, {0x96, 0x96, 0xda, 0xdb, 0xf8, 0xf9, 0x44, 0x2a}}, ```
That's not a valid GUID, so may be worth a double check to make sure that really is copied down correctly?
``` +#ifdef HAS_BLUETOOTH +#include "ws2bth.h" +#endif ```
No need to include guard our own headers; they're always present.
From 4/4:
``` + /* If the RFCOMM channel was set to BT_PORT_ANY, we need to find an available RFCOMM + * channel. The Linux kernel has a similar mechanism, but the channel is only assigned + * on listen(), which we cannot call yet. The other, albeit hacky/race-y way to find an available + * channel is to loop through all valid channel values (1 to 30) until bind() succeeds. + */ ```
What's wrong with binding to port 0 here? Do we need getaddrname() to return the real port immediately, and Linux won't do that?
``` + if (i > 30) + { + + set_error( sock_get_ntstatus( EADDRINUSE ) ); + return; + } ```
Stray newline.