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