1

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):

  1. I call WlanHostedNetworkSetProperty and pass WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS with dwMaxNumberOfPeers 5, and SSID "MyNetwork"
  2. When I call WlanHostedNetworkQueryProperty I get the details I have just set
  3. Now I call WlanHostedNetworkSetProperty again, this time dwMaxNumberOfPeers is 10, and SSID stays "MyNetwork"
  4. When I call WlanHostedNetworkQueryProperty I will get dwMaxNumberOfPeers 5, not 10...

Scenario 2 (no problem):

  1. I call WlanHostedNetworkSetProperty and pass WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS with dwMaxNumberOfPeers 5, and SSID "MyNetwork"
  2. When I call WlanHostedNetworkQueryProperty I get the details I have just set
  3. Now I call WlanHostedNetworkSetProperty again, this time dwMaxNumberOfPeers is 10, and SSID is changed "MyOtherNetwork"
  4. 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?

Daniel Gruszczyk
  • 5,379
  • 8
  • 47
  • 86

0 Answers0