OID_802_11_BSSID_LIST fail!

Posted: 12-09-2006, 03:08 AM

Hi all,

I would like to extract all the acess point's information discovered b
my D-link wifi card. When I run the source code, it returns

IOCTL BSSID_LIST failed : 122

In the source code lists below, the second DeviceIoControl fails!

Any experts here please point out my mistake, many thanks.

parts of my source code is :
************************************************** *****

VOID GetAPList(HANDLE Handle, AP_DATA **ppAP_data, long *plItems)
{
UCHAR QueryBuffer[4096];
PNDISPROT_QUERY_OID pQueryOid;
PNDISPROT_SET_OID pSetOid;
PNDIS_802_11_BSSID_LIST pBssid_List;
ULONG i = 0;
int j = 0;
DWORD dwBytesReturned;

pSetOid = (PNDISPROT_SET_OID) &QueryBuffer[0];
pSetOid->Oid = OID_802_11_BSSID_LIST_SCAN;

if (!DeviceIoControl(Handle,
IOCTL_NDISPROT_SET_OID_VALUE,
(LPVOID) &QueryBuffer[0],
sizeof(QueryBuffer),
(LPVOID) &QueryBuffer[0],
0,
&dwBytesReturned,
NULL))
{

DEBUGP(("IOCTL SET BSSID_LIST_SCAN failed: %d\n", GetLastError()));
}

pQueryOid = (PNDISPROT_QUERY_OID) &QueryBuffer[0];
pQueryOid->Oid = OID_802_11_BSSID_LIST;


if (DeviceIoControl(Handle, //<---This line fails to run!!!
IOCTL_NDISPROT_QUERY_OID_VALUE,
(LPVOID) &QueryBuffer[0],
sizeof(QueryBuffer),
(LPVOID) &QueryBuffer[0],
sizeof(QueryBuffer),
&dwBytesReturned,
NULL))
{
DEBUGP(("IOCTL BSSID_LIST succeeded\n"));
pBssid_List = (PNDIS_802_11_BSSID_LIST)pQueryOid->Data;
*plItems = pBssid_List->NumberOfItems;
*ppAP_data = (AP_DATA *) calloc(pBssid_List->NumberOfItems
sizeof(AP_DATA));

for ( i = 0; i < pBssid_List->NumberOfItems; i++ )
{
for ( j = 0; j < 6; j++ )
{
(*ppAP_data)[i].mac_addr[j]
(pBssid_List->Bssid[i]).MacAddress[j];
}
(*ppAP_data)[i].Rssi = (pBssid_List->Bssid[i]).Rssi;
}
}

else
{

DEBUGP(("IOCTL BSSID_LIST failed: %d\n", GetLastError()));
}



--
ttse
-----------------------------------------------------------------------
ttse7's Profile: http://forums.techarena.in/member.php?userid=1998
View this thread: http://forums.techarena.in/showthread.php?t=63924

http://forums.techarena.i

Reply With Quote

Responses to "OID_802_11_BSSID_LIST fail!"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expanding - Fail Capt Sand Windows Vista Install & Setup 1 06-23-2006 09:30 PM
WMI fail Johson Windows XP WMI 2 08-29-2005 05:54 AM
Irp Fail with INVALID_USER_BUFFER! A.Ilamparithi Windows XP Device Drivers 0 11-23-2004 04:00 PM
Fail on Restart Ryan Riel Windows XP Embedded 9 11-25-2003 11:52 PM
Fax fail to receive Win XP Manuel Windows XP Printers / Scanners / Fax 1 10-16-2003 10:27 AM