WlanSetProfile() returns "Element Not Found"

I am working with the Vista 802.11 Auto Configuration APIs for my UI. (Vista Beta 2, Build 5308)

When I call WlanSetProfile() with the parameter, bOverWrite = TRUE, and my XML profile is as following, the API returns 1168, Element not Found. But the Reason Code output by the API is "The operation succeeds".

And, when I call this API with bOverWrite=FALSE, the API returns 87, ERROR_INVALID_PARAMETER.

Is my XML profile format incorrect Or Is this API ready to be used or not

Any suggestions or ideas for this issue Appreciate!

< xml version="1.0" >
 <WLANProfile xmlns=http://www.microsoft.com/networking/WLAN/profile/v1>
  <name>Profile TEST</name>
  <SSIDConfig>
   <SSID>
    <name>Profile TEST</name>
   </SSID>
   <nonBroadcast>false</nonBroadcast>
  </SSIDConfig>
  <connectionType>ESS</connectionType>
  <connectionMode>manual</connectionMode>
  <MSM>
   <security>
    <authEncryption>
     <authentication>open</authentication>
     <encryption>none</encryption>
     <useOneX>false</useOneX>
    </authEncryption>
   </security>
  </MSM>
 </WLANProfile>

 



Answer this question

WlanSetProfile() returns "Element Not Found"

  • tr_sreedhar

    sorry i cannot able to post the code. Because, the code belongs from company confidential properties. But i can suggest you to see the SDK wlan auto config samples available in windows vista SDK. it is also working. it is supporting most of the features what autoconfig supports.
  • Shirvo

    Where did you find them

    Tank you


  • Anand Raman - MSFT

    I have another problem - I'm using Windows XP SP2 with (KB918997) for NativeWiFi, how way I can create new profile I can connect using this api I have found nothing about new profile creation. What I have use for this

    Thanks.



  • SelvaVenkatesh

    Could you please post the code to create a profile on Vista

    Thanks



  • yog_23

    Hi

    I am trying to use the WlanSetProfile API and repeatedly getting return error - ERROR_INVALID_PARAMETER.

    The profile xml which I am using is shown below:

    < xml version="1.0" >

    <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">

    <name>emac</name>

    <SSIDConfig>

    <SSID>

    <name>emac</name>

    </SSID>

    </SSIDConfig>

    <connectionType>ESS</connectionType>

    <MSM>

    <security>

    <authEncryption>

    <authentication>open</authentication>

    <encryption>none</encryption>

    <useOneX>false</useOneX>

    <PMKCacheMode>disabled</PMKCacheMode>

    <preAuthMode>disabled</preAuthMode>

    </authEncryption>

    </security>

    </MSM>

    </WLANProfile>

    The code I am using to set the profile is shown below:

    dwError = WlanSetProfile(m_WlanManager.GetWlanHandle(),&(pCurrentInterface->m_Guid), 0, bstrXml, NULL, TRUE, NULL, &dwReason);

    I am using Windows Vista Beta 2 - Build 5308.

    Can anyone kindly let me know, where am I going wrong

    Regards

    Simer



  • pangitko79

    Will wLanSetProfile work on Visual studio 6.0. Do we need any sdk other than vista sdk

  • LouArnold

    Thank you! I found the sample..



  • cdun2

    Hi burton_doggy,

    i think nothing wrong in your xml profile. I successfully created xml profile and can able to connect to ssid also using same vista build. Please check your code, handle and your login user. Because as of Native wifi permission document, only users from administrators group and Network configurators group can invoke Auto config API's without fail by default. Check your permissions.API's are successfully working for WEP and 802.1x protocols also. I would like to know anybody is succeeded with wlan software radio control( ON and OFF). One of Microsoft document says same Auto config api's will work for ethernet profiles. Anybody succeeded with that. please let me know. You can also work with recent beta2 vista build 5384. All api's are working with that. All the best.


  • Yuemingzhang

    Try this :

    dwError = WlanSetProfile(m_WlanManager.GetWlanHandle(),&(pCurrentInterface->m_Guid), WLAN_PROFILE_USER, bstrXml, NULL, TRUE, NULL, &dwReason);




  • elemr

    Hi

    if you are having a vista machine, hope you can build your SDK samples from command line using MSBUILD command. this application is available in C:\windows directory. Exact path i am not remembering. I don't know what about VC 6.0. In VS.Net 2003, if you want to run vista sdk sample code, you have to change include directory list. See the release documentation for vista SDK. All the best.


  • WlanSetProfile() returns "Element Not Found"