Problem configuring wireless card (setting SSID and other params)

Discussion in 'Wireless Networking' started by Serhiy Smirnov, Mar 6, 2005.

  1. Hello,

    I'm trying to configure my 802.11g wireless network card using
    DeviceIoControl and NDISUIO interface.

    First, I request current SSID from the card. Then I set it to my
    specific value using code below. Set operation returns success. And
    then I request SSID again to verify if the set operation really
    succeeded. But I get the same values as it was before my SET, so
    network card doesn't switch to new SSID. The same situation if I try
    to change infrastructure mode (OID_802_11_INFRASTRUCTURE_MODE) and
    configuration (OID_802_11_CONFIGURATION). Trying to do
    OID_802_11_DISASSOCIATE before sending or requesting any data returns
    success too but doesn't help.
    My be I'm missing some obvious things (wait, reset, additional
    operations)?

    Configuring card with manufacturer's utility works fine, howewer.

    I know about the issue that NDISUIO is now reserved for use by
    Windows, but with my own driver (derived from NDISUIO sample)
    situation is the same.
    Tested on systems with WinXP SP1 and SP2. WZC is turned off.

    Any siggestions, links, etc would be highly appreciated!

    TIA,
    Serhiy


    requesting SSID value:
    ---------------------

    UCHAR QueryBuffer[sizeof(NDISUIO_QUERY_OID) +
    sizeof(NDIS_802_11_SSID)];
    PNDISUIO_QUERY_OID pQueryOid;

    pQueryOid = (PNDISUIO_QUERY_OID)&QueryBuffer[0];
    pQueryOid->Oid = OID_802_11_SSID;

    bSuccess = (BOOLEAN)DeviceIoControl(Handle,
    IOCTL_NDISUIO_QUERY_OID_VALUE,
    (LPVOID)&QueryBuffer[0], sizeof(QueryBuffer),
    (LPVOID)&QueryBuffer[0], sizeof(QueryBuffer),
    &BytesReturned, NULL);

    setting SSID value:
    ---------------------

    UCHAR SetBuffer[sizeof(NDISUIO_SET_OID) - sizeof(ULONG) +
    sizeof(NDIS_802_11_SSID)];
    PNDISUIO_SET_OID pSetOid;

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

    PNDIS_802_11_SSID psSSID = (PNDIS_802_11_SSID)pSetOid->Data;
    psSSID->SsidLength = strlen((char *)pSrcSSID);
    memcpy(psSSID->Ssid, pSrcSSID, psSSID->SsidLength);

    bSuccess = (BOOLEAN)DeviceIoControl(Handle,
    IOCTL_NDISUIO_SET_OID_VALUE,
    (LPVOID)&SetBuffer[0], sizeof(SetBuffer),
    NULL, 0,
    &BytesReturned, NULL);
     
    Serhiy Smirnov, Mar 6, 2005
    #1
    1. Advertising

  2. At least, Disassociate should work.
    So you might be doing something wrong - in our business every single bit
    matters...

    --PA

    "Serhiy Smirnov" wrote:
    > Hello,
    >
    > I'm trying to configure my 802.11g wireless network card using
    > DeviceIoControl and NDISUIO interface.
    >
    > First, I request current SSID from the card. Then I set it to my
    > specific value using code below. Set operation returns success. And
    > then I request SSID again to verify if the set operation really
    > succeeded. But I get the same values as it was before my SET, so
    > network card doesn't switch to new SSID. The same situation if I try
    > to change infrastructure mode (OID_802_11_INFRASTRUCTURE_MODE) and
    > configuration (OID_802_11_CONFIGURATION). Trying to do
    > OID_802_11_DISASSOCIATE before sending or requesting any data returns
    > success too but doesn't help.
    > My be I'm missing some obvious things (wait, reset, additional
    > operations)?
    >
    > Configuring card with manufacturer's utility works fine, howewer.
    >
    > I know about the issue that NDISUIO is now reserved for use by
    > Windows, but with my own driver (derived from NDISUIO sample)
    > situation is the same.
    > Tested on systems with WinXP SP1 and SP2. WZC is turned off.
    >
    > Any siggestions, links, etc would be highly appreciated!
    >
    > TIA,
    > Serhiy
    >
    >
    > requesting SSID value:
    > ---------------------
    >
    > UCHAR QueryBuffer[sizeof(NDISUIO_QUERY_OID) +
    > sizeof(NDIS_802_11_SSID)];
    > PNDISUIO_QUERY_OID pQueryOid;
    >
    > pQueryOid = (PNDISUIO_QUERY_OID)&QueryBuffer[0];
    > pQueryOid->Oid = OID_802_11_SSID;
    >
    > bSuccess = (BOOLEAN)DeviceIoControl(Handle,
    > IOCTL_NDISUIO_QUERY_OID_VALUE,
    > (LPVOID)&QueryBuffer[0], sizeof(QueryBuffer),
    > (LPVOID)&QueryBuffer[0], sizeof(QueryBuffer),
    > &BytesReturned, NULL);
    >
    > setting SSID value:
    > ---------------------
    >
    > UCHAR SetBuffer[sizeof(NDISUIO_SET_OID) - sizeof(ULONG) +
    > sizeof(NDIS_802_11_SSID)];
    > PNDISUIO_SET_OID pSetOid;
    >
    > pSetOid = (PNDISUIO_SET_OID)&SetBuffer[0];
    > pSetOid->Oid = OID_802_11_SSID;
    >
    > PNDIS_802_11_SSID psSSID = (PNDIS_802_11_SSID)pSetOid->Data;
    > psSSID->SsidLength = strlen((char *)pSrcSSID);
    > memcpy(psSSID->Ssid, pSrcSSID, psSSID->SsidLength);
    >
    > bSuccess = (BOOLEAN)DeviceIoControl(Handle,
    > IOCTL_NDISUIO_SET_OID_VALUE,
    > (LPVOID)&SetBuffer[0], sizeof(SetBuffer),
    > NULL, 0,
    > &BytesReturned, NULL);
    >
     
    =?Utf-8?B?UGF2ZWwgQS4=?=, Mar 7, 2005
    #2
    1. Advertising

  3. Additional advice : Check in debugger ( windbg e.g.) if you send the same
    data as WZC to Ndisuio
    Arkady

    "Pavel A." <> wrote in message
    news:...
    > At least, Disassociate should work.
    > So you might be doing something wrong - in our business every single bit
    > matters...
    >
    > --PA
    >
    > "Serhiy Smirnov" wrote:
    >> Hello,
    >>
    >> I'm trying to configure my 802.11g wireless network card using
    >> DeviceIoControl and NDISUIO interface.
    >>
    >> First, I request current SSID from the card. Then I set it to my
    >> specific value using code below. Set operation returns success. And
    >> then I request SSID again to verify if the set operation really
    >> succeeded. But I get the same values as it was before my SET, so
    >> network card doesn't switch to new SSID. The same situation if I try
    >> to change infrastructure mode (OID_802_11_INFRASTRUCTURE_MODE) and
    >> configuration (OID_802_11_CONFIGURATION). Trying to do
    >> OID_802_11_DISASSOCIATE before sending or requesting any data returns
    >> success too but doesn't help.
    >> My be I'm missing some obvious things (wait, reset, additional
    >> operations)?
    >>
    >> Configuring card with manufacturer's utility works fine, howewer.
    >>
    >> I know about the issue that NDISUIO is now reserved for use by
    >> Windows, but with my own driver (derived from NDISUIO sample)
    >> situation is the same.
    >> Tested on systems with WinXP SP1 and SP2. WZC is turned off.
    >>
    >> Any siggestions, links, etc would be highly appreciated!
    >>
    >> TIA,
    >> Serhiy
    >>
    >>
    >> requesting SSID value:
    >> ---------------------
    >>
    >> UCHAR QueryBuffer[sizeof(NDISUIO_QUERY_OID) +
    >> sizeof(NDIS_802_11_SSID)];
    >> PNDISUIO_QUERY_OID pQueryOid;
    >>
    >> pQueryOid = (PNDISUIO_QUERY_OID)&QueryBuffer[0];
    >> pQueryOid->Oid = OID_802_11_SSID;
    >>
    >> bSuccess = (BOOLEAN)DeviceIoControl(Handle,
    >> IOCTL_NDISUIO_QUERY_OID_VALUE,
    >> (LPVOID)&QueryBuffer[0], sizeof(QueryBuffer),
    >> (LPVOID)&QueryBuffer[0], sizeof(QueryBuffer),
    >> &BytesReturned, NULL);
    >>
    >> setting SSID value:
    >> ---------------------
    >>
    >> UCHAR SetBuffer[sizeof(NDISUIO_SET_OID) - sizeof(ULONG) +
    >> sizeof(NDIS_802_11_SSID)];
    >> PNDISUIO_SET_OID pSetOid;
    >>
    >> pSetOid = (PNDISUIO_SET_OID)&SetBuffer[0];
    >> pSetOid->Oid = OID_802_11_SSID;
    >>
    >> PNDIS_802_11_SSID psSSID = (PNDIS_802_11_SSID)pSetOid->Data;
    >> psSSID->SsidLength = strlen((char *)pSrcSSID);
    >> memcpy(psSSID->Ssid, pSrcSSID, psSSID->SsidLength);
    >>
    >> bSuccess = (BOOLEAN)DeviceIoControl(Handle,
    >> IOCTL_NDISUIO_SET_OID_VALUE,
    >> (LPVOID)&SetBuffer[0], sizeof(SetBuffer),
    >> NULL, 0,
    >> &BytesReturned, NULL);
    >>
     
    Arkady Frenkel, Mar 7, 2005
    #3
    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. Replies:
    6
    Views:
    16,047
    Sooner Al [MVP]
    Aug 18, 2005
  2. =?Utf-8?B?cmNi?=

    Preferred SSID - Hidden SSID

    =?Utf-8?B?cmNi?=, Sep 7, 2005, in forum: Wireless Networking
    Replies:
    4
    Views:
    3,467
  3. =?Utf-8?B?QXZuaXNo?=

    Getting SSIDs list and Setting SSID on adapter

    =?Utf-8?B?QXZuaXNo?=, Feb 2, 2006, in forum: Wireless Networking
    Replies:
    1
    Views:
    795
    Alan White
    Feb 4, 2006
  4. =?Utf-8?B?bXJ3b25n?=

    SSID called HOME even though I have configured another SSID

    =?Utf-8?B?bXJ3b25n?=, Mar 26, 2006, in forum: Wireless Networking
    Replies:
    0
    Views:
    650
    =?Utf-8?B?bXJ3b25n?=
    Mar 26, 2006
  5. Joseph

    Setting up SSID and Password

    Joseph, Jul 4, 2009, in forum: Wireless Networking
    Replies:
    2
    Views:
    3,091
    Jack [MVP]
    Jul 5, 2009
Loading...

Share This Page