So I came across a problem when calling WlanHostedNetworkSetProperty from WLanapi.dll. This is that the dwMaxNumberOfPeers from WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS passed into that function is not going to be persisted unless SSID is different to the previous call.
Scenario 1 (problem):
- I call WlanHostedNetworkSetProperty and pass WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS with dwMaxNumberOfPeers 5, and SSID "MyNetwork"
- When I call WlanHostedNetworkQueryProperty I get the details I have just set
- Now I call WlanHostedNetworkSetProperty again, this time dwMaxNumberOfPeers is 10, and SSID stays "MyNetwork"
- When I call WlanHostedNetworkQueryProperty I will get dwMaxNumberOfPeers 5, not 10...
Scenario 2 (no problem):
- I call WlanHostedNetworkSetProperty and pass WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS with dwMaxNumberOfPeers 5, and SSID "MyNetwork"
- When I call WlanHostedNetworkQueryProperty I get the details I have just set
- Now I call WlanHostedNetworkSetProperty again, this time dwMaxNumberOfPeers is 10, and SSID is changed "MyOtherNetwork"
- When I call WlanHostedNetworkQueryProperty I will get dwMaxNumberOfPeers correctly set to 10...
Has any of you come across that? How did you solve it without setting some fake random SSID every time I want to change max peers of the hosted network?