On what platforms does this happen?
WSALookupServiceBegin can fail with the error code WSASERVICE_NOT_FOUND if no devices are found.
Thanks. Can you add a comment to this effect please?
Done.
That's not quite what I was saying though. The flag still isn't Bluetooth-specific but you've just changed its form. Rather I was suggesting to store the flags outside the union, in the ws_lookup_service_ctx structure.
Ah. Nevertheless, `ws_lookup_service_ctx` only needs to know whether we're performing a device or service inquiry, so the boolean is sufficient and simpler.
Basically, `WSALookupService` can be used to perform either device or service discovery, controlled by the existence of the `LUP_CONTAINERS` flag. The union only has a single member as of now, but will also have a `ws_query_bth_services` struct once support for service discovery is added as well.
If you don't specify either flag, what happens? The documentation looks like both things are returned.
So, the _only_ flag for controlling what kind of inquiry needs to be performed is `LUP_CONTAINERS`. If it's there, WSALookupServiceBegin will look up Bluetooth devices. If it's not, it'll go through Bluetooth services (on either the local radio(s) or a remote device, determined by `WSAQUERYSET` fields). The documentation doesn't do a great job of explaining this (though the API itself is quite unintuitive to begin with). I've added some documentation to ``sh_lookup_service_begin` explaining this.