Archived from groups: microsoft.public.platformsdk.networking,microsoft.public.smartphone.developer,microsoft.public.pocketpc.developer,microsoft.public.windows.networking.wireless,microsoft.public.win2000.networking (More info?)
hi everyone,
I am working on a project. One part of this project is force the wireless
network adapter to connect to an access point. I am doing the following way:
1. Set Authentication Mode (0 for Open)
2. Set Infrastructure Mode (1 for Infrastructure)
3. Set SSID
4. Set WEP Key
5. Enable WEP
I found when I remove WEP from my AP, and comment out step 4 & 5, my PC
(actually Pocket PC)will connect to the AP. When I add WEP to AP, and run
steps 1 to 5, my PPC only have IP address like 169.254.xx.xx. The following
is how I add WEP and enable WEP:
/*Add WEP*/
NDIS_802_11_WEP WepKey;
UCHAR KeyMaterial[13];
/*The WEP key is ACDB95776DD114409AB54323C6.
The following steps will convert 26 Digit
Hex key to a 13 bit string*/
KeyMaterial[0] = 0xAC;
KeyMaterial[1] = 0xDB;
KeyMaterial[2] = 0x95;
KeyMaterial[3] = 0x77;
KeyMaterial[4] = 0x6D;
KeyMaterial[5] = 0xD1;
KeyMaterial[6] = 0x14;
KeyMaterial[7] = 0x40;
KeyMaterial[8] = 0x9A;
KeyMaterial[9] = 0xB5;
KeyMaterial[10] = 0x43;
KeyMaterial[11] = 0x23;
KeyMaterial[12] = 0xC6;
pSetOid = (PNDISUIO_SET_OID) &SetBuffer[0];
pSetOid->Oid = OID_802_11_ADD_WEP;
pSetOid->ptcDeviceName = ptcDeviceName; /*this is because the application
runs on PPC*/
Archived from groups: microsoft.public.platformsdk.networking,microsoft.public.pocketpc.developer,microsoft.public.windows.networking.wireless (More info?)
"Eric Yun" <anonymous@discussions.microsoft.com> wrote in message newspFFl4TkEHA.784@TK2MSFTNGP15.phx.gbl...
> hi everyone,
>
> I am working on a project. One part of this project is force the wireless
> network adapter to connect to an access point.
WinCE has the wireless config service that does this automagically.
Why to reinvent the wheel.
Archived from groups: microsoft.public.platformsdk.networking,microsoft.public.pocketpc.developer,microsoft.public.windows.networking.wireless (More info?)
I am not reinvent the wheel. I am trying to build the wheel again. And, if I
have to do it, anybody knows how to do it?
Eric
"Pavel A." <pavel_a@geeklife.com> wrote in message
news:eCKkLBVkEHA.1048@tk2msftngp13.phx.gbl...
> "Eric Yun" <anonymous@discussions.microsoft.com> wrote in message
> newspFFl4TkEHA.784@TK2MSFTNGP15.phx.gbl...
>> hi everyone,
>>
>> I am working on a project. One part of this project is force the wireless
>> network adapter to connect to an access point.
>
> WinCE has the wireless config service that does this automagically.
> Why to reinvent the wheel.
>
> --PA
>
>
Archived from groups: microsoft.public.platformsdk.networking,microsoft.public.smartphone.developer,microsoft.public.pocketpc.developer,microsoft.public.windows.networking.wireless,microsoft.public.win2000.networking (More info?)
Shouldn't KeyIndex be 0x80000000 (if the first key is used to transmit,
0x80000001 for second...)?
If think it matters in which order you set the oids and I would set the
AuthenticationMode after you have set the wepkey, but maybe it's just me who
think it matters.
you should get the checkbuild of wzcsvc and log what windows does.
/Niklas
"Eric Yun" <anonymous@discussions.microsoft.com> wrote in message
newspFFl4TkEHA.784@TK2MSFTNGP15.phx.gbl...
> hi everyone,
>
> I am working on a project. One part of this project is force the wireless
> network adapter to connect to an access point. I am doing the following
> way:
>
> 1. Set Authentication Mode (0 for Open)
> 2. Set Infrastructure Mode (1 for Infrastructure)
> 3. Set SSID
> 4. Set WEP Key
> 5. Enable WEP
>
> I found when I remove WEP from my AP, and comment out step 4 & 5, my PC
> (actually Pocket PC)will connect to the AP. When I add WEP to AP, and run
> steps 1 to 5, my PPC only have IP address like 169.254.xx.xx. The
> following is how I add WEP and enable WEP:
>
>
> /*Add WEP*/
> NDIS_802_11_WEP WepKey;
>
> UCHAR KeyMaterial[13];
>
> /*The WEP key is ACDB95776DD114409AB54323C6.
> The following steps will convert 26 Digit
> Hex key to a 13 bit string*/
> KeyMaterial[0] = 0xAC;
> KeyMaterial[1] = 0xDB;
> KeyMaterial[2] = 0x95;
> KeyMaterial[3] = 0x77;
> KeyMaterial[4] = 0x6D;
> KeyMaterial[5] = 0xD1;
> KeyMaterial[6] = 0x14;
> KeyMaterial[7] = 0x40;
> KeyMaterial[8] = 0x9A;
> KeyMaterial[9] = 0xB5;
> KeyMaterial[10] = 0x43;
> KeyMaterial[11] = 0x23;
> KeyMaterial[12] = 0xC6;
>
>
>
> WepKey.KeyLength = sizeof(KeyMaterial);
> WepKey.KeyIndex = 0;
>
> memset(WepKey.KeyMaterial,0,sizeof(WepKey.KeyMaterial));
> memcpy(WepKey.KeyMaterial, KeyMaterial, WepKey.KeyLength);
> WepKey.Length = sizeof(WepKey);
>
> if(!AddWEP(&WepKey)) return FALSE;
>
> /* Set WEP status, Mode means enable or disable WEP*/
> if(!SetWEPStatus(mode)) return FALSE;
>
>
>
>
>
>
>
> The following is function AddWEP:
>
> BOOL AddWEP(PNDIS_802_11_WEP pWEP)
> {
> UCHAR SetBuffer[sizeof(NDIS_OID) +
> sizeof(PTCHAR)+sizeof(NDIS_802_11_WEP)];
> PNDISUIO_SET_OID pSetOid;
> DWORD dwBytesReturned=0;
>
> pSetOid = (PNDISUIO_SET_OID) &SetBuffer[0];
> pSetOid->Oid = OID_802_11_ADD_WEP;
> pSetOid->ptcDeviceName = ptcDeviceName; /*this is because the application
> runs on PPC*/
>
> memcpy(&pSetOid->Data[0], (LPVOID)pWEP, sizeof(NDIS_802_11_WEP));
>
> if (!DeviceIoControl(g_hNdisUio,
> IOCTL_NDISUIO_SET_OID_VALUE,
> (LPVOID)&SetBuffer[0],
> sizeof(SetBuffer),
> (LPVOID) &SetBuffer[0],
> 0,
> &dwBytesReturned,
> NULL))
> {
>
> long m_dwError = GetLastError();
>
> TCHAR szOut[64];
> wsprintf(szOut, TEXT("Can Not add WEP: %d" ),m_dwError );
> MessageBox(0,szOut,TEXT("ERROR" ),MB_OK);
> return FALSE;
> }
>
>
>
> return TRUE;
> }
>
>
> Does anyone know what is wrong with my code? I haven't been stuck here for
> a couple of days...
>
> Thanks,
>
> Eric
>
>
Archived from groups: microsoft.public.platformsdk.networking,microsoft.public.pocketpc.developer,microsoft.public.windows.networking.wireless (More info?)
One reason might be that Pocket PC 2002 doesn't have native support for WEP
or Wireless Zero Config.
David
------
This posting is provided "AS IS" with no warranties, and confers no rights.
"Pavel A." <pavel_a@geeklife.com> wrote in message
news:eCKkLBVkEHA.1048@tk2msftngp13.phx.gbl...
> "Eric Yun" <anonymous@discussions.microsoft.com> wrote in message
newspFFl4TkEHA.784@TK2MSFTNGP15.phx.gbl...
> > hi everyone,
> >
> > I am working on a project. One part of this project is force the
wireless
> > network adapter to connect to an access point.
>
> WinCE has the wireless config service that does this automagically.
> Why to reinvent the wheel.
You are about to answer a thread that has been inactive for more than 6 months. If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.