problems with setting ssid

Discussion in 'Windows Vista Drivers' started by william wang, Nov 23, 2004.

  1. william wang

    william wang Guest

    some one said it need 3 steps
    :

    1. Set Authentication Mode (0 for Open)
    2. Set Infrastructure Mode (1 for Infrastructure)
    3. Set SSID
    when i set Authentication Mode , i meet the problem that i can't succeed to
    call DeviceIoControl, i get the last error ,
    it equals 1.
    following is my code:

    WCHAR wszPathName[MAX_PATH] = {0};
    HANDLE hDevice = NULL;
    DWORD dwOID = OID_802_11_AUTHENTICATION_MODE;
    PBYTE pByte = NULL;
    NDIS_802_11_AUTHENTICATION_MODE aMode = Ndis802_11AuthModeOpen;
    NDISUIO_SET_OID * pSetOid;
    WCHAR wszPnpDeviceID[MAX_PATH] =
    {L"USB\\VID_2821&PID_0161\\5&3AD090D&0&1"};
    UCHAR SetBuffer[sizeof(NDIS_OID) +
    sizeof(NDIS_802_11_AUTHENTICATION_MODE)];
    pSetOid = (NDISUIO_SET_OID *)SetBuffer;
    pSetOid->Oid = dwOID;
    memcpy(pSetOid->Data, &aMode, sizeof(NDIS_802_11_AUTHENTICATION_MODE));
    if (!GetPathName(wszPnpDeviceID, wszPathName))
    return FALSE;
    hDevice = CreateFile(wszPathName,
    FILE_ALL_ACCESS,
    0,
    NULL,
    OPEN_EXISTING,
    0,
    NULL);
    if (hDevice == NULL)
    return FALSE;
    BOOL fSucceed = FALSE;
    DWORD dwSize = sizeof(SetBuffer);
    fSucceed = DeviceIoControl(hDevice,
    IOCTL_NDISUIO_SET_OID_VALUE,
    (LPVOID)SetBuffer,
    sizeof(SetBuffer),
    (LPVOID)SetBuffer,
    0,
    NULL,
    NULL);
     
    william wang, Nov 23, 2004
    #1
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.