WlanGetProfileList native api is working as expected until the device restarts. Once the device restart the result of the same api is empty. But still I can see the created profiles under registry values of Windows Compact OS.
For enabling wifi functionality in WINCE7 I used WLANTOOL. Below is the code from wlantool to get list of profiles created.
BOOL WlanInterfaces::ListProfileList(LPCWSTR strAdapter)
{
BOOL bResult = FALSE;
DWORD dwError = ERROR_SUCCESS;
PWLAN_PROFILE_INFO_LIST pProfileList = NULL;
do
{
if(FALSE == Init())
break;
WLAN_INTERFACE_INFO* pInterface = NULL;
if(!GetInterface(strAdapter,&pInterface))
break;
dwError = WlanGetProfileList(*phClientHandle,
&pInterface->InterfaceGuid,
NULL,
&pProfileList);
if(ERROR_SUCCESS != dwError)
{
PrintMsg(L"WlanGetProfileList() Failed Error : %d",dwError);
break;
}
if(NULL == pProfileList)
{
PrintMsg(L"WlanGetProfileList() returned NULL ProfileList");
break;
}
for(DWORD i =0;i<pProfileList->dwNumberOfItems;i++)
{
PrintMsg(L"");
PrintMsg(L"Index : %lu",i);
PrintMsg(L"Flags : %lu",pProfileList->ProfileInfo[i].dwFlags);
PrintMsg(L"ProfileName : %s",pProfileList->ProfileInfo[i].strProfileName);
ListProfile(strAdapter,pProfileList->ProfileInfo[i].strProfileName);
}
bResult = TRUE;
}while(FALSE);
if(pProfileList)
WlanFreeMemory(pProfileList);
return bResult;
}
Any help would be appreciated. Thanks in advance.