How to query 802.11 OIDs from NDIS

A

Arsalan Ahmad

Hi all,

I have written a simple application in which I open the handle to file
NDISUIO_DEVICE_NAME and then use IOCTL_NDISUIO_QUERY_OID_VALUE in the call
to DeviceIOControl() to query different 802.11 OIDs like OID_802_11_SSID,
OID_802_11_RSSI etc etc and some other OIDs like OID_GEN_RCV_OK,
OID_GEN_XMIT_OK. The sample code is shown below:

BOOL MyClass::IOQueryOID(HANDLE hNdisUio, PTCHAR adapter_name, NDIS_OID oid,
LPVOID pData, int length)
{
DWORD dwBytesReturned = 0;
PNDISUIO_QUERY_OID pQOid=NULL;
DWORD dwQueryOidBufferSize = sizeof(NDISUIO_QUERY_OID) + length;

pQOid = (PNDISUIO_QUERY_OID) new BYTE[dwQueryOidBufferSize];
if (!pQueryOid)
{
return false;
}

pQueryOid->Oid = oid;
pQueryOid->ptcDeviceName = adapter_name;

if(!DeviceIoControl(hNdisUio,
IOCTL_NDISUIO_QUERY_OID_VALUE,
pQueryOid,
dwQueryOidBufferSize,
pQueryOid,
dwQueryOidBufferSize,
&dwBytesReturned,
0))
{
delete [] pQueryOid;
return false;
}

if(pData != NULL && length > 0)
memcpy(pData, &pQueryOid->Data[0], (dwBytesReturned < length) ?
dwBytesReturned : length);

delete [] pQueryOid;
return true;
}

But now i want to open file DD_NDIS_DEVICE_NAME and want to query same
OIDs..how should i do this?

Thanks,

Arsalan
 
A

Arsalan Ahmad

Hi,

I am developing an application on Pocket PC 2003 which uses NDISUIO to query
different oids like OID_802_11_FRAGMENTATION_THRESHOLD, OID_11_RTS_THRESHOLD
etc. However I am getting Not Supported for these OIDs when I query for the
supported OIDs from NDISUIO driver. But even then if I need to query these
OIDs, then please tell me what should i do? Is there any other interface
available for this? Or can I query the NIC driver directly rather than using
the NDISUIO driver? My application runs on Pocket PC 2003.

Thanks,

Arsalan
Arkady Frenkel said:
If that device support those you can try
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q304296
Arkady
Arsalan Ahmad said:
Hi all,

I have written a simple application in which I open the handle to file
NDISUIO_DEVICE_NAME and then use IOCTL_NDISUIO_QUERY_OID_VALUE in the
call to DeviceIOControl() to query different 802.11 OIDs like
OID_802_11_SSID, OID_802_11_RSSI etc etc and some other OIDs like
OID_GEN_RCV_OK, OID_GEN_XMIT_OK. The sample code is shown below:

BOOL MyClass::IOQueryOID(HANDLE hNdisUio, PTCHAR adapter_name, NDIS_OID
oid, LPVOID pData, int length)
{
DWORD dwBytesReturned = 0;
PNDISUIO_QUERY_OID pQOid=NULL;
DWORD dwQueryOidBufferSize = sizeof(NDISUIO_QUERY_OID) + length;

pQOid = (PNDISUIO_QUERY_OID) new BYTE[dwQueryOidBufferSize];
if (!pQueryOid)
{
return false;
}

pQueryOid->Oid = oid;
pQueryOid->ptcDeviceName = adapter_name;

if(!DeviceIoControl(hNdisUio,
IOCTL_NDISUIO_QUERY_OID_VALUE,
pQueryOid,
dwQueryOidBufferSize,
pQueryOid,
dwQueryOidBufferSize,
&dwBytesReturned,
0))
{
delete [] pQueryOid;
return false;
}

if(pData != NULL && length > 0)
memcpy(pData, &pQueryOid->Data[0], (dwBytesReturned < length) ?
dwBytesReturned : length);

delete [] pQueryOid;
return true;
}

But now i want to open file DD_NDIS_DEVICE_NAME and want to query same
OIDs..how should i do this?

Thanks,

Arsalan
 
T

Thomas F. Divine [DDK MVP]

Arsalan Ahmad said:
Hi,

I am developing an application on Pocket PC 2003 which uses NDISUIO to
query different oids like OID_802_11_FRAGMENTATION_THRESHOLD,
OID_11_RTS_THRESHOLD etc. However I am getting Not Supported for these
OIDs when I query for the supported OIDs from NDISUIO driver. But even
then if I need to query these OIDs, then please tell me what should i do?
Is there any other interface available for this? Or can I query the NIC
driver directly rather than using the NDISUIO driver? My application runs
on Pocket PC 2003.

Thanks,

Arsalan

If you are getting the "not supported" status for these NDIS queries, then
that means that the information simply is not provided by the miniport.

If you look in the MSDN topic "802.11 Wireless LAN Objects" you will see
that these OIDs (and others) are listed as "optional". This means that the
802.11 miniport writer is not required to support them. In many cases, if
the OID is listed as Optional, then that means that you probaly will never
be able to get the information.

In this case there is no way to fetch the information - regardless of how
you try to get it.

Sorry.

Thomas F. Divine, Windows DDK MVP
http://www.rawether.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top