1

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.

samiaj
  • 421
  • 1
  • 5
  • 15

1 Answers1

0

On Win CE, some device folders and IIRC, Registry Keys are reset at reboot.

You would need to check the documentation for your device and version of Windows to see which storage locations are persistent, and either use them or save and restore to/from them.

Terry Carmen
  • 3,720
  • 1
  • 16
  • 32