Author: cgutman Date: Tue Jan 10 02:09:56 2012 New Revision: 54898
URL: http://svn.reactos.org/svn/reactos?rev=54898&view=rev Log: [WLANCONF] - Return to using OID_GEN_PHYSICAL_MEDIUM to determine if an adapter supports WLAN
Modified: branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c
Modified: branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c URL: http://svn.reactos.org/svn/reactos/branches/wlan-bringup/base/applications/n... ============================================================================== --- branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c [iso-8859-1] (original) +++ branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c [iso-8859-1] Tue Jan 10 02:09:56 2012 @@ -91,30 +91,23 @@ { BOOL bSuccess; DWORD dwBytesReturned; - PNDISUIO_QUERY_OID QueryOid; - DWORD QueryOidSize; - - QueryOidSize = FIELD_OFFSET(NDISUIO_QUERY_OID, Data) + sizeof(NDIS_802_11_SSID); - 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, - IOCTL_NDISUIO_QUERY_OID_VALUE, - QueryOid, - QueryOidSize, - QueryOid, - QueryOidSize, - &dwBytesReturned, - NULL); - - HeapFree(GetProcessHeap(), 0, QueryOid); - - return bSuccess; + NDISUIO_QUERY_OID QueryOid; + + /* WLAN drivers must support this OID */ + QueryOid.Oid = OID_GEN_PHYSICAL_MEDIUM; + + bSuccess = DeviceIoControl(hAdapter, + IOCTL_NDISUIO_QUERY_OID_VALUE, + &QueryOid, + sizeof(QueryOid), + &QueryOid, + sizeof(QueryOid), + &dwBytesReturned, + NULL); + if (!bSuccess || *(PULONG)QueryOid.Data != NdisPhysicalMediumWirelessLan) + return FALSE; + + return TRUE; }
HANDLE