I am trying to connect to WiFi network using bssid in situation where are the are multiple AP (SSID) with same name but having different bssid. The sample relevant code I am using is
NDIS_OBJECT_HEADER header;
DOT11_BSSID_LIST list;
...
header.Revision = DOT11_BSSID_LIST_REVISION_1;
header.Type = 0x80;
header.Size = sizeof(header);
list.Header = header;
list.uNumOfEntries = 1;
list.uTotalNumOfEntries = 1;
list.BSSIDs[0][0] = 0xa4;
...
list.BSSIDs[0][5] = 0x00;
...
wlanConnPara.pDesiredBssidList = &list;
...
error = WlanConnect(hClient,&guidIntf,&wlanConnPara,NULL);
The problem is the code is working correctly in 3 machines with win7 but in win8 its is returning 50 (ERROR_NOT_SUPPPORTED). The only difference is the win 8 is installed in a vm. but one of the win7 is also installed in vm.
but if I used
list.uNumOfEntries = 0;
then it is connecting but but not to the bssid I desire.
One thing i noticed when I saw the exported function of the dll wlanapi.dll for both win7 and win 8 using DLL Export Viewer
The number of function in win7 is lesser than in win8.
in win7 there is only
WlanConnect
but in win8 there is also
WlanConnect
WlanConnectEx
WlanConnectWithInput
but in the header file wlanapi.h (I m using Visual Studio Express 13) WlanConnectEx and WlanConnectWithInput are not there. I check the MSDN and only some new function are present.
In summary
i) Is this because the os is running in vm?(but one of the win7 is also running in vm)
ii) Is there anything missing in the code like what should be the value in header or the list?
iii) Is it possible that the connect with bssid has been moved to these new functions?
iv) If so where do i get the correct header file for this new functions?
v) Will it be in Win SDK latest? (This I will check after I post this)
Vi) Will it be possible to know what parameters this new functions require without header file.(Maybe not possible but just in case it is)
EDIT: Found out its not a problem of the API rather its a problem of the driver. The wifi didnt have Win8 driver but only win7 driver. Changed the adapter to one which had a win8 driver and its working now. Though its a little strange that functionality working in an older os will not work in new system (no backward compatibility?). Or maybe it loaded the xp driver as a generic one. And xp does not support the BSSID list. Unfortunately I checked the original adapter chipset and its an atheros one. (The adapter is manufactured by another vendor but chipset is atheros and the required driver is for AR9170). And they are yet to release win8 driver. I tried to find one but couldn't find so far.
But the questions for header file for new function is still applicable.