I am trying to use the NDISUIO API to connect to a particular access point
(BSSID). But it seems like I am always getting error from the miniport
driver even though according to MS website
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddk40/html/cmrefoid_802_11_bssid_list_scan.asp)
the setting of OID_802_11_BSSID is mandatory by the miniport driver. I am
using Toshiba e830 and have tested the same code on a few hp PDAs running
Windows Mobile 2003/2003 SE with same result. Here is the snippet of the
code that is producing the error:
BOOL
WIFIDriverAdapter::ConnectToBssid(NDIS_802_11_MAC_ADDRESS *pBssid){
static const TCHAR *methodName = _T("WIFIDriverAdapter::ConnectToBssid");
STLOG_MARKER(methodName);
DWORD dwIOCReturn;
CHAR cBuffer[1024];
PNDISUIO_SET_OID pSetOid;
pSetOid = (PNDISUIO_SET_OID)cBuffer;
DWORD dwReturnedBytes;
dwReturnedBytes = 1024;
pSetOid->Oid = OID_802_11_BSSID;
pSetOid->ptcDeviceName = m_pCurrentWlanInfo->IntfEntry.wszGuid;
for (int i =0; i< 6; i++){
pSetOid->Data[i] = (*pBssid)[i];
}
STLOG(_T("%s: Trying to connect to BSSID [%s]\r\n"), methodName,
CommonUtility::FromBssid(pBssid));
if (DoNdisUIOControl(IOCTL_NDISUIO_SET_OID_VALUE, &dwIOCReturn, pSetOid,
sizeof(NDISUIO_SET_OID
), NULL, &dwReturnedBytes)){
STLOG(_T("%s: Setting BSSID successful\r\n"), methodName);
return TRUE;
} else {
STLOG(_T("%s: !!!!!BSSID Set Unsuccessful!!!!!!!!\r\n"), methodName);
return FALSE;
}
}
When I run the code I am getting the following error:
22:46:22(7230991),thr 0x3E23FC66 : !!!!!!!!!!!DeviceIoControl
error!!!!!!!!
22:46:22(7230992),thr 0x3E23FC66 : GetLastError returned : 0x00000032: The
network request is not supported. )
22:46:22(7230993),thr 0x3E23FC66 : WIFIDriverAdapter::ConnectToBssid:
!!!!!BSSID Set Unsuccessful!!!!!!!!
Setting of other OIDS like OID_802_11_SSID works with the driver from al the
PDAs. Only setting of OID_802_11_BSSID is giving problem. Am I setting the
PNDISUIO_SET_OID structure correctly? Is there something I have to do before
to get this to work. I have disabled the WZC before invoking this method.
Any help would be greatly appreciated.