mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 18:00:41 +00:00
[WLANCONF]
- Use a different method for determining if an adapter supports 802.11 networks so it works on drivers that don't implement OID_GEN_PHYSICAL_MEDIUM svn path=/branches/wlan-bringup/; revision=54888
This commit is contained in:
parent
bb04662d80
commit
e1d32a01d0
1 changed files with 17 additions and 10 deletions
|
@ -91,23 +91,30 @@ IsWlanAdapter(HANDLE hAdapter)
|
||||||
{
|
{
|
||||||
BOOL bSuccess;
|
BOOL bSuccess;
|
||||||
DWORD dwBytesReturned;
|
DWORD dwBytesReturned;
|
||||||
NDISUIO_QUERY_OID QueryOid;
|
PNDISUIO_QUERY_OID QueryOid;
|
||||||
|
DWORD QueryOidSize;
|
||||||
|
|
||||||
/* NDIS 5.1 WLAN drivers must support this OID */
|
QueryOidSize = sizeof(NDISUIO_QUERY_OID) + sizeof(NDIS_802_11_SSID);
|
||||||
QueryOid.Oid = OID_GEN_PHYSICAL_MEDIUM;
|
QueryOid = HeapAlloc(GetProcessHeap(), 0, QueryOidSize);
|
||||||
|
if (!QueryOid)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* We're just going to do a OID_802_11_SSID query. WLAN drivers should
|
||||||
|
* always succeed this query (returning SsidLength = 0 if not associated) */
|
||||||
|
QueryOid->Oid = OID_802_11_SSID;
|
||||||
|
|
||||||
bSuccess = DeviceIoControl(hAdapter,
|
bSuccess = DeviceIoControl(hAdapter,
|
||||||
IOCTL_NDISUIO_QUERY_OID_VALUE,
|
IOCTL_NDISUIO_QUERY_OID_VALUE,
|
||||||
&QueryOid,
|
QueryOid,
|
||||||
sizeof(QueryOid),
|
QueryOidSize,
|
||||||
&QueryOid,
|
QueryOid,
|
||||||
sizeof(QueryOid),
|
QueryOidSize,
|
||||||
&dwBytesReturned,
|
&dwBytesReturned,
|
||||||
NULL);
|
NULL);
|
||||||
if (!bSuccess || *(PULONG)QueryOid.Data != NdisPhysicalMediumWirelessLan)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
HeapFree(GetProcessHeap(), 0, QueryOid);
|
||||||
|
|
||||||
|
return bSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE
|
HANDLE
|
||||||
|
|
Loading…
Reference in a new issue