Hello all,
This is a follow-up to my question “Connecting to EAP WiFi network”. I managed to connect successfully using the built-in network configuration window of the OS and with Connection Manager active (as suggested by sahil.tx in that thread). However, what we really need is a solution for Native WiFi and that requires Connection Manager to be disabled.
I copied the Configuration Profile XML file (from when I got a successful connection above) and used this as parameter for WlanSetProfile. I then copied the code from GetEapUserCredProfileXml() in \WINCE700\public\wceshellfe\oak\CtlPnl2\XmlCpls\WiFi\wifinetworklist.cpp to generate the EapUser XML profile.
So now I have a configuration profile with a “ConfigBlob” (instead of “Config”) node and a user profile with a “CredentialsBlob” (instead of “Credentials”) node. Using those profiles, WlanSetProfile() and WlanSetProfileEapXmlUserData() return without errors.
However, I still could not get a successful connection after calling WlanConnect(). I registered for Wlan notifications and I got the ff:
wlan_notification_acm_profile_change
wlan_notification_acm_scan_complete
wlan_notification_acm_network_available
wlan_notification_acm_connection_start
wlan_notification_msm_associated
wlan_notification_msm_authenticating
OneXNotificationTypeResultUpdate
ONEX_RESULT_UPDATE_DATA.oneXStatus.authStatus : OneXAuthInProgress
ONEX_RESULT_UPDATE_DATA.oneXStatus.dwError : 0 [0x00000000]
ONEX_RESULT_UPDATE_DATA.oneXStatus.dwReason : ONEX_REASON_CODE_SUCCESS
ONEX_RESULT_UPDATE_DATA.BackendSupport : OneXEapMethodBackendSupportUnknown
ONEX_RESULT_UPDATE_DATA.fBackendEngaged : FALSE
ONEX_RESULT_UPDATE_DATA.fOneXAuthParams : [0x00000000]
ONEX_RESULT_UPDATE_DATA.fEapError : [0x00000000]
OneXNotificationTypeResultUpdate
ONEX_RESULT_UPDATE_DATA.oneXStatus.authStatus : OneXAuthFailure
ONEX_RESULT_UPDATE_DATA.oneXStatus.dwError : 2147500037 [0x80004005]
ONEX_RESULT_UPDATE_DATA.oneXStatus.dwReason : ONEX_EAP_FAILURE_RECEIVED
ONEX_RESULT_UPDATE_DATA.BackendSupport : OneXEapMethodBackendSupportUnknown
ONEX_RESULT_UPDATE_DATA.fBackendEngaged : FALSE
ONEX_RESULT_UPDATE_DATA.fOneXAuthParams : [0x00000001]
ONEX_RESULT_UPDATE_DATA.authParams.dwSize : 292 [0x00000124]
ONEX_RESULT_UPDATE_DATA.authParams.dwOffset : 40 [0x00000028]
ONEX_AUTH_PARAMS.fUpdatePending : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.dwVersion : 1 [0x00000001]
ONEX_AUTH_PARAMS.oneXConnProfile.dwTotalLen : 192 [0x000000C0]
ONEX_AUTH_PARAMS.oneXConnProfile.fOneXSupplicantFlags : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fsupplicantMode : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fauthMode : TRUE
ONEX_AUTH_PARAMS.oneXConnProfile.fHeldPeriod : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fAuthPeriod : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fStartPeriod : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fMaxStart : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fMaxAuthFailures : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fNetworkAuthTimeout : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fAllowLogonDialogs : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fNetworkAuthWithUITimeout : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.fUserBasedVLan : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.dwOneXSupplicantFlags : 0 [0x00000000]
ONEX_AUTH_PARAMS.oneXConnProfile.supplicantMode : UNKNOWN
ONEX_AUTH_PARAMS.oneXConnProfile.authMode : OneXAuthModeUserOnly
ONEX_AUTH_PARAMS.oneXConnProfile.dwHeldPeriod : 4294967295 [0xFFFFFFFF]
ONEX_AUTH_PARAMS.oneXConnProfile.dwAuthPeriod : 4294967295 [0xFFFFFFFF]
ONEX_AUTH_PARAMS.oneXConnProfile.dwStartPeriod : 4294967295 [0xFFFFFFFF]
ONEX_AUTH_PARAMS.oneXConnProfile.dwMaxStart : 4294967295 [0xFFFFFFFF]
ONEX_AUTH_PARAMS.oneXConnProfile.dwMaxAuthFailures : 4294967295 [0xFFFFFFFF]
ONEX_AUTH_PARAMS.oneXConnProfile.dwNetworkAuthTimeout : 0 [0x00000000]
ONEX_AUTH_PARAMS.oneXConnProfile.dwNetworkAuthWithUITimeout : 0 [0x00000000]
ONEX_AUTH_PARAMS.oneXConnProfile.bAllowLogonDialogs : FALSE
ONEX_AUTH_PARAMS.oneXConnProfile.bUserBasedVLan : FALSE
ONEX_AUTH_PARAMS.authIdentity : OneXAuthIdentityUser
ONEX_AUTH_PARAMS.dwQuarantineState : ISOLATION_STATE_UNKNOWN
ONEX_AUTH_PARAMS.fSessionId : TRUE
ONEX_AUTH_PARAMS.fhUserToken : TRUE
ONEX_AUTH_PARAMS.fOnexUserProfile : TRUE
ONEX_AUTH_PARAMS.fIdentity : FALSE
ONEX_AUTH_PARAMS.fUserName : TRUE
ONEX_AUTH_PARAMS.fDomain : TRUE
ONEX_AUTH_PARAMS.dwSessionId : 0 [0x00000000]
ONEX_AUTH_PARAMS.hUserToken : 0 [0x00000000]
ONEX_AUTH_PARAMS.Identity : INVALID
ONEX_AUTH_PARAMS.UserName : WmUser
ONEX_AUTH_PARAMS.Domain : WmDomain
ONEX_RESULT_UPDATE_DATA.fEapError : [0x00000000]
wlan_notification_msm_disconnected
wlan_notification_acm_connection_attempt_fail
wlan_notification_acm_connection_complete
wlan_notification_acm_scan_complete
wlan_notification_acm_network_available
wlan_notification_acm_scan_complete
wlan_notification_acm_network_available
It is worth noting that I get the same exact notification data even if I don’t call WlanSetProfileEapXmlUserData(). So it seems as if WlanSetProfileEapXmlUserData() didn’t do anything even though it returned a SUCCESS value.
I am not so sure what the actual configuration parameters are because the XML file I copied already has “ConfigBlob” instead of “Config” and I could not find any way to decode it. I am a bit confident that the User Profile fits the configuration, though, because I set the EapType to 25 (PEAP) and used the same credentials (username, password, no-domain) when generating the “CredentialsBlob” as when I connected manually (through the Network-configuration window).
Another thing worth noting is that on the RADIUS server, I don’t see any activity (I’m using FreeRADIUS.net with DEBUG mode) so the request is not reaching the server at all.
Am I missing a step? Is it possible to use purely Native WiFi calls to connect or is there a need to use other APIs (e.g. EapHost API)?
Under normal WIndows (Win7, Win10), I could successfully connect using the WlanSetProfile - WlanSetProfileEapXmlUserData() - WlanConnect() procedure.