X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=base%2Fapplications%2Fnetwork%2Fwlanconf%2Fwlanconf.c;h=a4edcfd7d5ce4000a5b25706fa7af4836fad4f85;hp=0a01407e26a1258b68eb29234933206c3d33b575;hb=715350ea7c9054b85db3e727bc82dc53a60560aa;hpb=8b006f72fd97ae0bc8a09f45ddd1ecb29ec45050 diff --git a/base/applications/network/wlanconf/wlanconf.c b/base/applications/network/wlanconf/wlanconf.c index 0a01407e26a..a4edcfd7d5c 100644 --- a/base/applications/network/wlanconf/wlanconf.c +++ b/base/applications/network/wlanconf/wlanconf.c @@ -91,30 +91,23 @@ IsWlanAdapter(HANDLE hAdapter) { BOOL bSuccess; DWORD dwBytesReturned; - PNDISUIO_QUERY_OID QueryOid; - DWORD QueryOidSize; + NDISUIO_QUERY_OID QueryOid; - 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; + /* WLAN drivers must support this OID */ + QueryOid.Oid = OID_GEN_PHYSICAL_MEDIUM; bSuccess = DeviceIoControl(hAdapter, IOCTL_NDISUIO_QUERY_OID_VALUE, - QueryOid, - QueryOidSize, - QueryOid, - QueryOidSize, + &QueryOid, + sizeof(QueryOid), + &QueryOid, + sizeof(QueryOid), &dwBytesReturned, NULL); + if (!bSuccess || *(PULONG)QueryOid.Data != NdisPhysicalMediumWirelessLan) + return FALSE; - HeapFree(GetProcessHeap(), 0, QueryOid); - - return bSuccess; + return TRUE; } HANDLE