Search code examples
c++windowsfirebreath

FireBreath WlanOpenHandle Error 1062 "The service has not been started"


In my FireBreath plugin I am trying to determine Wifi SSID and/or scan for visible Wifi access points.

In the Windows portion of the code this entails starting with the following:

dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);

Unfortunately, dwResult is always returning: 1062, which translates to "The service has not been started" (via FormatMessage()).

I have tried running in the main thread as well as in a boost thread started as follows:

boost::thread t(boost::bind(&LaasTechAPI::doSomethingTimeConsuming_thread, this, num, callback));

The error 1062 is the same regardless.

(Incidentally, I implemented the thread methodology because a. Internet search indicates some sort of an ATL/MTL 'apartment' threading issue and b. Wifi scan is known to be an inherently slow asynchronous endeavor, so threading seemed necessary all along)

Can anyone tell me how to solve this WlanOpenHandle error 1062 issue?


Secondary:

  • Can you tell me a more reliable way to scan for Wifi SSID, BSSID, and signal strengths of the local access points in Windows?
  • I must also gather Wifi info for OS X. So, if you know of a Mac or multi-platform solution for the Wifi scan, please share.

Thank you!


Solution

  • How to Start Windows Zero Configuration Service (WZC)

    This will solve Windows Error 1062: "The service has not been started".

    I think you should look more closely at @Georg's comment and verify that WZC is started. Here is the relevant text from the remarks section at his link: http://msdn.microsoft.com/en-us/library/windows/desktop/ms706759(v=vs.85).aspx

    WlanOpenHandle will return an error message if the Wireless Zero Configuration (WZC) service has not been started or if the WZC service is not responsive.

    Enable the services in a Windows Command Prompt (DOS):

    > net start wzcsvc
    

    Or, type:

    > sc config wzcsvc start= <boot|system|auto|demand|disabled|delayed-auto>
    

    Help message:

    > sc config /?
    

    Or, open the Services app:

    > services.msc