I'm thinking there must be a way to ask windows for information about the network adaptor of the current connected network (available unicast/multicast, is it Wi-Fi, the name, etc)
When I say connected, I mean like the current Wi-Fi connection like windows shows you in the Wi-Fi options - the definition of connected is probably different in the networking world
Even if it's just possible the interface index, because It's easy to look up most other things using GetAdaptersAddresses() etc
In case this is an x/y problem: I'm trying to do this as part of writing an mdns client (for academic purposes, I know windows has an mdns api). I'd like to only broadcast and receive on the current Wi-Fi network (for which I think you need to set the IP_ADD_SOURCE_MEMBERSHIP flag in setsockopt) and I also need to then know which IP address to return to the mdns response
I could set IP_ADD_MEMBERSHIP but then I would still need to find out which IP to return and everything just becomes conceptually easier if things work on a single network (or so I thought)