Native WiFi function 'WlanSetProfileEapXmlUserData' returns an error when attempting to set credenti

Discussion in 'Wireless Networking' started by Brendan Haddock, Jul 1, 2008.

  1. I am trying to use the Native WiFi API on Windows Vista to connect to
    an access point via WPA2 using PEAPv0/EAP-MSCHAPv2. I can connect to the
    access point via the API just fine when Windows automatically uses my
    Windows account user credentials for the authentication. However, when I
    try to specifically set my credentials using WlanSetProfileEapXmlUserData,
    the function returns error 127. Also, in the debugger output window, the
    following line appears after calling the function:

    First-chance exception at 0x762242eb in Wireless Utility.exe:
    Microsoft C++ exception: EapHost::EapException at memory location
    0x020cf140..

    I am using the following xml for my credentials in the function. Is
    there something wrong with my xml? What else could be causing the error?

    <?xml version="1.0" ?>
    <EapHostUserCredentials
    xmlns="http://www.microsoft.com/provisioning/EapHostUserCredentials"
    xmlns:eapCommon="http://www.microsoft.com/provisioning/EapCommon"
    xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapMethodUserCredentials">
    <EapMethod>
    <eapCommon:Type>25</eapCommon:Type>
    <eapCommon:AuthorId>0</eapCommon:AuthorId>
    </EapMethod>
    <Credentials
    xmlns:eapUser="http://www.microsoft.com/provisioning/EapUserPropertiesV1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapUserPropertiesV1"
    xmlns:MsPeap="http://www.microsoft.com/provisioning/MsPeapUserPropertiesV1"
    xmlns:MsChapV2="http://www.microsoft.com/provisioning/MsChapV2UserPropertiesV1">
    <baseEap:Eap>
    <baseEap:Type>25</baseEap:Type>
    <MsPeap:EapType>

    <MsPeap:RoutingIdentity>bhaddock</MsPeap:RoutingIdentity>
    <baseEap:Eap>
    <baseEap:Type>26</baseEap:Type>
    <MsChapV2:EapType>
    <MsChapV2:Username>bhaddock</MsChapV2:Username>
    <MsChapV2:password>test</MsChapV2:password>
    <MsChapV2:LogonDomain>CP</MsChapV2:LogonDomain>
    </MsChapV2:EapType>
    </baseEap:Eap>
    </MsPeap:EapType>
    </baseEap:Eap>
    </Credentials>
    </EapHostUserCredentials>

    Here is a copy of the xml for the WPA2 with PEAP profile I've created
    using WlanSetProfile:

    <?xml version="1.0"?>
    <WLANProfile
    xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
    <name>MBR-3a8</name>
    <SSIDConfig>
    <SSID>
    <name>MBR-3a8</name>
    </SSID>
    </SSIDConfig>
    <connectionType>ESS</connectionType>
    <MSM>
    <security>
    <authEncryption>
    <authentication>WPA2</authentication>
    <encryption>TKIP</encryption>
    <useOneX>true</useOneX>
    </authEncryption>
    <OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
    <EAPConfig>
    <EapHostConfig
    xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
    <EapMethod>
    <Type
    xmlns="http://www.microsoft.com/provisioning/EapCommon">25</Type>
    <AuthorId
    xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId>
    </EapMethod>
    <ConfigBlob/>
    </EapHostConfig>
    </EAPConfig>
    </OneX>
    </security>
    </MSM>
    </WLANProfile>

    Thanks for your help. I need to be able to allow the user to change
    their credentials using the utility I am writing, but I haven't been able to
    figure out what is causing this issue.

    Best Regards,

    Brendan

    am
    Brendan Haddock, Jul 1, 2008
    #1
    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. Robert Gordon
    Replies:
    0
    Views:
    452
    Robert Gordon
    Aug 25, 2005
  2. URSUS
    Replies:
    0
    Views:
    2,603
    URSUS
    Oct 10, 2004
  3. Nelson Guerrero

    problem with WlanSetProfileEapXmlUserData

    Nelson Guerrero, Jun 6, 2007, in forum: Wireless Networking
    Replies:
    0
    Views:
    522
    Nelson Guerrero
    Jun 6, 2007
  4. Nelson Guerrero

    wlanapi - WlanSetProfileEapXmlUserData

    Nelson Guerrero, Jun 13, 2007, in forum: Wireless Networking
    Replies:
    0
    Views:
    843
    Nelson Guerrero
    Jun 13, 2007
  5. Chander
    Replies:
    0
    Views:
    1,422
    Chander
    Dec 20, 2007
Loading...

Share This Page