WEP not able to set ..

Discussion in 'Wireless Networking' started by deepikasood30@gmail.com, Feb 10, 2006.

  1. Guest

    hi
    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 Infrastructure Mode (1 Ndis802_11Infrastructure)

    2.Set Authentication Mode (Ndis802_11AuthModeShared)
    3. Set WEP Key OID_802_11_ADD_WEP

    4. Enable WEP
    5. Set BSSID
    (also tried with different sequence many times)
    HRESULT SetWEPKey(PNDIS_802_11_WEP pDOT11Wep)
    {
    UCHAR SetBuffer[sizeof(NDIS_OID) +
    sizeof(NDIS_802_11_WEP)];
    PNDISUIO_SET_OID pSetOid;
    m_hRes = S_OK;

    pSetOid = (PNDISUIO_SET_OID) &SetBuffer[0];
    pSetOid->Oid = OID_802_11_ADD_WEP;



    memcpy(&pSetOid->Data[0], (LPVOID) pDOT11Wep,
    sizeof(NDIS_802_11_WEP));

    if (!DeviceIoControl(m_hFileHandle,
    IOCTL_NDISUIO_SET_OID_VALUE,
    (LPVOID)&SetBuffer[0],
    sizeof(SetBuffer),
    (LPVOID) &SetBuffer[0],
    sizeof(SetBuffer),
    &m_dwBytesReturned,
    NULL))
    {
    m_dwError = GetLastError();
    printf("IOCTL SET_CONFIGURATION failed: %d\n", m_dwError);
    m_hRes = E_FAIL;
    }


    return m_hRes;
    }


    /*******************************************************************/

    WepKey = (NDIS_802_11_WEP *) calloc(1, (sizeof(NDIS_802_11_WEP) +
    5));
    // Set the Wep Key
    // Initialize the Wep Key
    // strcpy(sWepKey,"aaaaa");
    sWepKey[0]=0x11;
    sWepKey[1]=0x11;
    sWepKey[2]=0x11;
    sWepKey[3]=0x11;
    sWepKey[4]=0x11;

    WepKey->KeyIndex = 0x80000000;
    WepKey->KeyLength = sizeof(sWepKey);
    memset(WepKey->KeyMaterial,0,WepKey->KeyLength);
    memcpy(WepKey->KeyMaterial,sWepKey,WepKey->KeyLength);

    WepKey->Length = 17;
    // memset(WepKey.KeyMaterial,0,sizeof(WepKey.KeyMaterial));
    // memcpy(WepKey.KeyMaterial, KeyMaterial, WepKey.KeyLength);
    // WepKey.Length = sizeof(WepKey);
    a=sizeof(NDIS_802_11_WEP);
    //***************************
    hRes = SetWEPKey(WepKey);
    if (hRes == E_FAIL)
    printf("Failed to set the WEP Key");

    my functions are all giving success....can any one pls tell me what is
    the problem in settin 64 bit ie 10 hex value wep key to connect to the
    ap.
    i am also configuring ap as enable wep ,mode shared authentication,64
    bit wep
    and key as 1111111111
    this is very important for me...pls some one put light on my problem
     
    , Feb 10, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anderas Klein

    Re: Cannot set 128bit WEP Key for Compaq W200?

    Anderas Klein, Jul 23, 2004, in forum: Wireless Networking
    Replies:
    2
    Views:
    2,415
    aerickey
    Jul 29, 2009
  2. Me

    Not able to set up faxing in XP

    Me, Aug 9, 2003, in forum: Computer Support
    Replies:
    2
    Views:
    797
  3. Johnny
    Replies:
    11
    Views:
    3,148
    Cerebrus
    Aug 4, 2006
  4. kharnal
    Replies:
    1
    Views:
    692
    Malke
    Jan 11, 2007
  5. ufdragon
    Replies:
    0
    Views:
    1,459
    ufdragon
    Mar 30, 2012
Loading...

Share This Page