Author: cgutman
Date: Sun Jan  8 22:48:08 2012
New Revision: 54885

URL: http://svn.reactos.org/svn/reactos?rev=54885&view=rev
Log:
[WLANCONF]
- Fix my bit shifting fail

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/network/wlanconf/wlanconf.c?rev=54885&r1=54884&r2=54885&view=diff
==============================================================================
--- 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] Sun Jan  8 22:48:08 2012
@@ -315,7 +315,7 @@
         HeapFree(GetProcessHeap(), 0, SetOid);
 
         SetOidSize = sizeof(NDISUIO_SET_OID) + FIELD_OFFSET(NDIS_802_11_WEP, 
KeyMaterial) +
-                     (strlen(sWepKey) >> 2);
+                     (strlen(sWepKey) >> 1);
         SetOid = HeapAlloc(GetProcessHeap(), 0, SetOidSize);
         if (!SetOid)
             return FALSE;
@@ -325,15 +325,15 @@
         WepData = (PNDIS_802_11_WEP)SetOid->Data;
 
         WepData->KeyIndex = 0x80000000;
-        WepData->KeyLength = strlen(sWepKey) >> 2;
+        WepData->KeyLength = strlen(sWepKey) >> 1;
         WepData->Length = FIELD_OFFSET(NDIS_802_11_WEP, KeyMaterial) + 
WepData->KeyLength;
         
         /* Assemble the hex key */
         i = 0;
-        while (sWepKey[i << 2] != '\0')
-        {
-            WepData->KeyMaterial[i] = CharToHex(sWepKey[i << 2]) << 4;
-            WepData->KeyMaterial[i] |= CharToHex(sWepKey[(i << 2) + 1]);
+        while (sWepKey[i << 1] != '\0')
+        {
+            WepData->KeyMaterial[i] = CharToHex(sWepKey[i << 1]) << 4;
+            WepData->KeyMaterial[i] |= CharToHex(sWepKey[(i << 1) + 1]);
             i++;
         }
         
@@ -503,8 +503,11 @@
                 Rate = BssidInfo->SupportedRates[j];
                 if (Rate != 0)
                 {
+                    /* Bit 7 is the basic rates bit */
+                    Rate = Rate & 0x7F;
+
                     /* SupportedRates are in units of .5 */
-                    Rate = Rate << 2;
+                    Rate = Rate << 1;
 
                     _tprintf(_T("%u "), Rate);
                 }


Reply via email to