We help IT Professionals succeed at work.

How to set the Wireless Key and access the Wireless Access point.

ravi_pvkumar asked
Last Modified: 2013-12-09

We are facing the problem to access the Wireless Router, we are using the D-Link router.
We are able to Enumerate the device and also able to retrieve the list of AP's.  We need to access the router using the SSID and Wireless key as the inputs and we are failing to do so.
steps followed are:
1.net stop ndisuio - asks for stopping wzc serivce and we stopped it.
2.net start ndisuio
and excuting following program.

WRAPI_NDIS_DEVICE            *pDeviceList = NULL;
      HRESULT                        hRes;
      long                        lItems = 0;
      long                        lNumItems = 0;
      UCHAR                        Ssid[32] = {0};
      AP_DATA                        *pAP_list = NULL;
      CHAR                        *pSSId

      ULONG                        lSSIdLength = strlen(pSSId);
      ULONG                        lRTSThresh = 0;
      MAC_ADDR                  addr = {0};
      DOT_11_STATS                  DOT11Stats;

      // Get the list of Devices in the System
      hRes = WRAPIEnumerateDevices(&pDeviceList, &lItems);

      // Print the list of devices obtained
      for ( int i = 0; i < lItems; i++)
            printf("%ws\n  - %ws\n", pDeviceList[i].pDeviceDescription, pDeviceList[i].pDeviceName);

      // Open the device at pDeviceList[1] -- pDeviceList[0] happens to be the        * Ethernet Interface
      hRes = WRAPIOpenNdisDevice(pDeviceList[0].pDeviceName);
      int mymode;


      // Get the value of RTS Threshold
      hRes = WRAPIGetRTSThreshold(&lRTSThresh);
      // Get the MAC address of the AP to which this station is associated
      // Get Packet-level statistics from the 802.11 interface
      hRes = WRAPIGetPacketStats(&DOT11Stats);

      // Get a list of all APs within range of this station in a list of AP_DATA
       // structures
      hRes = WRAPIGetAPList(&pAP_list, &lNumItems);

      // Print out the list of all APs and their signal strengths

      printf("MAC Address \t\tSignal Strength (dBm) \n");

      for ( i = 0; i < lNumItems; i++ )
            for ( int j = 0; j < 6; j++)
                  printf("%02x", pAP_list[i].mac_addr[j]);

            printf("\t\t%d\n", pAP_list[i].Rssi);

      // Print out the list of all APs and their signal strengths

      printf("MAC Address \t\tSignal Strength (dBm) \n");

      for ( i = 0; i < lNumItems; i++ )
            for ( int j = 0; j < 6; j++)
                  printf("%02x", pAP_info[i].mac_addr[j]);

            printf("\t\t%d\t%s\n", pAP_info[i].Rssi, pAP_info[i].Ssid.Ssid);
            MAC_ADDR mac_addr;
            for ( int j = 0; j < 6; j++)

      ///Setting Infrastructure mode
      int mynetworkmode;

      ///Set WEP Wnable
      ///////Set Wep Key
      UCHAR mykey[]="abcdefghijklm";
      WCHAR wkey[13];

/////Set Associate AP
            MAC_ADDR mac_addr;
            for ( int j = 0; j < 6; j++)
      // Free all the memory that gets allocated inside the WRAPI dll

      for (i = 0; i < lItems; i++ )


      return 0;

can anybody help us to access the router using the SSID and Wireless Key we are using WRAPI.dll as a reference.
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.