mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 04:20:46 +00:00
[WLANCONF]
- Build fixes and code improvements svn path=/branches/wlan-bringup/; revision=54871
This commit is contained in:
parent
bca3d2fcde
commit
2e999b844a
1 changed files with 9 additions and 10 deletions
|
@ -218,7 +218,7 @@ WlanConnect(HANDLE hAdapter)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
SetOid->Oid = OID_802_11_SSID;
|
SetOid->Oid = OID_802_11_SSID;
|
||||||
Ssid = SetOid->Data;
|
Ssid = (PNDIS_802_11_SSID)SetOid->Data;
|
||||||
|
|
||||||
/* Fill the OID data buffer */
|
/* Fill the OID data buffer */
|
||||||
RtlCopyMemory(Ssid->Ssid, sSsid, strlen(sSsid));
|
RtlCopyMemory(Ssid->Ssid, sSsid, strlen(sSsid));
|
||||||
|
@ -246,7 +246,7 @@ WlanScan(HANDLE hAdapter)
|
||||||
NDISUIO_SET_OID SetOid;
|
NDISUIO_SET_OID SetOid;
|
||||||
PNDISUIO_QUERY_OID QueryOid;
|
PNDISUIO_QUERY_OID QueryOid;
|
||||||
DWORD QueryOidSize;
|
DWORD QueryOidSize;
|
||||||
PNDIS_802_11_BSSID_LIST_EX BssidList;
|
PNDIS_802_11_BSSID_LIST BssidList;
|
||||||
DWORD i, j;
|
DWORD i, j;
|
||||||
|
|
||||||
SetOid.Oid = OID_802_11_BSSID_LIST_SCAN;
|
SetOid.Oid = OID_802_11_BSSID_LIST_SCAN;
|
||||||
|
@ -264,13 +264,13 @@ WlanScan(HANDLE hAdapter)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Allocate space for 15 networks to be returned */
|
/* Allocate space for 15 networks to be returned */
|
||||||
QueryOidSize = sizeof(NDISUIO_QUERY_OID) + (sizeof(NDIS_WLAN_BSSID_EX) * 15);
|
QueryOidSize = sizeof(NDISUIO_QUERY_OID) + (sizeof(NDIS_WLAN_BSSID) * 15);
|
||||||
QueryOid = HeapAlloc(GetProcessHeap(), 0, QueryOidSize);
|
QueryOid = HeapAlloc(GetProcessHeap(), 0, QueryOidSize);
|
||||||
if (!QueryOid)
|
if (!QueryOid)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
QueryOid->Oid = OID_802_11_BSSID_LIST;
|
QueryOid->Oid = OID_802_11_BSSID_LIST;
|
||||||
BssidList = QueryOid->Data;
|
BssidList = (PNDIS_802_11_BSSID_LIST)QueryOid->Data;
|
||||||
|
|
||||||
bSuccess = DeviceIoControl(hAdapter,
|
bSuccess = DeviceIoControl(hAdapter,
|
||||||
IOCTL_NDISUIO_QUERY_OID_VALUE,
|
IOCTL_NDISUIO_QUERY_OID_VALUE,
|
||||||
|
@ -294,12 +294,11 @@ WlanScan(HANDLE hAdapter)
|
||||||
{
|
{
|
||||||
for (i = 0; i < BssidList->NumberOfItems; i++)
|
for (i = 0; i < BssidList->NumberOfItems; i++)
|
||||||
{
|
{
|
||||||
PNDIS_WLAN_BSSID_EX BssidInfo = BssidList->Bssid[i];
|
PNDIS_WLAN_BSSID BssidInfo = &BssidList->Bssid[i];
|
||||||
PNDIS_802_11_SSID Ssid = &BssidInfo->Ssid;
|
PNDIS_802_11_SSID Ssid = &BssidInfo->Ssid;
|
||||||
UCHAR SupportedRates[16] = &BssidInfo->SupportedRates;
|
|
||||||
NDIS_802_11_RSSI Rssi = BssidInfo->Rssi;
|
NDIS_802_11_RSSI Rssi = BssidInfo->Rssi;
|
||||||
NDIS_802_11_NETWORK_INFRASTRUCTURE NetworkType = BssidInfo->InfrastructureMode;
|
NDIS_802_11_NETWORK_INFRASTRUCTURE NetworkType = BssidInfo->InfrastructureMode;
|
||||||
CHAR SsidBuffer[33];
|
CHAR SsidBuffer[NDIS_802_11_LENGTH_SSID + 1];
|
||||||
|
|
||||||
/* SSID member is a non-null terminated ASCII string */
|
/* SSID member is a non-null terminated ASCII string */
|
||||||
RtlCopyMemory(SsidBuffer, Ssid->Ssid, Ssid->SsidLength);
|
RtlCopyMemory(SsidBuffer, Ssid->Ssid, Ssid->SsidLength);
|
||||||
|
@ -315,12 +314,12 @@ WlanScan(HANDLE hAdapter)
|
||||||
NetworkType == Ndis802_11IBSS ? "Adhoc" : "Infrastructure",
|
NetworkType == Ndis802_11IBSS ? "Adhoc" : "Infrastructure",
|
||||||
(int)Rssi);
|
(int)Rssi);
|
||||||
|
|
||||||
for (j = 0; j < 16; j++)
|
for (j = 0; j < NDIS_802_11_LENGTH_RATES; j++)
|
||||||
{
|
{
|
||||||
if (SupportedRates[j] != 0)
|
if (BssidInfo->SupportedRates[j] != 0)
|
||||||
{
|
{
|
||||||
/* SupportedRates are in units of .5 */
|
/* SupportedRates are in units of .5 */
|
||||||
_tprintf(_T("%d "), (SupportedRates[j] << 2));
|
_tprintf(_T("%d "), (BssidInfo->SupportedRates[j] << 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_tprintf(_T("\n"));
|
_tprintf(_T("\n"));
|
||||||
|
|
Loading…
Reference in a new issue